]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix NHT free when nht_info is null (fixes crash)
authorLou Berger <lberger@labn.net>
Wed, 9 May 2018 20:06:40 +0000 (16:06 -0400)
committerLou Berger <lberger@labn.net>
Wed, 9 May 2018 20:07:36 +0000 (16:07 -0400)
Signed-off-by: Lou Berger <lberger@labn.net>
bgpd/bgp_nht.c

index 8b6ff3fa222312f5e36a5c92a7eca15b7c7bd12a..2c9e379299783eebd64d8ad91b5d9ebedd31799f 100644 (file)
@@ -88,7 +88,7 @@ int bgp_find_nexthop(struct bgp_info *path, int connected)
 
 static void bgp_unlink_nexthop_check(struct bgp_nexthop_cache *bnc)
 {
-       if (LIST_EMPTY(&(bnc->paths)) && !bnc->nht_info) {
+       if (LIST_EMPTY(&(bnc->paths)) && bnc->nht_info) {
                if (BGP_DEBUG(nht, NHT)) {
                        char buf[PREFIX2STR_BUFFER];
                        zlog_debug("bgp_unlink_nexthop: freeing bnc %s",