Skip to content

Commit 5d6e1d4

Browse files
committed
Merge pull request #895
Fix sysctl values for loopback device (bsc#1181163, bsc#1178357) * Discard config requests on sysctl variables which have the value "-1" (bsc#1181163, bsc#1178357) * Do not inherit "default" and "all" settings for loopback device (bsc#1181163)
2 parents 1c2c048 + 32fe501 commit 5d6e1d4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

client/suse/compat-suse.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6113,7 +6113,9 @@ ni_suse_ifcfg_get_firewall(const ni_sysconfig_t *sc, ni_compat_netdev_t *compat)
61136113
static const ni_var_t *
61146114
__ifsysctl_get_var(ni_var_array_t *vars, const char *path, const char *ifname, const char *attr)
61156115
{
6116-
const char *names[] = { "all", "default", ifname, NULL };
6116+
const char *def_names[] = { "all", "default", ifname, NULL };
6117+
const char *lo_names[] = { ifname, NULL };
6118+
const char **names = ni_string_eq(ifname, "lo") ? lo_names : def_names;
61176119
const char **name;
61186120
const ni_var_t *ret = NULL;
61196121
const ni_var_t *var;

src/ipv6.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ __change_int(const char *ifname, const char *attr, int value)
352352
static ni_bool_t
353353
__tristate_changed(ni_tristate_t cfg, ni_tristate_t sys)
354354
{
355-
return ni_tristate_is_set(cfg) && cfg != sys;
355+
return ni_tristate_is_set(sys) && ni_tristate_is_set(cfg) && cfg != sys;
356356
}
357357

358358
int
@@ -831,7 +831,7 @@ __ni_ipv6_devconf_process_flag(ni_netdev_t *dev, unsigned int flag, int value)
831831
ipv6->conf.accept_ra = value < 0 ? 0 : value > 2 ? 2 : value;
832832
break;
833833
case NI_IPV6_DEVCONF_ACCEPT_DAD:
834-
ipv6->conf.accept_dad = value < 0 ? 0 : value > 2 ? 2 : value;
834+
ipv6->conf.accept_dad = value < -1 ? -1 : value > 2 ? 2 : value;
835835
break;
836836
case NI_IPV6_DEVCONF_AUTOCONF:
837837
ipv6->conf.autoconf = !!value;

0 commit comments

Comments
 (0)