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

Add support for NDA_FLAGS_EXT neighboring attribute #707

Merged
merged 2 commits into from
Nov 1, 2021

Conversation

borkmann
Copy link
Contributor

This allows to set NTF_EXT_MANAGED neighbor flag for managed neighbor
entries as per kernel commit 7482e3841d52 ("net, neigh: Add NTF_MANAGED
flag for managed neighbor entries"). The flag then indicates to the
kernel that the neighbor entry should be periodically probed for keeping
the entry in NUD_REACHABLE state iff possible.

Signed-off-by: Daniel Borkmann [email protected]

This allows to set NTF_EXT_MANAGED neighbor flag for managed neighbor
entries as per kernel commit 7482e3841d52 ("net, neigh: Add NTF_MANAGED
flag for managed neighbor entries"). The flag then indicates to the
kernel that the neighbor entry should be periodically probed for keeping
the entry in NUD_REACHABLE state iff possible.

Signed-off-by: Daniel Borkmann <[email protected]>
Copy link
Contributor

@tklauser tklauser left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @borkmann

Note for maintainers/reviewers: the respective kernel change is currently only available in the net-next tree and will be available in Linus' tree once the merge window opens (expected next weekend).

/cc @aboch @vishvananda

borkmann added a commit to cilium/cilium that referenced this pull request Oct 26, 2021
For the neighboring subsystem, we need the NTF_EXT_MANAGED flag for newer
kernels. While we wait for those patches to land upstream, temporarily
point at cilium/netlink with included patches.

The following was used for importing cilium/netlink:

  go mod edit -replace github.com/vishvananda/netlink=github.com/cilium/netlink@master
  go mod tidy
  go mod vendor
  git add vendor/ go.mod go.sum && git commit -sa

Related: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=7482e3841d520a368426ac196720601687e2dc47
Related: vishvananda/netlink#707
Signed-off-by: Daniel Borkmann <[email protected]>
The condition to demand a lladdress for neigh.Flags != NTF_PROXY is just
buggy, since there are various other flags such as NTF_USE, NTF_EXT_MANAGED,
etc where this is not required. Besides, the kernel handles this internally
anyway if it demands a NDA_LLADDR attribute. Simply get rid of the NTF_PROXY
flag/condition since it's wrong.

Fixes: d710fba ("Add proxy support to the neighbor functions (vishvananda#149)")
Signed-off-by: Daniel Borkmann <[email protected]>
borkmann added a commit to cilium/cilium that referenced this pull request Oct 29, 2021
For the neighboring subsystem, we need the NTF_EXT_MANAGED flag for newer
kernels. Additionally, the netlink library is broken with regards to pushing
nil lladdresses into the kernel.

While we wait for those two patches to land upstream, temporarily point at
cilium/netlink with included patches.

The following was used for importing cilium/netlink:

  go mod edit -replace github.com/vishvananda/netlink=github.com/cilium/netlink@master
  go mod tidy
  go mod vendor
  git add vendor/ go.mod go.sum && git commit -sa

Related: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=7482e3841d520a368426ac196720601687e2dc47
Related: vishvananda/netlink#707
Signed-off-by: Daniel Borkmann <[email protected]>
@borkmann
Copy link
Contributor Author

borkmann commented Oct 29, 2021

@tklauser Just fyi, I've added another bug fix in here, mainly that neigh.HardwareAddr handling is buggy right now. It adds it even if nil but flags other than NTF_PROXY are set. The latter conditional should just be removed since incorrect, and let the kernel handle argument sanity checking.

( By the way, corresponding iproute2 changes were merged recently: https://lore.kernel.org/netdev/[email protected]/ )

@vishvananda vishvananda merged commit 74e723f into vishvananda:master Nov 1, 2021
@borkmann borkmann deleted the pr/neigh-managed branch November 1, 2021 16:35
borkmann added a commit to cilium/cilium that referenced this pull request Nov 2, 2021
For the neighboring subsystem, we need the NTF_EXT_MANAGED flag for newer
kernels. Additionally, the netlink library is broken with regards to pushing
nil lladdresses into the kernel.

We addressed both recently in vishvananda/netlink.

While we were waiting for those two patches to land upstream, we temporarily
used cilium/netlink with included patches. The following was used for importing
cilium/netlink instead:

  go mod edit -replace github.com/vishvananda/netlink=github.com/cilium/netlink@master
  go mod tidy
  go mod vendor
  git add vendor/ go.mod go.sum && git commit -sa

However, just few days ago our PR was merged, so just regular update is already
sufficient (above instructions are kept in log for future reference). We used
the following for this patch:

  go get github.com/vishvananda/netlink@master
  go mod tidy
  go mod vendor
  git add vendor/ go.mod go.sum && git commit -sa

Related: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=7482e3841d520a368426ac196720601687e2dc47
Related: vishvananda/netlink#707
Signed-off-by: Daniel Borkmann <[email protected]>
borkmann added a commit to cilium/cilium that referenced this pull request Nov 4, 2021
For the neighboring subsystem, we need the NTF_EXT_MANAGED flag for newer
kernels. Additionally, the netlink library is broken with regards to pushing
nil lladdresses into the kernel.

We addressed both recently in vishvananda/netlink.

While we were waiting for those two patches to land upstream, we temporarily
used cilium/netlink with included patches. The following was used for importing
cilium/netlink instead:

  go mod edit -replace github.com/vishvananda/netlink=github.com/cilium/netlink@master
  go mod tidy
  go mod vendor
  git add vendor/ go.mod go.sum && git commit -sa

However, just few days ago our PR was merged, so just regular update is already
sufficient (above instructions are kept in log for future reference). We used
the following for this patch:

  go get github.com/vishvananda/netlink@master
  go mod tidy
  go mod vendor
  git add vendor/ go.mod go.sum && git commit -sa

Related: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=7482e3841d520a368426ac196720601687e2dc47
Related: vishvananda/netlink#707
Signed-off-by: Daniel Borkmann <[email protected]>
borkmann added a commit to cilium/cilium that referenced this pull request Nov 5, 2021
For the neighboring subsystem, we need the NTF_EXT_MANAGED flag for newer
kernels. Additionally, the netlink library is broken with regards to pushing
nil lladdresses into the kernel.

We addressed both recently in vishvananda/netlink.

While we were waiting for those two patches to land upstream, we temporarily
used cilium/netlink with included patches. The following was used for importing
cilium/netlink instead:

  go mod edit -replace github.com/vishvananda/netlink=github.com/cilium/netlink@master
  go mod tidy
  go mod vendor
  git add vendor/ go.mod go.sum && git commit -sa

However, just few days ago our PR was merged, so just regular update is already
sufficient (above instructions are kept in log for future reference). We used
the following for this patch:

  go get github.com/vishvananda/netlink@master
  go mod tidy
  go mod vendor
  git add vendor/ go.mod go.sum && git commit -sa

Related: https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=7482e3841d520a368426ac196720601687e2dc47
Related: vishvananda/netlink#707
Signed-off-by: Daniel Borkmann <[email protected]>
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