Skip to content

Commit

Permalink
Workaround for possible race in pyroute2.ipdb
Browse files Browse the repository at this point in the history
In simulation.py, add a call to initdb() to force-refresh the netlink
socket and the interface list.

Signed-off-by: Brenden Blanco <[email protected]>
  • Loading branch information
drzaeus77 committed May 18, 2017
1 parent 634f4b0 commit 97a0cac
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/networking/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def _ns_add_ifc(self, name, ns_ifc, ifc_base_name=None, in_ifc=None,

if out_ifc: out_ifc.up().commit()
ns_ipdb.interfaces.lo.up().commit()
ns_ipdb.initdb()
in_ifc = ns_ipdb.interfaces[in_ifname]
with in_ifc as v:
v.ifname = ns_ifc
Expand Down

0 comments on commit 97a0cac

Please sign in to comment.