diff options
Diffstat (limited to 'src/settings/plugins')
-rw-r--r-- | src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c | 8 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/shvar.c | 7 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/shvar.h | 1 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c index 84d4c1c682..c279f60115 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c @@ -2085,13 +2085,7 @@ write_ip4_setting (NMConnection *connection, * Some IPv4 setting related options are not cleared, * for no strong reason. */ svUnsetValue (ifcfg, "BOOTPROTO"); - - for (j = -1; j < 256; j++) { - svUnsetValue (ifcfg, numbered_tag (tag, "IPADDR", j)); - svUnsetValue (ifcfg, numbered_tag (tag, "PREFIX", j)); - svUnsetValue (ifcfg, numbered_tag (tag, "NETMASK", j)); - svUnsetValue (ifcfg, numbered_tag (tag, "GATEWAY", j)); - } + svUnsetAll (ifcfg, SV_KEY_TYPE_IP4_ADDRESS); return TRUE; } diff --git a/src/settings/plugins/ifcfg-rh/shvar.c b/src/settings/plugins/ifcfg-rh/shvar.c index 683339ac0b..f814f9a852 100644 --- a/src/settings/plugins/ifcfg-rh/shvar.c +++ b/src/settings/plugins/ifcfg-rh/shvar.c @@ -1159,6 +1159,13 @@ svUnsetAll (shvarFile *s, SvKeyType match_key_type) || IS_NUMBERED_TAG (line->key, "OPTIONS")) goto do_clear; } + if (NM_FLAGS_HAS (match_key_type, SV_KEY_TYPE_IP4_ADDRESS)) { + if ( IS_NUMBERED_TAG (line->key, "IPADDR") + || IS_NUMBERED_TAG (line->key, "PREFIX") + || IS_NUMBERED_TAG (line->key, "NETMASK") + || IS_NUMBERED_TAG (line->key, "GATEWAY")) + goto do_clear; + } continue; do_clear: diff --git a/src/settings/plugins/ifcfg-rh/shvar.h b/src/settings/plugins/ifcfg-rh/shvar.h index 2cf1c30b7d..9bd6c17cd0 100644 --- a/src/settings/plugins/ifcfg-rh/shvar.h +++ b/src/settings/plugins/ifcfg-rh/shvar.h @@ -89,6 +89,7 @@ gboolean svUnsetValue (shvarFile *s, const char *key); typedef enum { SV_KEY_TYPE_ANY = (1LL << 0), SV_KEY_TYPE_ROUTE_SVFORMAT = (1LL << 1), + SV_KEY_TYPE_IP4_ADDRESS = (1LL << 2), } SvKeyType; gboolean svUnsetAll (shvarFile *s, SvKeyType match_key_type); |