core: fix setting next_hop in nm_ip6_config_create_setting()

The next-hop should always be set to route->gateway. Just as
it is done in the IPv4 case too.

This bug only affected routes to '::/p via gateway', with a
non-zero gateway and p > 0. That is a quite uncommon case, because
usually non-default routes have not a net-part all zero.

Signed-off-by: Thomas Haller <thaller@redhat.com>
(cherry picked from commit a7f05b84f8)
This commit is contained in:
Thomas Haller 2014-07-29 19:13:31 +02:00
parent 1feefce5d3
commit 9bbf9f031b

View file

@ -560,8 +560,7 @@ nm_ip6_config_create_setting (const NMIP6Config *config)
s_route = nm_ip6_route_new ();
nm_ip6_route_set_dest (s_route, &route->network);
nm_ip6_route_set_prefix (s_route, route->plen);
if (!IN6_IS_ADDR_UNSPECIFIED (&route->network))
nm_ip6_route_set_next_hop (s_route, &route->gateway);
nm_ip6_route_set_next_hop (s_route, &route->gateway);
nm_ip6_route_set_metric (s_route, route->metric);
nm_setting_ip6_config_add_route (s_ip6, s_route);