From f1bb254b4bf3e58ad553e5633552f7c57c868ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 18 Oct 2012 09:19:51 +0200 Subject: [PATCH] core: use IN6_IS_ADDR_UNSPECIFIED() macro to test against :: That expresses the intention more explicitly and simplifies the code a bit. Also, the g_assert (gw_addr) is not necessary any more. --- src/nm-policy.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index 48e9fb40dd..c847586021 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -770,8 +770,7 @@ update_ip6_routing (NMPolicy *policy, gboolean force_update) } /* If we don't find a paired gateway, try the generic IPv6 gateway */ - g_assert (gw_addr); - if ( (memcmp (gw_addr->s6_addr, in6addr_any.s6_addr, sizeof (in6addr_any.s6_addr)) == 0) + if ( IN6_IS_ADDR_UNSPECIFIED (gw_addr) && nm_ip6_config_get_gateway (ip6_config)) gw_addr = nm_ip6_config_get_gateway (ip6_config);