@@ -499,9 +499,37 @@ func (n *Namespace) advertiseAddrs(ctx context.Context, ifIndex int, i *Interfac
499499 }
500500 }
501501 if naSender != nil {
502- if err := naSender .Send (); err != nil {
503- log .G (ctx ).WithError (err ).Warn ("Failed to send unsolicited NA" )
504- errs = append (errs , err )
502+ // FIXME(robmry) - retry if this fails, but still return the error.
503+ // In CI, the send has failed a couple of times with "write ip ::1->ff02::1: sendmsg: network is unreachable".
504+ // Can't repro locally, so - try find out whether a retry helps and it's something racing, or it's a
505+ // persistent problem.
506+ for c := range 3 {
507+ if c > 0 {
508+ time .Sleep (50 * time .Millisecond )
509+ }
510+
511+ routes , rgErr := nlh .RouteGetWithOptions (net .IPv6linklocalallnodes , & netlink.RouteGetOptions {
512+ IifIndex : ifIndex ,
513+ SrcAddr : net .IPv6loopback ,
514+ })
515+ var routeStr string
516+ if rgErr != nil {
517+ routeStr = fmt .Sprintf ("RouteGet->'%s'" , rgErr .Error ())
518+ } else if len (routes ) != 1 {
519+ routeStr = fmt .Sprintf ("RouteGet->%d routes" , len (routes ))
520+ } else {
521+ routeStr = fmt .Sprintf ("RouteGet->'%s'" , routes [0 ].String ())
522+ }
523+
524+ if err := naSender .Send (); err != nil {
525+ log .G (ctx ).WithError (err ).Warn ("Failed to send unsolicited NA" )
526+ errs = append (errs , fmt .Errorf ("%s: %w" , routeStr , err ))
527+ continue
528+ }
529+ if c > 0 {
530+ errs = append (errs , fmt .Errorf ("success" ))
531+ }
532+ break
505533 }
506534 }
507535 return errors .Join (errs ... )
0 commit comments