Index | Thread | Search

From:
Claudio Jeker <cjeker@diehard.n-r-g.com>
Subject:
bgpd: memset the right struct member
To:
tech@openbsd.org
Date:
Tue, 11 Feb 2025 15:06:37 +0100

Download raw body.

Thread
In capa_neg_calc() memset the ext_nh array in the RFC 8950 bits of the
function. This is a copy paste error from the ADD_PATH block below.
I doubt there are any consequences because of this (at least as mentioned
add-path is handled later).

Found while working on something else.
-- 
:wq Claudio

Index: session.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/session.c,v
diff -u -p -r1.510 session.c
--- session.c	6 Feb 2025 12:38:58 -0000	1.510
+++ session.c	11 Feb 2025 14:03:38 -0000
@@ -2867,7 +2867,7 @@ capa_neg_calc(struct peer *p)
 	    p->capa.peer.grestart.grnotification) != 0;
 
 	/* RFC 8950 extended nexthop encoding: both sides need to agree */
-	memset(p->capa.neg.add_path, 0, sizeof(p->capa.neg.add_path));
+	memset(p->capa.neg.ext_nh, 0, sizeof(p->capa.neg.ext_nh));
 	for (i = AID_MIN; i < AID_MAX; i++) {
 		if (p->capa.neg.mp[i] == 0)
 			continue;