]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
nwfilter: Clear all state tracking from a drop rule
authorStefan Berger <stefanb@us.ibm.com>
Fri, 16 Apr 2010 11:34:36 +0000 (07:34 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Fri, 16 Apr 2010 11:34:36 +0000 (07:34 -0400)
Don't use state-matching in a drop rule.

src/nwfilter/nwfilter_ebiptables_driver.c

index b71c356023ecf76e45d0eb47eff015311ca270c0..f6542d52dc2059a0b88c8967c4081997168e6e52 100644 (file)
@@ -1380,13 +1380,16 @@ _iptablesCreateRuleInstance(int directionIn,
         return 0;
     }
 
-    if (match)
-        virBufferVSprintf(&buf, " %s", match);
-
     if (rule->action == VIR_NWFILTER_RULE_ACTION_ACCEPT)
         target = accept_target;
-    else
+    else {
         target = "DROP";
+        match = NULL;
+    }
+
+    if (match)
+        virBufferVSprintf(&buf, " %s", match);
+
 
     virBufferVSprintf(&buf,
                       " -j %s" CMD_DEF_POST CMD_SEPARATOR