diff options
| author | songyanchao <[email protected]> | 2024-05-10 09:47:16 +0000 |
|---|---|---|
| committer | songyanchao <[email protected]> | 2024-05-11 02:05:16 +0000 |
| commit | 4a1635862ee49c06620bb1b374c3315a14950fea (patch) | |
| tree | 01e1e652db7323e4665ccc583d84d4faa001107b /service/src | |
| parent | 884090756b137be8bfbd7b301527c9402eb3d1a4 (diff) | |
🐞 fix: Fix BFD packet ttl error.
Fix BFD packet ttl error.
Diffstat (limited to 'service/src')
| -rw-r--r-- | service/src/node_bfd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/service/src/node_bfd.c b/service/src/node_bfd.c index 4d35f33..baf13b2 100644 --- a/service/src/node_bfd.c +++ b/service/src/node_bfd.c @@ -114,6 +114,11 @@ uint8_t bfd_reply(struct rte_ether_hdr * ether_hdr, struct rte_ipv4_hdr * ipv4_h uint32_t swap_ip = ipv4_hdr->dst_addr; ipv4_hdr->dst_addr = ipv4_hdr->src_addr; ipv4_hdr->src_addr = swap_ip; + ipv4_hdr->time_to_live = 255; + + /* Recalculate the checksum */ + ipv4_hdr->hdr_checksum = 0; + ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr); /* Swap discriminator */ struct bfd_header_t * bfd_hdr = (struct bfd_header_t *)(udp_hdr + 1); |
