summaryrefslogtreecommitdiffstats
path: root/iptables/xtables-restore.c
diff options
context:
space:
mode:
Diffstat (limited to 'iptables/xtables-restore.c')
-rw-r--r--iptables/xtables-restore.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/iptables/xtables-restore.c b/iptables/xtables-restore.c
index 83e05102..5a534ca2 100644
--- a/iptables/xtables-restore.c
+++ b/iptables/xtables-restore.c
@@ -88,7 +88,9 @@ static void xtables_restore_parse_line(struct nft_handle *h,
if (verbose)
fputs(buffer, stdout);
return;
- } else if ((strcmp(buffer, "COMMIT\n") == 0) && state->in_table) {
+ } else if (state->in_table &&
+ (strncmp(buffer, "COMMIT", 6) == 0) &&
+ (buffer[6] == '\0' || buffer[6] == '\n')) {
if (!p->testing) {
/* Commit per table, although we support
* global commit at once, stick by now to