All of lore.kernel.org
 help / color / mirror / Atom feed
From: wenxu@ucloud.cn
To: pablo@netfilter.org
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH nf] netfilter: nft_payload: fix vlan_tpid get from h_vlan_proto
Date: Fri,  2 Apr 2021 15:13:52 +0800	[thread overview]
Message-ID: <1617347632-19283-1-git-send-email-wenxu@ucloud.cn> (raw)

From: wenxu <wenxu@ucloud.cn>

vlan_tpid of flow_dissector_key_vlan should be set as h_vlan_proto
but not h_vlan_encapsulated_proto.

Fixes: a82055af5959 ("netfilter: nft_payload: add VLAN offload support")
Fixes: 89d8fd44abfb ("netfilter: nft_payload: add C-VLAN offload support")
Signed-off-by: wenxu <wenxu@ucloud.cn>
---
 net/netfilter/nft_payload.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/nft_payload.c b/net/netfilter/nft_payload.c
index cb1c8c2..4b582eb 100644
--- a/net/netfilter/nft_payload.c
+++ b/net/netfilter/nft_payload.c
@@ -229,7 +229,7 @@ static int nft_payload_offload_ll(struct nft_offload_ctx *ctx,
 		NFT_OFFLOAD_MATCH(FLOW_DISSECTOR_KEY_VLAN, vlan,
 				  vlan_tci, sizeof(__be16), reg);
 		break;
-	case offsetof(struct vlan_ethhdr, h_vlan_encapsulated_proto):
+	case offsetof(struct vlan_ethhdr, h_vlan_proto):
 		if (!nft_payload_offload_mask(reg, priv->len, sizeof(__be16)))
 			return -EOPNOTSUPP;
 
@@ -244,7 +244,7 @@ static int nft_payload_offload_ll(struct nft_offload_ctx *ctx,
 		NFT_OFFLOAD_MATCH(FLOW_DISSECTOR_KEY_CVLAN, vlan,
 				  vlan_tci, sizeof(__be16), reg);
 		break;
-	case offsetof(struct vlan_ethhdr, h_vlan_encapsulated_proto) +
+	case offsetof(struct vlan_ethhdr, h_vlan_proto) +
 							sizeof(struct vlan_hdr):
 		if (!nft_payload_offload_mask(reg, priv->len, sizeof(__be16)))
 			return -EOPNOTSUPP;
-- 
1.8.3.1


             reply	other threads:[~2021-04-02  7:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02  7:13 wenxu [this message]
2021-04-02 18:51 ` [PATCH nf] netfilter: nft_payload: fix vlan_tpid get from h_vlan_proto kernel test robot
2021-04-02 18:51   ` kernel test robot
2021-04-02 19:54 ` Pablo Neira Ayuso
2021-04-03 13:33   ` wenxu
2021-04-03 14:59     ` wenxu
2021-04-08 22:48       ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1617347632-19283-1-git-send-email-wenxu@ucloud.cn \
    --to=wenxu@ucloud.cn \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.