Merge pull request #7114 from donaldsharp/tip_count

bgpd: Avoid memset when tip hash is empty
This commit is contained in:
Donatas Abraitis 2020-09-17 15:10:13 +03:00 committed by GitHub
commit 70d400cefa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -563,7 +563,7 @@ bool bgp_nexthop_self(struct bgp *bgp, afi_t afi, uint8_t type,
if (addr)
return true;
if (new_afi == AF_INET) {
if (new_afi == AF_INET && hashcount(bgp->tip_hash)) {
memset(&tmp_tip, 0, sizeof(struct tip_addr));
tmp_tip.addr = attr->nexthop;