Commit b3d5864c authored by Brenden Blanco's avatar Brenden Blanco

Merge pull request #114 from iovisor/weichunc_dev

release IPDB in host ns early
parents 3ba6ad87 b67b607b
......@@ -12,6 +12,7 @@ from netaddr import EUI, IPAddress
from pyroute2 import IPRoute, NetNS, IPDB, NSPopen
from socket import htons, AF_INET
from threading import Thread
from subprocess import call
host_id = int(argv[1])
......@@ -68,11 +69,11 @@ def run():
try:
run()
ipdb.release()
input("")
print("---")
for k, v in mac2host.items():
print(EUI(k.mac), k.ifindex, IPAddress(v.remote_ipv4),
v.tunnel_id, v.rx_pkts, v.tx_pkts)
finally:
for v in ifc_gc: ipdb.interfaces[v].remove().commit()
ipdb.release()
for v in ifc_gc: call(["ip", "link", "del", v])
......@@ -12,6 +12,7 @@ from netaddr import EUI, IPAddress
from pyroute2 import IPRoute, NetNS, IPDB, NSPopen
from socket import htons, AF_INET
from threading import Thread
from subprocess import call
num_hosts = int(argv[1])
host_id = int(argv[2])
......@@ -73,8 +74,8 @@ def run():
try:
run()
ipdb.release()
input("")
print("---")
finally:
for v in ifc_gc: ipdb.interfaces[v].remove().commit()
ipdb.release()
for v in ifc_gc: call(["ip", "link", "del", v])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment