Skip to content

Commit 7c5fb3c

Browse files
committed
fix(linux_networking.go): remove route type
I'm not sure why I thought it was a good idea to add a route type to begin with. Looking at the library code a bit more, it appears that this is only used for MPLS routes and when used it was causing errors.
1 parent 66a8216 commit 7c5fb3c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pkg/controllers/proxy/linux_networking.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ func (ln *linuxNetworking) ipAddrDel(iface netlink.Link, ip string, nodeIP strin
107107
// Delete VIP addition to "local" rt table also, fail silently if not found (DSR special case)
108108
// #nosec G204
109109
nRoute := &netlink.Route{
110-
Type: unix.RTN_LOCAL,
111110
Dst: &net.IPNet{IP: parsedIP, Mask: netMask},
112111
LinkIndex: iface.Attrs().Index,
113112
Table: syscall.RT_TABLE_LOCAL,
@@ -178,7 +177,6 @@ func (ln *linuxNetworking) ipAddrAdd(iface netlink.Link, ip string, nodeIP strin
178177
return err
179178
}
180179
nRoute := &netlink.Route{
181-
Type: unix.RTN_LOCAL,
182180
Dst: ipPrefix,
183181
LinkIndex: kubeDummyLink.Attrs().Index,
184182
Table: syscall.RT_TABLE_LOCAL,
@@ -506,7 +504,7 @@ func (ln *linuxNetworking) setupPolicyRoutingForDSR(setupIPv4, setupIPv6 bool) e
506504
"error please report because something has gone very wrong) due to: %v", ipv4DefaultRoute, err)
507505
}
508506
nRoute := &netlink.Route{
509-
Type: unix.RTN_LOCAL,
507+
Family: nFamily,
510508
Dst: defaultRouteCIDR,
511509
LinkIndex: loNetLink.Attrs().Index,
512510
Table: customDSRRouteTableID,
@@ -528,7 +526,7 @@ func (ln *linuxNetworking) setupPolicyRoutingForDSR(setupIPv4, setupIPv6 bool) e
528526
"error please report because something has gone very wrong) due to: %v", ipv6DefaultRoute, err)
529527
}
530528
nRoute := &netlink.Route{
531-
Type: unix.RTN_LOCAL,
529+
Family: nFamily,
532530
Dst: defaultRouteCIDR,
533531
LinkIndex: loNetLink.Attrs().Index,
534532
Table: customDSRRouteTableID,

0 commit comments

Comments
 (0)