Skip to content

Commit a411d17

Browse files
committed
pure_reflector: also accept broadcasts
1 parent fa4e9fa commit a411d17

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pure_reflector.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ int xdp_reflector(struct xdp_md *ctx)
1616
__u8 our_mac[ETH_ALEN] = OUR_MAC;
1717
if (__builtin_memcmp(eth->h_dest, our_mac, ETH_ALEN) == 0) {
1818
// packet is for us. Let it pass.
19-
return XDP_PASS; // TODO
19+
return XDP_PASS;
20+
}
21+
__u8 broadcast_mac[ETH_ALEN] = { 0xFF, 0xFF, 0xFF , 0xFF, 0xFF, 0xFF };
22+
if (__builtin_memcmp(eth->h_dest, broadcast_mac, ETH_ALEN) == 0) {
23+
// packet is for us. Let it pass.
24+
return XDP_PASS;
2025
}
2126

2227
// packet is for someone else. Send it back into the network.

0 commit comments

Comments
 (0)