Merge pull request #16984 from FRRouting/mergify/bp/stable/9.1/pr-16977

bgpd: fix printfrr_bp for non initialized peers (backport #16977)
This commit is contained in:
Donatas Abraitis 2024-10-03 09:28:16 +03:00 committed by GitHub
commit a62d592c04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8610,6 +8610,12 @@ static ssize_t printfrr_bp(struct fbuf *buf, struct printfrr_eargs *ea,
if (!peer)
return bputs(buf, "(null)");
if (!peer->host) {
if (peer->conf_if)
return bprintfrr(buf, "%s", peer->conf_if);
return bprintfrr(buf, "%pSU", &peer->connection->su);
}
return bprintfrr(buf, "%s(%s)", peer->host,
peer->hostname ? peer->hostname : "Unknown");
}