1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

Remove clag_enable dependancy from ifupdown2.

Ticket: CM-9078
Reviewed By: CCR-4110
Testing Done: clag bond add/del and clag slave add/del

This change basically does the following -
1. Proto-down swpX pre-clag-bond-enslave
2. Proto-up swpX post-clag-bond-release

Setting/clearing of clag-id will result in similar proto-state changes
and those are handled by clagd.

Note:
I really wanted to keep these changes out of ifupdown2 but the
order of setting is critical i.e. protodown has to happen enslave to
prevent additional flaps/STP TCNs. Theoretically #2 can be done by clagd
but there is no easy way to do #1.
This commit is contained in:
Anuradha Karuppiah
2016-02-10 10:46:11 -08:00
parent 42517ec5f7
commit 1c89fd85ff
3 changed files with 75 additions and 7 deletions

View File

@@ -168,7 +168,7 @@ class Nlmsg(Structure):
def rta_uint8(self, rta, value=None):
data = RTA_DATA(rta)
if value:
if value is not None:
c_uint8.from_address(data).value = value
rta.rta_len = RTA_LENGTH(sizeof(c_uint8))
return rta.rta_len
@@ -184,6 +184,15 @@ class Nlmsg(Structure):
else:
return c_uint16.from_address(data).value
def rta_sint32(self, rta, value=None):
data = RTA_DATA(rta)
if value is not None:
c_int32.from_address(data).value = value
rta.rta_len = RTA_LENGTH(sizeof(c_int32))
return rta.rta_len
else:
return c_int32.from_address(data).value
def rta_uint32(self, rta, value=None):
data = RTA_DATA(rta)
if value:
@@ -545,8 +554,17 @@ IFLA_AF_SPEC = 26
IFLA_GROUP = 27 # Group the device belongs to
IFLA_NET_NS_FD = 28
IFLA_EXT_MASK = 29 # Extended info mask, VFs, etc
IFLA_MAX = 29
IFLA_PROMISCUITY = 30
IFLA_NUM_TX_QUEUES = 31
IFLA_NUM_RX_QUEUES = 32
IFLA_CARRIER = 33
IFLA_PHYS_PORT_ID = 34
IFLA_CARRIER_CHANGES = 35
IFLA_PHYS_SWITCH_ID = 36
IFLA_LINK_NETNSID = 37
IFLA_PHYS_PORT_NAME = 38
IFLA_PROTO_DOWN = 39
IFLA_MAX = 40
# IFLA_LINKINFO attributes
IFLA_INFO_UNSPEC = 0
@@ -666,6 +684,16 @@ class Ifinfomsg(Nlmsg):
IFLA_GROUP: self.rta_none,
IFLA_NET_NS_FD: self.rta_none,
IFLA_EXT_MASK: self.rta_none,
IFLA_PROMISCUITY: self.rta_uint32,
IFLA_NUM_TX_QUEUES: self.rta_uint32,
IFLA_NUM_RX_QUEUES: self.rta_uint32,
IFLA_CARRIER: self.rta_uint8,
IFLA_PHYS_PORT_ID: self.rta_uint8_array,
IFLA_CARRIER_CHANGES: self.rta_uint32,
IFLA_PHYS_SWITCH_ID: self.rta_uint8_array,
IFLA_LINK_NETNSID: self.rta_sint32,
IFLA_PHYS_PORT_NAME: self.rta_string,
IFLA_PROTO_DOWN: self.rta_uint8,
}
return fns;
@@ -701,6 +729,16 @@ class Ifinfomsg(Nlmsg):
IFLA_GROUP: self.rta_none,
IFLA_NET_NS_FD: self.rta_none,
IFLA_EXT_MASK: self.rta_none,
IFLA_PROMISCUITY: self.rta_uint32,
IFLA_NUM_TX_QUEUES: self.rta_uint32,
IFLA_NUM_RX_QUEUES: self.rta_uint32,
IFLA_CARRIER: self.rta_uint8,
IFLA_PHYS_PORT_ID: self.rta_uint8_array,
IFLA_CARRIER_CHANGES: self.rta_uint32,
IFLA_PHYS_SWITCH_ID: self.rta_uint8_array,
IFLA_LINK_NETNSID: self.rta_sint32,
IFLA_PHYS_PORT_NAME: self.rta_string,
IFLA_PROTO_DOWN: self.rta_uint8,
}
return fns.get(rta_type)