Skip to content

Commit

Permalink
Agent/InterfaceManager: clear _nl_link_update when remapping a device
Browse files Browse the repository at this point in the history
Resolves an issue when moving a veth device to a namespace. The device will
have _nl_link_update populated with data from generic Device creation (device
appears in the namespace). This data may cause issues for certain device
operations like setting the link up.

To avoid this, clearing the _nl_link_update while remapping the device
solves the issue.

Fixes #367

Signed-off-by: Jan Tluka <[email protected]>
  • Loading branch information
jtluka committed May 9, 2024
1 parent 1e88212 commit 1e45557
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lnst/Agent/InterfaceManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ def remap_device(self, ifindex, clsname, args=[], kwargs={}):
except KeyError as e:
raise DeviceConfigError("%s is a mandatory argument" % e)
remapped_device._bulk_enabled = False
remapped_device._nl_link_update = {}
remapped_device.ifindex = ifindex
self.replace_dev(ifindex, remapped_device)
self.rescan_devices()
Expand Down

0 comments on commit 1e45557

Please sign in to comment.