From 161dc7774e483597f716f73f8364fac06daf28a6 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 3 Oct 2025 17:05:12 +0200 Subject: [PATCH] bpf: clat: remove commented code The rewrite of IPv6 header inside a ICMP error needs to be implemented. Remove the unused comments for now. --- src/core/bpf/clat.bpf.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/core/bpf/clat.bpf.c b/src/core/bpf/clat.bpf.c index 3a20a6da3f..de02014fe1 100644 --- a/src/core/bpf/clat.bpf.c +++ b/src/core/bpf/clat.bpf.c @@ -586,34 +586,6 @@ clat_translate_v6(struct __sk_buff *skb, if ((void *) (new_icmp + 1) > data_end) goto icmp_out; - /* int type = (*new_icmp).type; */ - /* switch (type) { */ - /* case ICMP_TIME_EXCEEDED: */ - /* case ICMP_DEST_UNREACH: */ - - /* nh->pos = new_icmp + 1; */ - /* if (clat_translate_v6(skb, nh, data_end, &dst_hdr_icmp, 1)) { */ - /* DBG("Bad embedded v6?"); */ - /* goto out; */ - /* } */ - /* if (((__u8 *)(new_icmp + 1)) + sizeof(dst_hdr_icmp) >= data_end) { */ - /* DBG("ICMP header is out of bounds"); */ - /* goto out; */ - /* } */ - /* memcpy(new_icmp + 1, &dst_hdr_icmp, sizeof(dst_hdr_icmp)); // dst_hdr.ihl * 4 */ - - /* /\* Scoot the payload up against the v4 header *\/ */ - /* /\* (Note: We can't use a normal memmove here because clang only supports */ - /* constexpr lengths!) *\/ */ - - /* clat_memmove(((__u8 *)(new_icmp + 1)) + sizeof(dst_hdr), */ - /* ((__u8 *)(new_icmp + 1)) + sizeof(struct ipv6hdr), */ - /* skb, */ - /* dst_hdr.tot_len - (dst_hdr.ihl * 4)); */ - /* /\* TODO: Translate ICMP Extension length *\/ */ - /* break; */ - /* } */ - update_icmp_checksum(skb, ip6h, &old_icmp6, new_icmp, false); icmp_out: