components/openstack/neutron/files/agent/evs_l3_agent.py
changeset 1977 12e9c20eef5a
parent 1959 ba86b21a837b
child 1987 6fa18b7a0af6
--- a/components/openstack/neutron/files/agent/evs_l3_agent.py	Thu Jun 26 16:27:27 2014 -0700
+++ b/components/openstack/neutron/files/agent/evs_l3_agent.py	Thu Jun 26 19:18:52 2014 -0700
@@ -306,7 +306,8 @@
         # now setup the IPF rule
         rules = ['block in quick on %s from %s to pool/%d' %
                  (internal_dlname, subnet_cidr, new_ippool_name)]
-        ri.ipfilters_manager.add_ipf_rules(rules)
+        ipversion = netaddr.IPNetwork(subnet_cidr).version
+        ri.ipfilters_manager.add_ipf_rules(rules, ipversion)
 
     def internal_network_removed(self, ri, port):
         internal_dlname = self.get_internal_device_name(port['id'])
@@ -318,7 +319,8 @@
         ippool_name = self._get_ippool_name(port['mac_address'])
         rules = ['block in quick on %s from %s to pool/%d' %
                  (internal_dlname, port['subnet']['cidr'], ippool_name)]
-        ri.ipfilters_manager.remove_ipf_rules(rules)
+        ipversion = netaddr.IPNetwork(port['subnet']['cidr']).version
+        ri.ipfilters_manager.remove_ipf_rules(rules, ipversion)
         # remove the ippool
         ri.ipfilters_manager.remove_ippool(ippool_name, None)
         for internal_port in ri.internal_ports: