binding/python: ifindex 0 is invalid so do not process it
On some platforms, libraries underpinning libteam assert that an ifindex
passed to them is not zero so an ifindex of zero cannot be passed down.
This patch alters libteam processing order to ensure that this is the
case.
Signed-off-by: Paul D.Smith <pauldsmith@microsoft.com>
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
diff --git a/binding/python/team/core.py b/binding/python/team/core.py
index 54161bf..b8569f9 100644
--- a/binding/python/team/core.py
+++ b/binding/python/team/core.py
@@ -101,7 +101,8 @@
@ifindex.setter
def ifindex(self, ifindex):
self._ifindex = ifindex
- self.ifname = self._conv.dev_ifname(ifindex)
+ if self.ifindex:
+ self.ifname = self._conv.dev_ifname(ifindex)
def get_hwaddr(self):
err, hwaddr = capi.team_hwaddr_get(self._th, self.ifindex, 6)