summaryrefslogtreecommitdiff
path: root/src/network/networkd.h
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-07-22 16:54:47 -0500
committerTom Gundersen <teg@jklm.no>2014-07-23 09:19:32 +0200
commit28cc555d8504c9429776aedbbe1fee7101258578 (patch)
tree9b681a3243156df7113eaf82ad5811c8a6138a1f /src/network/networkd.h
parent82eb1e7efbe3ca8620d2b183af37c4fd34bf8bb3 (diff)
networkd: set route protocol
All routes added by networkd are currently set RTPROT_BOOT, which according to the kernel means "Route installed during boot" (rtnetlink.h). But this is not always the case as networkd changes routing after boot too. Since the kernel gives more detailed protocols, use them. With this patch, user-configured static routes now use RTPROT_STATIC (which they are) and DHCP routes use RTPROT_DHCP. There is no define for IPv4LL yet, so those are installed as RTPROT_STATIC (though perhaps RTPROT_RA is better?). [tomegun: fixup src/network/networkd-link.c:972:33: error: too few arguments to function 'route_new_dynamic']
Diffstat (limited to 'src/network/networkd.h')
-rw-r--r--src/network/networkd.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/networkd.h b/src/network/networkd.h
index f1c7f204ea..7d291e5ea3 100644
--- a/src/network/networkd.h
+++ b/src/network/networkd.h
@@ -137,6 +137,7 @@ struct Route {
unsigned char dst_prefixlen;
unsigned char scope;
uint32_t metrics;
+ unsigned char protocol; /* RTPROT_* */
union in_addr_union in_addr;
union in_addr_union dst_addr;
@@ -305,7 +306,7 @@ const struct ConfigPerfItem* network_network_gperf_lookup(const char *key, unsig
/* Route */
int route_new_static(Network *network, unsigned section, Route **ret);
-int route_new_dynamic(Route **ret);
+int route_new_dynamic(Route **ret, unsigned char rtm_protocol);
void route_free(Route *route);
int route_configure(Route *route, Link *link, sd_rtnl_message_handler_t callback);
int route_drop(Route *route, Link *link, sd_rtnl_message_handler_t callback);