[PATCH] nwfilter: fix loop generating too many rules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The loop processing the trusted DHCP server generated one too
many rules and added one final rules that accepted responses
from all DHCP servers. Below patch fixes this.
---
 src/nwfilter/nwfilter_ebiptables_driver.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
===================================================================
--- libvirt-acl.orig/src/nwfilter/nwfilter_ebiptables_driver.c
+++ libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -3374,10 +3374,10 @@ ebtablesApplyDHCPOnlyRules(const char *i

         VIR_FREE(srcIPParam);

-        if (idx == num_dhcpsrvrs)
-            break;
-
         idx++;
+
+        if (idx >= num_dhcpsrvrs)
+            break;
     }

     virBufferAsprintf(&buf,

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]