]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
use proxy mode on vxlan interface only when l2-population is activated
authormathieu-rohon <mathieu.rohon@gmail.com>
Wed, 9 Oct 2013 09:13:04 +0000 (11:13 +0200)
committerMark McClain <mark.mcclain@dreamhost.com>
Wed, 16 Oct 2013 14:39:12 +0000 (10:39 -0400)
the proxy mode was set by default on every vxlan interfaces
which leads to inaccessibility between VM that are not hosted
on the same host in a vxlan network

Closes-Bug: #1237082

Change-Id: I34028ee0bdfdccda61c6a29f58759259da060b68
(cherry picked from commit 345f8e1fdc65e0cf23369488d4318c0755d6b65d)

neutron/agent/linux/ip_lib.py
neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
neutron/tests/unit/linuxbridge/test_lb_neutron_agent.py

index c8a0e672a436eb7a82394e41adda08380235c058..b4c9bd072036decf95ede48890175868c82e9d29 100644 (file)
@@ -147,8 +147,8 @@ class IPWrapper(SubProcessBase):
             device.link.set_netns(self.namespace)
 
     def add_vxlan(self, name, vni, group=None, dev=None, ttl=None, tos=None,
-                  local=None, port=None):
-        cmd = ['add', name, 'type', 'vxlan', 'id', vni, 'proxy']
+                  local=None, port=None, proxy=False):
+        cmd = ['add', name, 'type', 'vxlan', 'id', vni]
         if group:
                 cmd.extend(['group', group])
         if dev:
@@ -159,6 +159,8 @@ class IPWrapper(SubProcessBase):
                 cmd.extend(['tos', tos])
         if local:
                 cmd.extend(['local', local])
+        if proxy:
+                cmd.append('proxy')
         # tuple: min,max
         if port and len(port) == 2:
                 cmd.extend(['port', port[0], port[1]])
index d7159a37b515750bd2244ef2aa8bc8b9c6a80936..30f12740596f466f209c7667b8a0e5f3a8f0eedb 100755 (executable)
@@ -256,6 +256,8 @@ class LinuxBridgeManager:
                 args['ttl'] = cfg.CONF.VXLAN.ttl
             if cfg.CONF.VXLAN.tos:
                 args['tos'] = cfg.CONF.VXLAN.tos
+            if cfg.CONF.VXLAN.l2_population:
+                args['proxy'] = True
             int_vxlan = self.ip.add_vxlan(interface, segmentation_id, **args)
             int_vxlan.link.set_up()
             LOG.debug(_("Done creating vxlan interface %s"), interface)
index f115733695d0e83108a37d7e3cc0789f0812030b..535900dd943b1afaa2b77600d5e526737c79ea90 100644 (file)
@@ -361,6 +361,13 @@ class TestLinuxBridgeManager(base.BaseTestCase):
                 add_vxlan_fn.assert_called_with("vxlan-" + seg_id, seg_id,
                                                 group="224.0.0.1",
                                                 dev=self.lbm.local_int)
+                cfg.CONF.set_override('l2_population', 'True', 'VXLAN')
+                self.assertEqual(self.lbm.ensure_vxlan(seg_id),
+                                 "vxlan-" + seg_id)
+                add_vxlan_fn.assert_called_with("vxlan-" + seg_id, seg_id,
+                                                group="224.0.0.1",
+                                                dev=self.lbm.local_int,
+                                                proxy=True)
 
     def test_update_interface_ip_details(self):
         gwdict = dict(gateway='1.1.1.1',