GNOME Bugzilla – Bug 761371
[review] device: add ext_ip6_config_captured to hold last-read IP configuration [th/device-ext-ip6-config-captured-bgo761371]
Last modified: 2016-02-02 10:59:46 UTC
I think that http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=2d1638bba95fa19f2e20caf016460eaecc8ee496 is not entirely correct (neither was the previous version). ip6_config is the combined intend of what should be configured on the device. ext_ip6_config is what is actually configured on the device but not in any of the other ip6-config instances (thus, the truly externally configured parts). Please review
> device: add ext_ip6_config_captured to remember the last-read platform configuration NMIP6Config * ext_ip6_config; /* Stuff added outside NM */ + NMIP6Config * ext_ip6_config_captured; /* Stuff added outside NM */ Change to /* Last captured platform configuration */ or something similar ? > device: move have_ip6_address() to nm_ip6_config_get_address_first_nontentative() + if ( ((!!IN6_IS_ADDR_LINKLOCAL (&addr->address)) == linklocal) The !! is not needed, IN6_IS_ADDR_LINKLOCAL already returns [0,1]. Otherwise LGTM.
(In reply to Beniamino Galvani from comment #1) > > device: add ext_ip6_config_captured to remember the last-read platform configuration > > NMIP6Config * ext_ip6_config; /* Stuff added outside NM */ > + NMIP6Config * ext_ip6_config_captured; /* Stuff added outside NM */ > > Change to /* Last captured platform configuration */ or something similar ? reworded. > > device: move have_ip6_address() to nm_ip6_config_get_address_first_nontentative() > > + if ( ((!!IN6_IS_ADDR_LINKLOCAL (&addr->address)) == linklocal) > > The !! is not needed, IN6_IS_ADDR_LINKLOCAL already returns [0,1]. which we both know by looking at our particular implementation of "in.h". The manual page inet(3N) reads: The IN6_IS_ADDR_* macros evaluate to true (non zero) if true, otherwise they evaluate to 0. does that mean true equals "1"? Maybe... but let's just be explict about that. Comparing boolean integers with == seems always shaky to me (in C).
merged: http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=a75f358be5f7608fc67f2e9b6ea6bf7c20066b7b