From 1a9d2eac2962dd876a192d60583b6e7221788839 Mon Sep 17 00:00:00 2001 From: Bob Lantz <rlantz@cs.stanford.edu> Date: Tue, 9 Mar 2010 21:47:02 -0800 Subject: [PATCH] Fixed createLink args and cleaned up slightly. --- examples/sshd.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/sshd.py b/examples/sshd.py index 93226841..e6641181 100755 --- a/examples/sshd.py +++ b/examples/sshd.py @@ -37,12 +37,10 @@ def connectToRootNS( network, switch, ip, prefixLen, routes ): routes: host networks to route to""" # Create a node in root namespace and link to switch 0 root = Node( 'root', inNamespace=False ) - port = max( switch.ports.values() ) + 1 - createLink( root, 0, switch, port ) - root.setIP( root.intfs[ 0 ], ip, prefixLen ) + intf = createLink( root, switch )[ 0 ] + root.setIP( intf, ip, prefixLen ) # Start network that now includes link to root namespace network.start() - intf = root.intfs[ 0 ] # Add routes from root ns to hosts for route in routes: root.cmd( 'route add -net ' + route + ' dev ' + intf ) -- GitLab