Skip to content

Commit f555392

Browse files
Update gateway ipv6 to use default value, that auto detects and adds to neigh table
1 parent 0307051 commit f555392

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

azure-ipam/ipam_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func (c *MockCNSClient) RequestIPs(ctx context.Context, ipconfig cns.IPConfigsRe
160160
PrefixLength: 120,
161161
},
162162
DNSServers: nil,
163-
GatewayIPv6Address: "fe80::1234:5678:9abc",
163+
GatewayIPv6Address: "fe80::1", // This value will be ignored - code uses defaultV6Gateway constant instead
164164
},
165165
HostPrimaryIPInfo: cns.HostIPInfo{
166166
Gateway: "fe80::1234:5678:9abc",

azure-ipam/ipconfig/ipconfig.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import (
1212
"github.com/pkg/errors"
1313
)
1414

15+
const (
16+
defaultV6Gateway = "fe80::1234:5678:9abc"
17+
)
18+
1519
func CreateOrchestratorContext(args *cniSkel.CmdArgs) ([]byte, error) {
1620
podConf, err := parsePodConf(args.Args)
1721
if err != nil {
@@ -86,7 +90,7 @@ func ProcessIPConfigsResp(resp *cns.IPConfigsResponse) (*[]netip.Prefix, *[]net.
8690
if podIPNet.Addr().Is4() {
8791
gatewayStr = resp.PodIPInfo[i].NetworkContainerPrimaryIPConfig.GatewayIPAddress
8892
} else if podIPNet.Addr().Is6() {
89-
gatewayStr = resp.PodIPInfo[i].NetworkContainerPrimaryIPConfig.GatewayIPv6Address
93+
gatewayStr = defaultV6Gateway
9094
}
9195

9296
gatewayIP = net.ParseIP(gatewayStr)

0 commit comments

Comments
 (0)