]> git.proxmox.com Git - mirror_frr.git/commitdiff
bfdd: Remove useless check for ECHO packet
authoranlan_cs <vic.lan@pica8.com>
Thu, 2 Mar 2023 09:57:17 +0000 (17:57 +0800)
committeranlan_cs <vic.lan@pica8.com>
Fri, 3 Mar 2023 10:25:12 +0000 (18:25 +0800)
The check with `ip->daddr == ip->saddr` in `bfd_recv_ipv4_fp()` is
useless, instead of it the ECHO packets should simply exit with
TTL checking failure regardless of this condition check.

Just remove the check.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
bfdd/bfd_packet.c

index 7be235326c5e49202ed94c563e2d4bae7855d63b..88a9310bc6cc09c64a701ce2f73726884ab3e24d 100644 (file)
@@ -140,7 +140,7 @@ int _ptm_bfd_send(struct bfd_session *bs, uint16_t *port, const void *data,
  *    sizeof(*pkt)
  *
  * ip
- *    IP address that pkt will be transmitted from and too.
+ *    IP address that pkt will be transmitted from and to.
  *
  * Returns:
  *    Checksum in network byte order.
@@ -481,12 +481,6 @@ ssize_t bfd_recv_ipv4_fp(int sd, uint8_t *msgbuf, size_t msgbuflen,
 
        *ttl = ip->ttl;
        if (*ttl != 254) {
-               /* Echo should be looped in peer's forwarding plane, but it also
-                * comes up to BFD so silently drop it
-                */
-               if (ip->daddr == ip->saddr)
-                       return -1;
-
                if (bglobal.debug_network)
                        zlog_debug("%s: invalid TTL: %u", __func__, *ttl);
                return -1;