Skip to content

Commit

Permalink
Merge pull request FRRouting#16977 from louis-6wind/fix-printfrr_bp
Browse files Browse the repository at this point in the history
bgpd: fix printfrr_bp for non initialized peers
  • Loading branch information
ton31337 authored Oct 2, 2024
2 parents 46df84f + b56cfc6 commit 56d6a1a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -8901,6 +8901,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");
}
Expand Down

0 comments on commit 56d6a1a

Please sign in to comment.