diff options
author | Thomas Haller <thaller@redhat.com> | 2019-04-09 12:55:32 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-04-10 09:02:35 +0200 |
commit | f5e8bbc8e082520af714df290da262ad731ccc4d (patch) | |
tree | 1740745ca274eb22ee611152b7fc4a83e2ef2183 /src/nm-ip4-config.c | |
parent | c48698d74778f1ac1c06bb8713b18e8d1edc1e24 (diff) |
libnm,core: enable "onlink" flags also for IPv6 routes
Previously, onlink (RTNH_F_ONLINK) did not work for IPv6.
In the meantime, this works in kernel ([1], [2]). Enable it also
in NetworkManager.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fc1e64e1092f62290d59151d16f9de0210e303c8
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=68e2ffdeb5dbf54bc3a0684aa4e73c6db8675eed
https://github.com/NetworkManager/NetworkManager/pull/337
Diffstat (limited to 'src/nm-ip4-config.c')
-rw-r--r-- | src/nm-ip4-config.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index 2f9db03b66..4821ec6b17 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -859,15 +859,12 @@ _nm_ip_config_merge_route_attributes (int addr_family, GET_ATTR (NM_IP_ROUTE_ATTRIBUTE_TABLE, table, UINT32, uint32, 0); r->table_coerced = nm_platform_route_table_coerce (table ?: (route_table ?: RT_TABLE_MAIN)); - if (addr_family == AF_INET) { + if (addr_family == AF_INET) GET_ATTR (NM_IP_ROUTE_ATTRIBUTE_TOS, r4->tos, BYTE, byte, 0); - GET_ATTR (NM_IP_ROUTE_ATTRIBUTE_ONLINK, onlink, BOOLEAN, boolean, FALSE); - } else - onlink = FALSE; - r->r_rtm_flags = 0; - if (onlink) - r->r_rtm_flags = RTNH_F_ONLINK; + GET_ATTR (NM_IP_ROUTE_ATTRIBUTE_ONLINK, onlink, BOOLEAN, boolean, FALSE); + + r->r_rtm_flags = ((onlink) ? (unsigned) RTNH_F_ONLINK : 0u); GET_ATTR (NM_IP_ROUTE_ATTRIBUTE_WINDOW, r->window, UINT32, uint32, 0); GET_ATTR (NM_IP_ROUTE_ATTRIBUTE_CWND, r->cwnd, UINT32, uint32, 0); |