]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
addons: vxlan: add vxlan-mcastgrp support for single-vxlan device
authorJulien Fortin <julien@cumulusnetworks.com>
Mon, 13 Jul 2020 15:27:25 +0000 (17:27 +0200)
committerJulien Fortin <julien@cumulusnetworks.com>
Thu, 6 Aug 2020 12:20:41 +0000 (14:20 +0200)
this patch adds support for the vxlan-mcastgrp attribute on single
vxlan device. Prior to this commit the vxlan-mcastgrp was only
applied to regular vxlans.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
ifupdown2/addons/vxlan.py
ifupdown2/lib/iproute2.py

index 4cac2e453af0b0eecf5692018b942524a0049b12..b6f5b6facd2bb8707852820f99f56b0dcff82ce1 100644 (file)
@@ -796,6 +796,8 @@ class vxlan(Addon, moduleBase):
                         self.iproute2.link_add_single_vxlan(
                             ifname,
                             local.ip if local else None,
+                            group.ip if group else None,
+                            vxlan_physdev,
                             user_request_vxlan_info_data.get(Link.IFLA_VXLAN_PORT)
                         )
                 else:
index 8c9d98b69436a0f75809bb498b4e37102f84cde9..2e810df01457ea10d41e0c1a74a90c0b2c7ad058 100644 (file)
@@ -285,7 +285,7 @@ class IPRoute2(Cache, Requirements):
 
     ###
 
-    def link_add_single_vxlan(self, ifname, ip, port):
+    def link_add_single_vxlan(self, ifname, ip, group, physdev, port):
         self.logger.info("creating single vxlan device: %s" % ifname)
 
         cmd = ["link add dev %s type vxlan external" % ifname]
@@ -293,6 +293,12 @@ class IPRoute2(Cache, Requirements):
         if ip:
             cmd.append("local %s" % ip)
 
+        if physdev:
+            cmd.append("dev %s" % physdev)
+
+        if group:
+            cmd.append("group %s" % group)
+
         if port:
             cmd.append("dstport %s" % port)