iface-helper: don't cache nm_platform_check_support_kernel_extended_ifa_flags() flag

nm_platform_check_support_kernel_extended_ifa_flags() is already cached in a static
variable. Just look it up anew every time.
This commit is contained in:
Thomas Haller
2017-01-10 14:12:51 +01:00
parent a9384452ed
commit 6eb2d60fbe

View File

@@ -148,11 +148,10 @@ ndisc_config_changed (NMNDisc *ndisc, const NMNDiscData *rdata, guint changed_in
NMNDiscConfigMap changed = changed_int; NMNDiscConfigMap changed = changed_int;
static NMIP6Config *ndisc_config = NULL; static NMIP6Config *ndisc_config = NULL;
NMIP6Config *existing; NMIP6Config *existing;
static int system_support = -1; int system_support;
guint32 ifa_flags = 0x00; guint32 ifa_flags = 0x00;
int i; int i;
if (system_support == -1) {
/* /*
* Check, whether kernel is recent enough, to help user space handling RA. * Check, whether kernel is recent enough, to help user space handling RA.
* If it's not supported, we have no ipv6-privacy and must add autoconf * If it's not supported, we have no ipv6-privacy and must add autoconf
@@ -161,7 +160,6 @@ ndisc_config_changed (NMNDisc *ndisc, const NMNDiscData *rdata, guint changed_in
* from adding a prefix route for this address. * from adding a prefix route for this address.
**/ **/
system_support = nm_platform_check_support_kernel_extended_ifa_flags (NM_PLATFORM_GET); system_support = nm_platform_check_support_kernel_extended_ifa_flags (NM_PLATFORM_GET);
}
if (system_support) if (system_support)
ifa_flags = IFA_F_NOPREFIXROUTE; ifa_flags = IFA_F_NOPREFIXROUTE;