summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2023-03-28 08:32:43 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2023-03-28 08:32:43 +0000
commitef6e52c784f56edc4b3900b203c33b1ddf1c633d (patch)
tree3a39cdcb9b7ba4593e732f6c98379e07885a96c9 /usr.sbin/bgpd/rde.c
parent87d0c52b664aa53d3b44e615fb2bc1c2e9d44ce1 (diff)
Switch role logic in rde_aspa_validity() since this may need to be extended.
OK tb@ mbuhl@
Diffstat (limited to 'usr.sbin/bgpd/rde.c')
-rw-r--r--usr.sbin/bgpd/rde.c14
1 files changed, 7 insertions, 7 deletions
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 <henning@openbsd.org>
@@ -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 */
}