From: Susant Sahani Date: Tue, 6 Jun 2017 16:02:31 +0000 (+0000) Subject: networkd: fix route table from unsigned char to uint32_t (#6083) X-Git-Tag: v234~142 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14d20d2bfb221e411c42528546cb9f1bbcb2e879;p=thirdparty%2Fsystemd.git networkd: fix route table from unsigned char to uint32_t (#6083) [zj: struct Route is defined with uint32_t route, so this makes the type of the function parameter match the field it is assigned to.] --- diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index 9535016af78..e5d61ce8cc6 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -230,7 +230,7 @@ int route_get(Link *link, unsigned char dst_prefixlen, unsigned char tos, uint32_t priority, - unsigned char table, + uint32_t table, Route **ret) { Route route, *existing; @@ -272,7 +272,7 @@ static int route_add_internal( unsigned char dst_prefixlen, unsigned char tos, uint32_t priority, - unsigned char table, + uint32_t table, Route **ret) { _cleanup_route_free_ Route *route = NULL; @@ -318,7 +318,7 @@ int route_add_foreign( unsigned char dst_prefixlen, unsigned char tos, uint32_t priority, - unsigned char table, + uint32_t table, Route **ret) { return route_add_internal(link, &link->routes_foreign, family, dst, dst_prefixlen, tos, priority, table, ret); @@ -331,7 +331,7 @@ int route_add( unsigned char dst_prefixlen, unsigned char tos, uint32_t priority, - unsigned char table, + uint32_t table, Route **ret) { Route *route; diff --git a/src/network/networkd-route.h b/src/network/networkd-route.h index efd1e53d2af..3f389489da9 100644 --- a/src/network/networkd-route.h +++ b/src/network/networkd-route.h @@ -59,9 +59,9 @@ void route_free(Route *route); int route_configure(Route *route, Link *link, sd_netlink_message_handler_t callback); int route_remove(Route *route, Link *link, sd_netlink_message_handler_t callback); -int route_get(Link *link, int family, const union in_addr_union *dst, unsigned char dst_prefixlen, unsigned char tos, uint32_t priority, unsigned char table, Route **ret); -int route_add(Link *link, int family, const union in_addr_union *dst, unsigned char dst_prefixlen, unsigned char tos, uint32_t priority, unsigned char table, Route **ret); -int route_add_foreign(Link *link, int family, const union in_addr_union *dst, unsigned char dst_prefixlen, unsigned char tos, uint32_t priority, unsigned char table, Route **ret); +int route_get(Link *link, int family, const union in_addr_union *dst, unsigned char dst_prefixlen, unsigned char tos, uint32_t priority, uint32_t table, Route **ret); +int route_add(Link *link, int family, const union in_addr_union *dst, unsigned char dst_prefixlen, unsigned char tos, uint32_t priority, uint32_t table, Route **ret); +int route_add_foreign(Link *link, int family, const union in_addr_union *dst, unsigned char dst_prefixlen, unsigned char tos, uint32_t priority, uint32_t table, Route **ret); int route_update(Route *route, const union in_addr_union *src, unsigned char src_prefixlen, const union in_addr_union *gw, const union in_addr_union *prefsrc, unsigned char scope, unsigned char protocol); int route_expire_handler(sd_event_source *s, uint64_t usec, void *userdata);