offload - ignore ethernet packets not destined for us

Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Icabd1db48a1189425a941384d534c0f18bf20827
This commit is contained in:
Maciej Żenczykowski
2021-01-24 19:59:05 -08:00
parent bf8ec1a21d
commit 18552e8fb3

View File

@@ -50,6 +50,9 @@ static inline __always_inline int do_forward6(struct __sk_buff* skb, const bool
struct ethhdr* eth = is_ethernet ? data : NULL; // used iff is_ethernet struct ethhdr* eth = is_ethernet ? data : NULL; // used iff is_ethernet
struct ipv6hdr* ip6 = is_ethernet ? (void*)(eth + 1) : data; struct ipv6hdr* ip6 = is_ethernet ? (void*)(eth + 1) : data;
// Require ethernet dst mac address to be our unicast address.
if (is_ethernet && (skb->pkt_type != PACKET_HOST)) return TC_ACT_OK;
// Must be meta-ethernet IPv6 frame // Must be meta-ethernet IPv6 frame
if (skb->protocol != htons(ETH_P_IPV6)) return TC_ACT_OK; if (skb->protocol != htons(ETH_P_IPV6)) return TC_ACT_OK;