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.
This commit is contained in:
Jiří Klimeš 2012-10-18 09:19:51 +02:00
parent 3d9d70822c
commit f1bb254b4b

View file

@ -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);