Skip to content

Commit

Permalink
Set accept_untracked_na to 2 for IPv6 NA in EVPN
Browse files Browse the repository at this point in the history
  • Loading branch information
chdxD1 committed Nov 22, 2024
1 parent 3d97cd5 commit 55c8e5f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions pkg/nl/layer2.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,15 @@ func (*Manager) configureBridge(intfName string) error {
return fmt.Errorf("error setting arp_accept = 1 for interface: %w", err)
}

// Ensure we can receive unsolicited and solicited but untracked NA
if _, err := os.Stat(fmt.Sprintf("%s/ipv6/conf/%s/accept_untracked_na", procSysNetPath, intfName)); err != nil {
if err := os.WriteFile(fmt.Sprintf("%s/ipv6/conf/%s/accept_untracked_na", procSysNetPath, intfName), []byte("2"), neighFilePermissions); err != nil {
return fmt.Errorf("error setting accept_untracked_na = 2 for interface: %w", err)
}
} else if !os.IsNotExist(err) {
return fmt.Errorf("error checking if accept_untracked_na exists: %w", err)
}

baseTimer := os.Getenv("NWOP_NEIGH_BASE_REACHABLE_TIME")
if baseTimer == "" {
baseTimer = "30000"
Expand Down
5 changes: 3 additions & 2 deletions pkg/nl/nl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (

const (
arpAccept = "arp_accept"
acceptUntrackedNA = "accept_untracked_na"
baseReachableTimeMs = "base_reachable_time"
addrGenMode = "addr_gen_mode"
)
Expand Down Expand Up @@ -1086,8 +1087,8 @@ var _ = Describe("ReconcileL2()", func() {
arpAcceptIPv4 := fmt.Sprintf("%s/ipv4/conf/%s", procSysNetPath, vlanName)
createInterfaceFile(arpAcceptIPv4 + "/" + arpAccept)

arpAcceptIPv6 := fmt.Sprintf("%s/ipv6/conf/%s", procSysNetPath, vlanName)
createInterfaceFile(arpAcceptIPv6 + "/" + arpAccept)
acceptUntrackedNAIPv6 := fmt.Sprintf("%s/ipv6/conf/%s", procSysNetPath, vlanName)
createInterfaceFile(acceptUntrackedNAIPv6 + "/" + acceptUntrackedNA)

err := nm.ReconcileL2(current, desired)
Expect(err).To(HaveOccurred())
Expand Down

0 comments on commit 55c8e5f

Please sign in to comment.