From: Ondrej Lichtner <olichtne(a)redhat.com>
The IFLA_LINKINFO attribute IFLA_INFO_KIND should only be present in a
netlink message if there's also other IFLA_LINKINFO attributes being
configured. The old code used to work with older versions of pyroute2,
but after 0.5.2 that introduced a fix our code stopped working.
This fixes the issue.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Devices/SoftDevice.py | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/lnst/Devices/SoftDevice.py b/lnst/Devices/SoftDevice.py
index f566092..c5a1219 100644
--- a/lnst/Devices/SoftDevice.py
+++ b/lnst/Devices/SoftDevice.py
@@ -51,17 +51,8 @@ def name(self):
except:
return self._orig_name
- def _nl_sync(self, op, ipr_attrs=None, bulk=False):
- if ipr_attrs is None:
- self._update_attr(self._link_type, "IFLA_LINKINFO",
- "IFLA_INFO_KIND")
- else:
- self._set_nested_nl_attr(ipr_attrs, self._link_type,
- "IFLA_LINKINFO",
"IFLA_INFO_KIND")
-
- super(SoftDevice, self)._nl_sync(op, ipr_attrs, bulk)
-
def _set_linkinfo_data_attr(self, attr, val):
+ self._update_attr(self._link_type, "IFLA_LINKINFO",
"IFLA_INFO_KIND")
self._update_attr(val, "IFLA_LINKINFO", "IFLA_INFO_DATA",
attr)
def _get_linkinfo_data_attr(self, attr_name):
@@ -69,6 +60,7 @@ def _get_linkinfo_data_attr(self, attr_name):
attr_name)
def _create(self):
+ self._update_attr(self._link_type, "IFLA_LINKINFO",
"IFLA_INFO_KIND")
try:
self._nl_sync("add", bulk=True)
except Exception as e:
--
2.21.0