projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f325e2
)
netfilter: nft_payload: rebuild vlan header when needed
author
Pablo Neira Ayuso
<pablo@netfilter.org>
Tue, 6 Jun 2023 07:38:42 +0000
(09:38 +0200)
committer
Pablo Neira Ayuso
<pablo@netfilter.org>
Mon, 26 Jun 2023 06:05:45 +0000
(08:05 +0200)
Skip rebuilding the vlan header when accessing destination and source
mac address.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_payload.c
patch
|
blob
|
history
diff --git
a/net/netfilter/nft_payload.c
b/net/netfilter/nft_payload.c
index
3a3c774
..
8cb8009
100644
(file)
--- a/
net/netfilter/nft_payload.c
+++ b/
net/netfilter/nft_payload.c
@@
-171,7
+171,8
@@
void nft_payload_eval(const struct nft_expr *expr,
if (!skb_mac_header_was_set(skb))
goto err;
- if (skb_vlan_tag_present(skb)) {
+ if (skb_vlan_tag_present(skb) &&
+ priv->offset >= offsetof(struct ethhdr, h_proto)) {
if (!nft_payload_copy_vlan(dest, skb,
priv->offset, priv->len))
goto err;