mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
backport: "Add support for setting phys-dev for VXLAN interfaces."
backporting the following commit to master-next:
commit eb92e5efff
Author: Maximilian Wilhelm <max@rfc2324.org>
Date: Thu Oct 6 19:22:06 2016 +0200
Add support for setting phys-dev for VXLAN interfaces.
Add interface configuration option »vxlan-physdev« to set »dev« attribute
of VXLAN interfaces and a check for the running configuration.
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
This backport also:
- adds support for ifquery --running
- uses the netlink cache
- includes some pep8 fixes
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
Co-authored-by: Julien Fortin <julien@cumulusnetworks.com>
Co-authored-by: Maximilian Wilhelm <max@rfc2324.org>
This commit is contained in:
@@ -969,7 +969,7 @@ class NetlinkManager(object):
|
||||
return self.tx_nlpacket_get_response(nbr)
|
||||
|
||||
def link_add_vxlan(self, ifname, vxlanid, dstport=None, local=None,
|
||||
group=None, learning=True, ageing=None):
|
||||
group=None, learning=True, ageing=None, physdev=None):
|
||||
|
||||
debug = RTM_NEWLINK in self.debug
|
||||
|
||||
@@ -986,6 +986,9 @@ class NetlinkManager(object):
|
||||
if ageing:
|
||||
info_data[Link.IFLA_VXLAN_AGEING] = int(ageing)
|
||||
|
||||
if physdev:
|
||||
info_data[Link.IFLA_VXLAN_LINK] = int(physdev)
|
||||
|
||||
link = Link(RTM_NEWLINK, debug, use_color=self.use_color)
|
||||
link.flags = NLM_F_CREATE | NLM_F_REQUEST | NLM_F_ACK
|
||||
link.body = pack('Bxxxiii', socket.AF_UNSPEC, 0, 0, 0)
|
||||
|
Reference in New Issue
Block a user