From 50ca9f573b640bca5af612b8a56ec5c58ba656cd Mon Sep 17 00:00:00 2001 From: Gerdriaan Mulder Date: Sun, 15 Mar 2026 17:10:07 +0100 Subject: [PATCH] expander.c: logic fix in bgpq_expander_invalidate_asn() (#132) In 6c8c6cfec1c4ae5035c7b85f14f74ac27fedf9e3 the semantics of this function changed. Previously, it returned early when it couldn't find the ASN, otherwise removed it. After that commit, it would only try to remove non-existing entries. @ytti expected `bgpq4 -wG 42 AS-DSS-ALL` to exclude AS400805 from the output as it does not contain any prefixes. --- expander.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expander.c b/expander.c index e7aca8a..aa4c34e 100644 --- a/expander.c +++ b/expander.c @@ -619,7 +619,7 @@ bgpq_expander_invalidate_asn(struct bgpq_expander *b, const char *q) } find.asn = asn; - if ((res = RB_FIND(asn_tree, &b->asnlist, &find)) == NULL) { + if ((res = RB_FIND(asn_tree, &b->asnlist, &find)) != NULL) { RB_REMOVE(asn_tree, &b->asnlist, res); free(res); }