Skip to content

Commit 07fddc1

Browse files
committed
vrf: install multipath default explicitly in ECMP test
Sequential RouteAdd of two ::/0 with the same metric returns EEXIST on some kernels instead of merging, which broke CI on Linux amd64. Signed-off-by: Dean Chen <862469039@qq.com>
1 parent 814f9be commit 07fddc1

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

‎plugins/meta/vrf/vrf_test.go‎

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -509,19 +509,16 @@ var _ = Describe("vrf plugin", func() {
509509
IP: net.IPv6zero,
510510
Mask: net.CIDRMask(0, 128),
511511
}
512-
// First default via primary interface.
512+
// Install multipath default explicitly. Two sequential RouteAdd
513+
// calls with the same metric return EEXIST on some kernels
514+
// instead of merging into ECMP (repro path from #1253).
513515
Expect(netlink.RouteAdd(&netlink.Route{
514-
LinkIndex: link0.Attrs().Index,
515-
Dst: defaultDst,
516-
Gw: net.ParseIP("2001:db8:0::1"),
517-
Priority: 1024,
518-
})).To(Succeed())
519-
// Second default via secondary interface — becomes multipath/ECMP.
520-
Expect(netlink.RouteAdd(&netlink.Route{
521-
LinkIndex: link1.Attrs().Index,
522-
Dst: defaultDst,
523-
Gw: net.ParseIP("2001:db8:1::1"),
524-
Priority: 1024,
516+
Dst: defaultDst,
517+
Priority: 1024,
518+
MultiPath: []*netlink.NexthopInfo{
519+
{LinkIndex: link0.Attrs().Index, Gw: net.ParseIP("2001:db8:0::1")},
520+
{LinkIndex: link1.Attrs().Index, Gw: net.ParseIP("2001:db8:1::1")},
521+
},
525522
})).To(Succeed())
526523

527524
// Confirm the kernel has a multipath default including both ifaces.

0 commit comments

Comments
 (0)