From: Fabian Bläse Date: Tue, 10 Dec 2024 01:14:06 +0000 (+0100) Subject: Babel: fix seqno wrapping on seqno request X-Git-Tag: v2.17~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfac0076fb7365fe91360fa351f311f141a7a303;p=thirdparty%2Fbird.git Babel: fix seqno wrapping on seqno request The Babel seqno wraps around when reaching its maximum value (UINT16_MAX). When comparing seqnos, this has to be taken into account. Therefore, plain number comparisons do not work. --- diff --git a/proto/babel/babel.c b/proto/babel/babel.c index fe5c0599a..b5cbb63f8 100644 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@ -1015,7 +1015,7 @@ babel_send_update_(struct babel_iface *ifa, btime changed, struct fib *rtable) /* Our own seqno might have changed, in which case we update the routes we originate. */ - if ((e->router_id == p->router_id) && (e->seqno < p->update_seqno)) + if ((e->router_id == p->router_id) && gt_mod64k(p->update_seqno, e->seqno)) { e->seqno = p->update_seqno; e->updated = current_time();