Skip to content

Commit

Permalink
xdp: Fix wrong UDP checksum in proxied GTPv1U packets
Browse files Browse the repository at this point in the history
For now mark checksum as 0 to avoid transmitting with a wrong checksum,
which would drop the packets at the receiver.
  • Loading branch information
pespin committed Nov 14, 2024
1 parent 0b596a2 commit d5cf5ba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/ebpf/xdp/utils/gtp_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,10 @@ static __always_inline void update_gtp_tunnel(struct packet_context *ctx, int sr
ctx->ip4->daddr = dstip;
ctx->ip4->check = 0;
ctx->ip4->check = ipv4_csum(ctx->ip4, sizeof(*ctx->ip4));
ctx->udp->check = 0;
/* TODO: Implement UDP csum:
* cs = 0;
* ipv4_l4_csum(udp, sizeof(*udp), &cs, iph);
* udp->check = cs;
*/
}

0 comments on commit d5cf5ba

Please sign in to comment.