mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-20 22:21:13 +02:00
fix: ipv6 static default gateway not set if gateway is a LL unicast address
The source address is set by default, which leads to RNETLINK errors, when the Global Unicast Address is passed as a Source to a LL Unicast Gateway. Errors of RTNETLINK are now logged. Signed-off-by: Frederik Schwan <frederik.schwan@linux.com>
This commit is contained in:
parent
0204feeb0b
commit
f57d05e02a
@ -367,9 +367,15 @@ func (n *NetworkInterface) configureInterface(method address.Addressing, link *n
|
||||
gw = nil
|
||||
}
|
||||
|
||||
// Any errors here would be non-fatal, so we'll just ignore them
|
||||
//nolint: errcheck
|
||||
n.rtnlConn.RouteAddSrc(method.Link(), *r.Dest, method.Address(), gw)
|
||||
src := method.Address()
|
||||
// if destination is the ipv6 route,and gateway is LL do not pass a src address to set the default geteway
|
||||
if net.IPv6zero.Equal(r.Dest.IP) && gw.IsLinkLocalUnicast() {
|
||||
src = nil
|
||||
}
|
||||
|
||||
if err := n.rtnlConn.RouteAddSrc(method.Link(), *r.Dest, src, gw); err != nil {
|
||||
log.Println("failed to configure route: " + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user