Skip to content

Commit

Permalink
bgpd: fix printfrr_bp for non initialized peers
Browse files Browse the repository at this point in the history
Fix printfrr_bp for non initialized peers. For example:

> Sep 26 17:56:44 r1 bgpd[26295]: [GJPH1-W8PZV] Resetting peer (null)(Unknown) due to change in addpath config

Is now:

> Oct 02 14:00:59 r1 bgpd[12795]: [MNE5N-K0G4Z] Resetting peer 2.2.2.2 due to change in addpath config

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit b56cfc6)
  • Loading branch information
louis-6wind authored and mergify[bot] committed Oct 2, 2024
1 parent a3b1e32 commit ba77ea1
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 @@ -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");
}
Expand Down

0 comments on commit ba77ea1

Please sign in to comment.