Hi, The attached patch appears to be required for setting the default gateway for IPv6 with libnl3 (tested with libnl3 3.0). It comes with a small fix to catch the return code for nm_netlink_route_add() so success is correctly reported as such (or to get the "right" error message).
Regards, Mathieu Trudel-Lapierre <[email protected]> Freenode: cyphermox, Jabber: [email protected] 4096R/EE018C93 1967 8F7D 03A1 8F38 732E FF82 C126 33E1 EE01 8C93
From 53abe8f2e54ea02aefabb768f159ca40497db02f Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre <[email protected]> Date: Fri, 7 Oct 2011 15:28:27 -0400 Subject: [PATCH] fix default route destination and error reporting --- src/nm-system.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/nm-system.c b/src/nm-system.c index 473fcec..9d425e6 100644 --- a/src/nm-system.c +++ b/src/nm-system.c @@ -984,6 +984,7 @@ replace_default_ip6_route (int ifindex, const struct in6_addr *gw) struct nl_sock *nlh; const char *iface; int err = -1; + const struct in6_addr dest = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }; g_return_val_if_fail (ifindex > 0, FALSE); @@ -1000,7 +1001,7 @@ replace_default_ip6_route (int ifindex, const struct in6_addr *gw) g_return_val_if_fail (route != NULL, -ENOMEM); /* Add the new default route */ - nm_netlink_route_add(route, AF_INET6, NULL, 0, gw, NLM_F_REPLACE); + err = nm_netlink_route_add(route, AF_INET6, &dest, 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 -- 1.7.5.4
_______________________________________________ networkmanager-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/networkmanager-list
