ipv6: restore the ability to set a default IPv6 route via a device (rh #829010)

replace_default_ip6_route() was mistakenly requiring gw to be
non-NULL, which meant it could only set the route via a gateway, not
via a device (thus breaking IPv6-over-openconnect)
This commit is contained in:
Dan Winship 2012-09-26 10:22:21 -04:00
parent bbbf9ad37b
commit 89b08a0243

View file

@ -1160,12 +1160,16 @@ replace_default_ip6_route (int ifindex, const struct in6_addr *gw, int mss)
char gw_str[INET6_ADDRSTRLEN + 1];
g_return_val_if_fail (ifindex > 0, FALSE);
g_return_val_if_fail (gw != NULL, FALSE);
if (nm_logging_level_enabled (LOGL_DEBUG)) {
memset (gw_str, 0, sizeof (gw_str));
if (inet_ntop (AF_INET6, gw, gw_str, sizeof (gw_str) - 1))
nm_log_dbg (LOGD_IP6, "Setting IPv6 default route via %s", gw_str);
if (gw) {
memset (gw_str, 0, sizeof (gw_str));
if (inet_ntop (AF_INET6, gw, gw_str, sizeof (gw_str) - 1))
nm_log_dbg (LOGD_IP6, "Setting IPv6 default route via %s", gw_str);
} else {
nm_log_dbg (LOGD_IP6, "Setting IPv6 default route via %s",
nm_netlink_index_to_iface (ifindex));
}
}
/* We can't just use NLM_F_REPLACE here like in the IPv4 case, because