diff options
author | ewlumpkin <ewlumpkin@gmail.com> | 2022-02-10 23:07:38 +0100 |
---|---|---|
committer | anlan_cs <vic.lan@pica8.com> | 2022-05-02 16:40:53 +0200 |
commit | e9cea444a49e2d71ef6bed9c5a2e0e404fe1ea32 (patch) | |
tree | c0f95ebce1e30eebdb2cf61c14ac77bb531eebc5 /bfdd | |
parent | Merge pull request #11095 from ecbaldwin/unlock-node-always (diff) | |
download | frr-e9cea444a49e2d71ef6bed9c5a2e0e404fe1ea32.tar.xz frr-e9cea444a49e2d71ef6bed9c5a2e0e404fe1ea32.zip |
bfdd: remove "local_address" of bfd session
The "local_address" of bfd is only used in `show bfd peers brief`
for single hop sessions which are configured without "local address".
Since it is set by destination address of received packet, not
completely correct, so remove it.
Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
Signed-off-by: anlan_cs <vic.lan@pica8.com>
Diffstat (limited to 'bfdd')
-rw-r--r-- | bfdd/bfd.h | 1 | ||||
-rw-r--r-- | bfdd/bfd_packet.c | 3 | ||||
-rw-r--r-- | bfdd/bfdd_vty.c | 21 |
3 files changed, 6 insertions, 19 deletions
diff --git a/bfdd/bfd.h b/bfdd/bfd.h index 00cc431e1..2e3119064 100644 --- a/bfdd/bfd.h +++ b/bfdd/bfd.h @@ -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; diff --git a/bfdd/bfd_packet.c b/bfdd/bfd_packet.c index 34b171f40..eff81d4b6 100644 --- a/bfdd/bfd_packet.c +++ b/bfdd/bfd_packet.c @@ -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) { @@ -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++; diff --git a/bfdd/bfdd_vty.c b/bfdd/bfdd_vty.c index dc0958fb3..a9fc71617 100644 --- a/bfdd/bfdd_vty.c +++ b/bfdd/bfdd_vty.c @@ -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) |