Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI crashes when node command includes name of switch #893

Open
benfrankel opened this issue Jul 22, 2019 · 0 comments
Open

CLI crashes when node command includes name of switch #893

benfrankel opened this issue Jul 22, 2019 · 0 comments

Comments

@benfrankel
Copy link
Contributor

benfrankel commented Jul 22, 2019

Expected/Desired Behavior:

Mininet should not crash when a command that is run on a node includes (as an arg) the name of a switch that has inNamespace set to False.

Actual Behavior:

Mininet crashes.

Detailed Steps to Reproduce the Behavior:

  1. Start Mininet with a configuration that includes a switch with inNamespace=False.
  2. Suppose the switch is named switch1.
  3. In the Mininet CLI, run the command <node> echo switch1 where <node> is the name of any node.

Additional Information:

The CLI crashes when it tries to access self.controlIntf inside of Switch.defaultIntf():

https://github.com/mininet/mininet/blob/master/mininet/node.py#L919

This happens because self.controlIntf may not be defined if self.inNamespace is set to False, as can be seen in Switch.__init__:

https://github.com/mininet/mininet/blob/master/mininet/node.py#L896

The call to Switch.defaultIntf() is triggered by the CLI trying to replace node args with their IP addresses here:

https://github.com/mininet/mininet/blob/master/mininet/cli.py#L419

To resolve this, Switch.defaultIntf() could be changed to expect an undefined self.controlIntf and not crash, or self.controlIntf could be set to None in Switch.__init__ if self.inNamespace is False.

EDIT: If the node -> IP translation isn't needed for the command, the user can put the node's name in single quotes as a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant