Skip to content

openbsd/net: flush the route table on net restart#908

Merged
TheRealFalcon merged 1 commit into
canonical:masterfrom
goneri:openbsd-net-flush-the-route-table-on-net-restart_15259
May 25, 2021
Merged

openbsd/net: flush the route table on net restart#908
TheRealFalcon merged 1 commit into
canonical:masterfrom
goneri:openbsd-net-flush-the-route-table-on-net-restart_15259

Conversation

@goneri
Copy link
Copy Markdown
Contributor

@goneri goneri commented May 22, 2021

Ensure we've got a clean environment before we restart the network.

In some cases, the sh /etc/netstart is not enough to restart the
network. A previous default route remains in the route table and
as a result the network is broken.
Also sh /netstart does not kill dhclient.
The problen happens for instance with OVH OpenStack SBG3.

Copy link
Copy Markdown
Contributor

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but we need to fix the flake8 errors.

Comment thread cloudinit/net/openbsd.py Outdated
Comment on lines +39 to +41
subp.subp(['pkill', 'dhclient'], capture=True, rcs=[0 ,1])
subp.subp(['route', 'del', 'default'], capture=True, rcs=[0 ,1])
subp.subp(['route', 'flush', 'default'], capture=True, rcs=[0 ,1])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
subp.subp(['pkill', 'dhclient'], capture=True, rcs=[0 ,1])
subp.subp(['route', 'del', 'default'], capture=True, rcs=[0 ,1])
subp.subp(['route', 'flush', 'default'], capture=True, rcs=[0 ,1])
subp.subp(['pkill', 'dhclient'], capture=True, rcs=[0, 1])
subp.subp(['route', 'del', 'default'], capture=True, rcs=[0, 1])
subp.subp(['route', 'flush', 'default'], capture=True, rcs=[0, 1])

Ensure we've got a clean environment before we restart the network.

In some cases, the `sh /etc/netstart` is not enough to restart the
network. A previous default route remains in the route table and
as a result the network is broken.
Also `sh /netstart` does not kill `dhclient`.
The problen happens for instance with OVH OpenStack SBG3.
@goneri goneri force-pushed the openbsd-net-flush-the-route-table-on-net-restart_15259 branch from 6e2e2da to 8baa9fb Compare May 25, 2021 19:10
@TheRealFalcon TheRealFalcon merged commit fc161f8 into canonical:master May 25, 2021
@goneri
Copy link
Copy Markdown
Contributor Author

goneri commented May 25, 2021

Thank you @TheRealFalcon.

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

Successfully merging this pull request may close these issues.

2 participants