> 
> On Thu, 2014-09-11 at 16:14 +0200, Peter Meerwald wrote:
> > -       if (address && c_address && g_strcmp0(address, c_address) != 0)
> > +       if (g_strcmp0(address, c_address) != 0)
> >                 ip_change = true;
> > -       else if (gateway && c_gateway && g_strcmp0(gateway, c_gateway) != 0)
> > +       else if (g_strcmp0(gateway, c_gateway) != 0)
> 
> Nitpick, but plain 'g_strcmp0(...)' is preferred here.

certainly, will do a v2
 
> >                 ip_change = true;
> >         else if (prefixlen != c_prefixlen)
> >                 ip_change = true;
> > -       else if (!c_address || !c_gateway)
> > -               ip_change = true;
> 
> Should this also be 'g_strcmp0(...)'? So that if the gateway changes,
> becomes set or unset, an update is made.

I don't understand the comment;
the patch drops "if (!c_address || !c_gateway)"

if the gateway changes, then "g_strcmp0(gateway, c_gateway)" should handle 
all cases:

NULL and "something2" -> != 0
"something1" and NULL -> != 0
"something1" != "something2" -> != 0
"something1" == "something2" -> 0
NULL and NULL -> 0

similarly for the address 

> >         else
> >                 ip_change = false;

thanks for considering the patch, p.

-- 

Peter Meerwald
+43-664-2444418 (mobile)
_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to