summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libnm-core/nm-setting-ip-config.c9
-rw-r--r--libnm-core/tests/test-setting.c4
2 files changed, 8 insertions, 5 deletions
diff --git a/libnm-core/nm-setting-ip-config.c b/libnm-core/nm-setting-ip-config.c
index 458d93b30d..56b16d414a 100644
--- a/libnm-core/nm-setting-ip-config.c
+++ b/libnm-core/nm-setting-ip-config.c
@@ -3110,7 +3110,8 @@ nm_ip_routing_rule_from_string (const char *str,
goto next_words_consumed;
}
if (NM_IN_STRSET (word0, "not")) {
- /* we accept multiple "not" specifiers. */
+ /* we accept multiple "not" specifiers. "not not" still means
+ * not. */
val_invert = TRUE;
goto next_words_consumed;
}
@@ -3460,15 +3461,15 @@ nm_ip_routing_rule_to_string (const NMIPRoutingRule *self,
str = g_string_sized_new (30);
- if (self->invert)
- g_string_append (str, "not");
-
if (self->priority_has) {
g_string_append_printf (nm_gstring_add_space_delimiter (str),
"priority %u",
(guint) self->priority);
}
+ if (self->invert)
+ g_string_append (nm_gstring_add_space_delimiter (str), "not");
+
_rr_string_append_inet_addr (str,
TRUE,
( !self->to_has
diff --git a/libnm-core/tests/test-setting.c b/libnm-core/tests/test-setting.c
index aa9de5a03d..3438aea99d 100644
--- a/libnm-core/tests/test-setting.c
+++ b/libnm-core/tests/test-setting.c
@@ -3168,7 +3168,9 @@ test_routing_rule (gconstpointer test_data)
_rr_from_str ("priority 5 from :: iif a\\\\303b table 25");
_rr_from_str ("priority 5 to 0.0.0.0 sport 10 table 6",
"priority 5 to 0.0.0.0 sport 10-10 table 6");
- _rr_from_str ("not priority 5 to 0.0.0.0 dport 10-133 table 6",
+ _rr_from_str ("priority 5 not to 0.0.0.0 dport 10-133 table 6",
+ "not priority 5 to 0.0.0.0 dport 10-133 table 6",
+ "not priority 5 not to 0.0.0.0 dport 10-133 table 6",
"priority 5 to 0.0.0.0 not dport 10-133 not table 6",
"priority 5 to 0.0.0.0 not dport 10-\\ 133 not table 6");
_rr_from_str ("priority 5 to 0.0.0.0 ipproto 10 sport 10 table 6");