diff options
author | Thomas Haller <thaller@redhat.com> | 2017-07-27 06:47:11 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-08-03 18:33:00 +0200 |
commit | bf348cde694d87a2862abf52491e6df6718e8b42 (patch) | |
tree | 23275b3cb233e3ef96e251caa07a97c60bbfa914 | |
parent | 8fc669c02ac3ec37161ba10b22eec8e3997ac501 (diff) | |
download | NetworkManager-bf348cde694d87a2862abf52491e6df6718e8b42.tar.gz |
platform: cleanup handling "window" for non-exclusive routes
-rw-r--r-- | src/platform/nm-linux-platform.c | 15 | ||||
-rw-r--r-- | src/platform/nm-platform.c | 2 | ||||
-rw-r--r-- | src/platform/nm-platform.h | 23 |
3 files changed, 26 insertions, 14 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 85f63e777d..37fe7398d0 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -2421,7 +2421,6 @@ static struct nl_msg * _nl_msg_new_route (int nlmsg_type, int nlmsg_flags, const NMPObject *obj, - guint32 window, guint32 cwnd, guint32 initcwnd, guint32 initrwnd, @@ -2484,7 +2483,12 @@ _nl_msg_new_route (int nlmsg_type, } if ( obj->ip_route.mss - || window || cwnd || initcwnd || initrwnd || mtu || lock) { + || obj->ip_route.window + || cwnd + || initcwnd + || initrwnd + || mtu + || lock) { struct nlattr *metrics; metrics = nla_nest_start (msg, RTA_METRICS); @@ -2493,8 +2497,8 @@ _nl_msg_new_route (int nlmsg_type, if (obj->ip_route.mss) NLA_PUT_U32 (msg, RTAX_ADVMSS, obj->ip_route.mss); - if (window) - NLA_PUT_U32 (msg, RTAX_WINDOW, window); + if (obj->ip_route.window) + NLA_PUT_U32 (msg, RTAX_WINDOW, obj->ip_route.window); if (cwnd) NLA_PUT_U32 (msg, RTAX_CWND, cwnd); if (initcwnd) @@ -5712,7 +5716,6 @@ ip4_route_add (NMPlatform *platform, const NMPlatformIP4Route *route) nlmsg = _nl_msg_new_route (RTM_NEWROUTE, NLM_F_CREATE | NLM_F_REPLACE, &obj, - route->window, route->cwnd, route->initcwnd, route->initrwnd, @@ -5737,7 +5740,6 @@ ip6_route_add (NMPlatform *platform, const NMPlatformIP6Route *route) nlmsg = _nl_msg_new_route (RTM_NEWROUTE, NLM_F_CREATE | NLM_F_REPLACE, &obj, - route->window, route->cwnd, route->initcwnd, route->initrwnd, @@ -5797,7 +5799,6 @@ ip_route_delete (NMPlatform *platform, 0, 0, 0, - 0, 0); if (!nlmsg) return FALSE; diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index 9b2d1adb70..6884a2b528 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -4756,6 +4756,7 @@ nm_platform_ip4_route_hash (const NMPlatformIP4Route *obj, NMPlatformIPRouteCmpT h = NM_HASH_COMBINE (h, obj->gateway); h = NM_HASH_COMBINE (h, obj->mss); h = NM_HASH_COMBINE (h, obj->pref_src); + h = NM_HASH_COMBINE (h, obj->window); } break; case NM_PLATFORM_IP_ROUTE_CMP_TYPE_SEMANTICALLY: @@ -4813,6 +4814,7 @@ nm_platform_ip4_route_cmp (const NMPlatformIP4Route *a, const NMPlatformIP4Route NM_CMP_FIELD (a, b, gateway); NM_CMP_FIELD (a, b, mss); NM_CMP_FIELD (a, b, pref_src); + NM_CMP_FIELD (a, b, window); } break; case NM_PLATFORM_IP_ROUTE_CMP_TYPE_SEMANTICALLY: diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h index 66c720aee1..4043029ee9 100644 --- a/src/platform/nm-platform.h +++ b/src/platform/nm-platform.h @@ -355,18 +355,27 @@ typedef union { \ guint32 metric; \ \ - /* RTA_METRICS.RTAX_ADVMSS. For IPv4 routes, this is part of their + guint32 tos; \ + \ + \ + /* RTA_METRICS: + * + * For IPv4 routes, these properties are part of their * ID (meaning: you can add otherwise idential IPv4 routes that - * only differ by mss). On the other hand, for IPv6 you cannot add two - * IPv6 routes that only differ by mss. + * only differ by the metric property). + * On the other hand, for IPv6 you cannot add two IPv6 routes that only differ + * by an RTA_METRICS property. * - * When deleting a route, kernel seems to ignore RTA_METRICS.RTAX_ADVMSS. - * Which is a problem for IPv4 because you cannot explicitly select which - * route to delete. Kernel just picks the first. */ \ + * When deleting a route, kernel seems to ignore the RTA_METRICS propeties. + * That is a problem/bug for IPv4 because you cannot explicitly select which + * route to delete. Kernel just picks the first. See rh#1475642. */ \ + \ + /* RTA_METRICS.RTAX_ADVMSS (iproute2: advmss) */ \ guint32 mss; \ \ - guint32 tos; \ + /* RTA_METRICS.RTAX_WINDOW (iproute2: window) */ \ guint32 window; \ + \ guint32 cwnd; \ guint32 initcwnd; \ guint32 initrwnd; \ |