mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-26 01:50:39 +01:00
ip6: fix setting default route with libnl3 (bgo #668286)
libnl3 wants a destination address when setting a route, so just hand it '::' with a address len of 0 so we don't get -NLE_MISSING_ATTR when trying to set the IPv6 default route.
This commit is contained in:
parent
1ecc9c215c
commit
71ad568cfb
1 changed files with 2 additions and 3 deletions
|
|
@ -1041,11 +1041,10 @@ replace_default_ip6_route (int ifindex, const struct in6_addr *gw)
|
|||
g_return_val_if_fail (route != NULL, -ENOMEM);
|
||||
|
||||
/* Add the new default route */
|
||||
err = nm_netlink_route6_add (route, NULL, 0, gw, NLM_F_REPLACE);
|
||||
err = nm_netlink_route6_add (route, &in6addr_any, 0, gw, NLM_F_REPLACE);
|
||||
if (err == -NLE_EXIST) {
|
||||
/* FIXME: even though we use NLM_F_REPLACE the kernel won't replace
|
||||
* the route if it's the same. Should try to remove it first, then
|
||||
* add the new one again here.
|
||||
* the route if it's the same. Suppress the pointless error.
|
||||
*/
|
||||
err = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue