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
This commit is contained in:
parent
b6d94ad6f3
commit
30020a513a
2 changed files with 3 additions and 3 deletions
|
|
@ -289,7 +289,7 @@ DEFINE_BPF_PROG("schedcls/egress4/clat_rawip", AID_ROOT, AID_SYSTEM, sched_cls_e
|
||||||
if (ip4->ihl != 5) return TC_ACT_PIPE;
|
if (ip4->ihl != 5) return TC_ACT_PIPE;
|
||||||
|
|
||||||
// Packet must not be multicast
|
// 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.
|
// Calculate the IPv4 one's complement checksum of the IPv4 header.
|
||||||
__wsum sum4 = 0;
|
__wsum sum4 = 0;
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,8 @@ int ipv4_packet(clat_packet out, clat_packet_index pos, const uint8_t *packet, s
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((header->daddr & 0xf0000000) == 0xe0000000) {
|
if ((header->daddr & htonl(0xf0000000)) == htonl(0xe0000000)) {
|
||||||
logmsg_dbg(ANDROID_LOG_INFO, "ip_packet/daddr is multicast: %x", header->daddr);
|
logmsg_dbg(ANDROID_LOG_INFO, "ip_packet/daddr is multicast: %x", ntohl(header->daddr));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue