Skip to content

Commit

Permalink
close ipr to avoid fd leak
Browse files Browse the repository at this point in the history
Signed-off-by: Yonghong Song <[email protected]>
  • Loading branch information
yonghong-song committed Aug 12, 2015
1 parent 83f800f commit df73a82
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def _ns_add_ifc(self, name, ns_ifc, ifc_base_name=None, in_ifc=None,
# delete the potentially leaf-over veth interfaces
ipr = IPRoute()
for i in ipr.link_lookup(ifname='%sa' % ifc_base_name): ipr.link_remove(i)
ipr.close()
try:
out_ifc = self.ipdb.create(ifname="%sa" % ifc_base_name, kind="veth",
peer="%sb" % ifc_base_name).commit()
Expand Down

0 comments on commit df73a82

Please sign in to comment.