diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-03-08 12:18:47 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2021-03-08 12:18:47 +0000 |
commit | d2c7ac76190c68c82b22170ca35f82a2f5b0da51 (patch) | |
tree | 29acf61be110607955f8cc9013889741a7e93cbd /usr.sbin | |
parent | ccc66be1dde21c87952f1eabfa30c56fb68d5365 (diff) |
When introducing prefix_eligible() I botched up one if statement.
For nexthops it is fine if they point to NULL. This is used in local
announcements. Only if they point to a real struct the state must be
NEXTHOP_REACH.
Bug reported by and OK florian@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/rde_decide.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/rde_decide.c b/usr.sbin/bgpd/rde_decide.c index 7f5647ae9ea..9562c70c896 100644 --- a/usr.sbin/bgpd/rde_decide.c +++ b/usr.sbin/bgpd/rde_decide.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_decide.c,v 1.82 2021/03/02 09:45:07 claudio Exp $ */ +/* $OpenBSD: rde_decide.c,v 1.83 2021/03/08 12:18:46 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> @@ -423,8 +423,11 @@ prefix_eligible(struct prefix *p) /* The aspath needs to be loop and error free */ if (asp == NULL || asp->flags & (F_ATTR_LOOP|F_ATTR_PARSE_ERR)) return 0; - /* The nexthop needs to exist and be reachable */ - if (nh == NULL || nh->state != NEXTHOP_REACH) + /* + * If the nexthop exists it must be reachable. + * It is OK if the nexthop does not exist (local announcement). + */ + if (nh != NULL && nh->state != NEXTHOP_REACH) return 0; return 1; |