From 9bbf9f031b1a51b6977ffac8fa633c37dc99eba8 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 29 Jul 2014 19:13:31 +0200 Subject: [PATCH] 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 (cherry picked from commit a7f05b84f82e76417e7732c33246243495f51262) --- src/nm-ip6-config.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index aaf5e70163..7a1f74af70 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -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);