Commit d351c1ea authored by Florian Westphal's avatar Florian Westphal

netfilter: nft_payload: fix wrong mac header matching

mcast packets get looped back to the local machine.
Such packets have a 0-length mac header, we should treat
this like "mac header not set" and abort rule evaluation.

As-is, we just copy data from the network header instead.

Fixes: 96518518 ("netfilter: add nftables")
Reported-by: default avatarBlažej Krajňák <krajnak@levonet.sk>
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
parent 505ce063
......@@ -179,7 +179,7 @@ void nft_payload_eval(const struct nft_expr *expr,
switch (priv->base) {
case NFT_PAYLOAD_LL_HEADER:
if (!skb_mac_header_was_set(skb))
if (!skb_mac_header_was_set(skb) || skb_mac_header_len(skb) == 0)
goto err;
if (skb_vlan_tag_present(skb) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment