diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-10-03 09:28:16 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-03 09:28:16 +0300 |
| commit | a62d592c048b0dc40f90674bb35f9848343a9490 (patch) | |
| tree | 7074349a092b157d9766b8bfbf168b1c457df9cd | |
| parent | a3b1e324a9b442cab842ce94cb51ce0a9d194df5 (diff) | |
| parent | ba77ea13b86b5613ef897ed4bb29c6c8c0606769 (diff) | |
Merge pull request #16984 from FRRouting/mergify/bp/stable/9.1/pr-16977
bgpd: fix printfrr_bp for non initialized peers (backport #16977)
| -rw-r--r-- | bgpd/bgpd.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 492092bac4..b8389457f8 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -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"); } |
