From: claudio Date: Tue, 28 Mar 2023 08:32:42 +0000 (+0000) Subject: Switch role logic in rde_aspa_validity() since this may need to be extended. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7d032127313a26c9667e07bcb0e964aa83491b30;p=openbsd Switch role logic in rde_aspa_validity() since this may need to be extended. OK tb@ mbuhl@ --- diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index d8cb4b9d93d..8d7897e755b 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.597 2023/03/21 14:52:36 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.598 2023/03/28 08:32:42 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -2525,15 +2525,15 @@ rde_aspa_validity(struct rde_peer *peer, struct rde_aspath *asp, uint8_t aid) switch (aid) { case AID_INET: - if (peer->role != ROLE_CUSTOMER) - return asp->aspa_state.onlyup_v4; - else + if (peer->role == ROLE_CUSTOMER) return asp->aspa_state.downup_v4; - case AID_INET6: - if (peer->role != ROLE_CUSTOMER) - return asp->aspa_state.onlyup_v6; else + return asp->aspa_state.onlyup_v4; + case AID_INET6: + if (peer->role == ROLE_CUSTOMER) return asp->aspa_state.downup_v6; + else + return asp->aspa_state.onlyup_v6; default: return ASPA_NEVER_KNOWN; /* not reachable */ }