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

[1.14.x] netdog: set IPv6 accept-ra for primary interface via config rather than sysctl #3211

Merged
merged 2 commits into from
Jun 20, 2023

Conversation

stmcginnis
Copy link
Contributor

Issue number:
Related to #3143

A separate PR will be opened by @markusboehme for the related patches to wicked

Description of changes:

    netdog: Add wicked IPv6 config structures to support RA
    
    This change adds the necessary structures to wicked in order to support
    setting the `accept_ra` IPv6 option via interface config.
    netdog: Set default accept-ra setting via config rather than sysctl
    
    Previously, we set the IPv6 accept-ra setting for the primary interface
    via `systemd-sysctl` during the wicked "install" helper.  Setting this
    sysctl via the helper can cause a race condition between the kernel and
    wicked.  The kernel sets a flag indicating a router advertisement has
    been received (`IF_RA_RCVD`), but only after it completes duplicate
    address detection and decides whether to send a router solicitation.  If
    the sysctl isn't set by the time duplicate address detection completes,
    the solicitation doesn't happen and the `IF_RA_RCVD` flag doesn't get
    set.  wicked uses this flag to decide whether or not to kick off the
    state machine that handles DHCP6.
    
    This change adds the accept-ra setting to the interface config if the
    primary interface is set up via kernel command line.  The primary
    interface is supplied via kernel command line for AWS and VMware
    variants.  This change also removes the accept-ra setting from the
    `systemd-sysctl` config.  Allowing wicked to manage this setting
    eliminates any chance of races between sysctl/kernel/wicked.

In the future we will support a network config setting that sets this in config for any interface specified.

Testing done:

See testing in #3159

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

This change adds the necessary structures to wicked in order to support
setting the `accept_ra` IPv6 option via interface config.  Doing this
in config allows wicked to manage this option and avoids any race
conditions that may occur between wicked and the kernel when attempting
to set this via sysctl.

(cherry picked from commit 91e2cc9)
Previously, we set the IPv6 accept-ra setting for the primary interface
via `systemd-sysctl` during the wicked install helper.  Setting this
sysctl via the helper can cause a race condition between the kernel and
wicked.  The kernel sets a flag indicating a router advertisement has
been received (`IF_RA_RCVD`), but only after it completes duplicate
address detection and decides whether to send a router solicitation.  If
the sysctl isn't set by the time duplicate address detection completes,
the solicitation doesn't happen and the `IF_RA_RCVD` flag doesn't get
set.  wicked uses this flag to decide whether or not to kick off the
state machine that handles DHCP6.

This change adds the accept-ra setting to the interface config if the
primary interface is set up via kernel command line.  The primary
interface is supplied via kernel command line for AWS and VMware
variants.  This change also removes the accept-ra setting from the
`systemd-sysctl` config.  Allowing wicked to manage this setting
eliminates any chance of races between sysctl/kernel/wicked.

(cherry picked from commit 5ed812d)
@stmcginnis stmcginnis changed the base branch from develop to 1.14.x June 19, 2023 20:25
@stmcginnis stmcginnis merged commit be7d468 into bottlerocket-os:1.14.x Jun 20, 2023
@stmcginnis stmcginnis deleted the netdog-accept-ra branch June 20, 2023 15:23
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.

3 participants