clatd: fix endianness of multicast drop
This is a *critical* fix for http://go/aog/3514294
'Drop egress multicast on clat interface'
Bug: 404457155
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If14ef730f78c7e991842a678260dd20df607b1ec
diff --git a/bpf/progs/clatd.c b/bpf/progs/clatd.c
index 2bb9d6f..f4e4f3b 100644
--- a/bpf/progs/clatd.c
+++ b/bpf/progs/clatd.c
@@ -289,7 +289,7 @@
if (ip4->ihl != 5) return TC_ACT_PIPE;
// Packet must not be multicast
- if ((ip4->daddr & 0xf0000000) == 0xe0000000) return TC_ACT_PIPE;
+ if ((ip4->daddr & htonl(0xf0000000)) == htonl(0xe0000000)) return TC_ACT_PIPE;
// Calculate the IPv4 one's complement checksum of the IPv4 header.
__wsum sum4 = 0;