Skip to content

Commit d351c1e

Browse files
author
Florian Westphal
committed
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: 9651851 ("netfilter: add nftables") Reported-by: Blažej Krajňák <krajnak@levonet.sk> Signed-off-by: Florian Westphal <fw@strlen.de>
1 parent 505ce06 commit d351c1e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/netfilter/nft_payload.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ void nft_payload_eval(const struct nft_expr *expr,
179179

180180
switch (priv->base) {
181181
case NFT_PAYLOAD_LL_HEADER:
182-
if (!skb_mac_header_was_set(skb))
182+
if (!skb_mac_header_was_set(skb) || skb_mac_header_len(skb) == 0)
183183
goto err;
184184

185185
if (skb_vlan_tag_present(skb) &&

0 commit comments

Comments
 (0)