1
0
mirror of https://passt.top/passt synced 2024-12-22 05:35:23 +00:00

ndp: Don't send unsolicited router advertisement if we can't, yet

ndp_timer() is called right away on the first epoll_wait() cycle,
when the communication channel to the guest isn't ready yet:

  1.0038: NDP: sending unsolicited RA, next in 264s
  1.0038: tap: failed to send 1 frames of 1

check that it's up before sending it. This effectively delays the
first gratuitous router advertisement, which is probably a good idea
given that we expect the guest to send a router solicitation right
away.

Fixes: 6e1e44293e ("ndp: Send unsolicited Router Advertisements")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Stefano Brivio 2024-11-15 15:22:06 +01:00
parent 5e24466677
commit bf9492747d

2
ndp.c
View File

@ -391,7 +391,7 @@ void ndp_timer(const struct ctx *c, const struct timespec *now)
time_t max_rtr_adv_interval = DEFAULT_MAX_RTR_ADV_INTERVAL; time_t max_rtr_adv_interval = DEFAULT_MAX_RTR_ADV_INTERVAL;
time_t min_rtr_adv_interval, interval; time_t min_rtr_adv_interval, interval;
if (c->no_ra || now->tv_sec < next_ra) if (c->fd_tap < 0 || c->no_ra || now->tv_sec < next_ra)
return; return;
/* We must advertise before the route's lifetime expires */ /* We must advertise before the route's lifetime expires */