Skip to content

Commit

Permalink
Merge pull request #11110 from anlancs/fix/bfdd-wrong-local
Browse files Browse the repository at this point in the history
bfdd: fix wrong local address of display command
  • Loading branch information
srimohans authored May 2, 2022
2 parents 4f43a04 + e9cea44 commit bf81632
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
1 change: 0 additions & 1 deletion bfdd/bfd.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ struct bfd_session {
struct peer_label *pl;

struct bfd_dplane_ctx *bdc;
struct sockaddr_any local_address;
struct interface *ifp;
struct vrf *vrf;

Expand Down
3 changes: 0 additions & 3 deletions bfdd/bfd_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,6 @@ void bfd_recv_cb(struct thread *t)

/*
* Multi hop: validate packet TTL.
* Single hop: set local address that received the packet.
*/
if (is_mhop) {
if (ttl < bfd->mh_ttl) {
Expand All @@ -650,8 +649,6 @@ void bfd_recv_cb(struct thread *t)
bfd->mh_ttl, ttl);
return;
}
} else if (bfd->local_address.sa_sin.sin_family == AF_UNSPEC) {
bfd->local_address = local;
}

bfd->stats.rx_ctrl_pkt++;
Expand Down
21 changes: 6 additions & 15 deletions bfdd/bfdd_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,21 +486,12 @@ static void _display_peer_brief(struct vty *vty, struct bfd_session *bs)
{
char addr_buf[INET6_ADDRSTRLEN];

if (CHECK_FLAG(bs->flags, BFD_SESS_FLAG_MH)) {
vty_out(vty, "%-10u", bs->discrs.my_discr);
inet_ntop(bs->key.family, &bs->key.local, addr_buf, sizeof(addr_buf));
vty_out(vty, " %-40s", addr_buf);
inet_ntop(bs->key.family, &bs->key.peer, addr_buf, sizeof(addr_buf));
vty_out(vty, " %-40s", addr_buf);
vty_out(vty, "%-15s\n", state_list[bs->ses_state].str);
} else {
vty_out(vty, "%-10u", bs->discrs.my_discr);
vty_out(vty, " %-40s", satostr(&bs->local_address));
inet_ntop(bs->key.family, &bs->key.peer, addr_buf, sizeof(addr_buf));
vty_out(vty, " %-40s", addr_buf);

vty_out(vty, "%-15s\n", state_list[bs->ses_state].str);
}
vty_out(vty, "%-10u", bs->discrs.my_discr);
inet_ntop(bs->key.family, &bs->key.local, addr_buf, sizeof(addr_buf));
vty_out(vty, " %-40s", addr_buf);
inet_ntop(bs->key.family, &bs->key.peer, addr_buf, sizeof(addr_buf));
vty_out(vty, " %-40s", addr_buf);
vty_out(vty, "%-15s\n", state_list[bs->ses_state].str);
}

static void _display_peer_brief_iter(struct hash_bucket *hb, void *arg)
Expand Down

0 comments on commit bf81632

Please sign in to comment.