From 71ad568cfb5392d63e2899b5122829ba55fd5f80 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 22 Mar 2012 00:41:53 -0500 Subject: [PATCH] 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. --- src/nm-system.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/nm-system.c b/src/nm-system.c index e15b85b227..ed75b3f7f6 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -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; }