From 97bedb4b77bfc2e29e930a3871c5dce37c03b69a Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Wed, 26 Sep 2018 14:47:21 +0000 Subject: Use the same logic in trie_roa_check_v4 as in trie_roa_check_v6 when checking that a source_as / maxlen combo actually fits. Fixes regress test. --- usr.sbin/bgpd/rde_trie.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/bgpd/rde_trie.c b/usr.sbin/bgpd/rde_trie.c index da6a296ef62..539b2a458a0 100644 --- a/usr.sbin/bgpd/rde_trie.c +++ b/usr.sbin/bgpd/rde_trie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_trie.c,v 1.7 2018/09/20 11:45:59 claudio Exp $ */ +/* $OpenBSD: rde_trie.c,v 1.8 2018/09/26 14:47:20 claudio Exp $ */ /* * Copyright (c) 2018 Claudio Jeker @@ -567,9 +567,10 @@ trie_roa_check_v4(struct trie_head *th, struct in_addr *prefix, u_int8_t plen, /* Treat AS 0 as NONE which can never be matched */ if (as != 0) { - rs = set_match(n->set, as); - if (rs && plen <= rs->maxlen) + if ((rs = set_match(n->set, as)) != NULL) { + if (plen == n->plen || plen <= rs->maxlen) return ROA_VALID; + } } } -- cgit v1.2.3