netlink icon indicating copy to clipboard operation
netlink copied to clipboard

RouteAdd with src: invalid argument

Open aep opened this issue 2 years ago • 1 comments

this works:

ip -6 route add default via fd00::1  dev eth0 src fd00::2

this doesnt

netlink.RouteAdd(&netlink.Route{
  LinkIndex: eth0.Attrs().Index,
  Gw:        net.ParseIP("fd00::1"),
  Src:      net.ParseIP("fd00::2"),
 })      

without src, its fine

aep avatar Sep 20 '23 08:09 aep

this appears to be a timing issue. just waiting a second makes it work. i guess calling iproute2 cli just takes longer. is it possible that this needs link local addresses? do we have a way to wait for them?

aep avatar Sep 20 '23 08:09 aep