Skip to content

Commit

Permalink
fix handling large packets and sending icmp-too-big fragmentation bug (
Browse files Browse the repository at this point in the history
…#206)

Summary:
bpf(icmp-too-big): This commit fixes a bug that katran cannot deal with large packets.
Katran should generate `ICMP_TOO_BIG` packet ('destination unreachable') for this situation but randomly packets dropped from processing in NIC due to checksum issue.
So, we need to generate an IP header with `frag_off = 0` option to fix bytes replacements and fragmentation affects.

Pull Request resolved: #206

Reviewed By: avasylev

Differential Revision: D51274722

Pulled By: frankfeir

fbshipit-source-id: 5b7d469866a4c2ee67f1ab0fb21e8238d22f5475
  • Loading branch information
AlirezaKm authored and facebook-github-bot committed Nov 15, 2023
1 parent e6089df commit 06b5b4a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions katran/lib/bpf/handle_icmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ __attribute__((__always_inline__)) static inline int send_icmp4_too_big(
iph->ttl = DEFAULT_TTL;
iph->daddr = orig_iph->saddr;
iph->saddr = orig_iph->daddr;
iph->frag_off = 0;
iph->version = 4;
iph->ihl = 5;
iph->protocol = IPPROTO_ICMP;
Expand Down

0 comments on commit 06b5b4a

Please sign in to comment.