From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id DD9145A061A; Fri, 15 Nov 2024 15:22:06 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH v2] ndp: Don't send unsolicited router advertisement if we can't, yet Date: Fri, 15 Nov 2024 15:22:06 +0100 Message-ID: <20241115142206.80960-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: LTQ6IIAPEBXHSYMPS4VCJL6UVLQ27QDO X-Message-ID-Hash: LTQ6IIAPEBXHSYMPS4VCJL6UVLQ27QDO X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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: 6e1e44293ef9 ("ndp: Send unsolicited Router Advertisements") Signed-off-by: Stefano Brivio --- Oops, I sent a previous/wrong version of the patch as v1. ndp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndp.c b/ndp.c index 7ee44b2..1752d64 100644 --- a/ndp.c +++ b/ndp.c @@ -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 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; /* We must advertise before the route's lifetime expires */ -- 2.43.0