run_switch.py: only attempt to create the veths we actually use
diff --git a/run_switch.py b/run_switch.py
index 382d109..200c1aa 100755
--- a/run_switch.py
+++ b/run_switch.py
@@ -24,7 +24,10 @@
call(["/sbin/modprobe", "veth"])
for idx in range(0, options.port_count):
print "Creating veth pair " + str(idx)
- call(["/sbin/ip", "link", "add", "type", "veth"])
+ veth = "veth%d" % (idx*2)
+ veth_peer = "veth%d" % (idx*2+1)
+ call(["/sbin/ip", "link", "add", "name", veth, "type", "veth",
+ "peer", "name", veth_peer])
for idx in range(0, 2 * options.port_count):
cmd = ["/sbin/ifconfig",