From: Toshiaki Makita <toshiaki.makita1@gmail.com>
To: Zahari Doychev <zahari.doychev@linux.com>, netdev@vger.kernel.org
Cc: makita.toshiaki@lab.ntt.co.jp, jiri@resnulli.us,
nikolay@cumulusnetworks.com, simon.horman@netronome.com,
roopa@cumulusnetworks.com, bridge@lists.linux-foundation.org,
jhs@mojatatu.com, dsahern@gmail.com, xiyou.wangcong@gmail.com,
johannes@sipsolutions.net, alexei.starovoitov@gmail.com
Subject: Re: [Bridge] [PATCH v3 1/2] net: bridge: use mac_len in bridge forwarding
Date: Tue, 3 Sep 2019 20:37:36 +0900 [thread overview]
Message-ID: <76b7723b-68dd-0efc-9a93-0597e9d9b827@gmail.com> (raw)
In-Reply-To: <20190902181000.25638-1-zahari.doychev@linux.com>
Hi Zahari,
Sorry for reviewing this late.
On 2019/09/03 3:09, Zahari Doychev wrote:
...
> @@ -466,13 +466,14 @@ static bool __allowed_ingress(const struct net_bridge *br,
> /* Tagged frame */
> if (skb->vlan_proto != br->vlan_proto) {
> /* Protocol-mismatch, empty out vlan_tci for new tag */
> - skb_push(skb, ETH_HLEN);
> + skb_push(skb, skb->mac_len);
> skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
> skb_vlan_tag_get(skb));
I think we should insert vlan at skb->data, i.e. mac_header + mac_len, while this
function inserts the tag at mac_header + ETH_HLEN which is not always the correct
offset.
> if (unlikely(!skb))
> return false;
>
> skb_pull(skb, ETH_HLEN);
Now skb->data is mac_header + ETH_HLEN which would be broken when mac_len is not
ETH_HLEN?
> + skb_reset_network_header(skb);
> skb_reset_mac_len(skb);
> *vid = 0;
> tagged = false;
>
Toshiaki Makita
next prev parent reply other threads:[~2019-09-03 11:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-02 18:09 [PATCH v3 1/2] net: bridge: use mac_len in bridge forwarding Zahari Doychev
2019-09-02 18:10 ` [PATCH v3 2/2] selftests: forwrading: tc vlan bridge test Zahari Doychev
2019-09-03 11:37 ` Toshiaki Makita [this message]
2019-09-03 13:36 ` [Bridge] [PATCH v3 1/2] net: bridge: use mac_len in bridge forwarding Zahari Doychev
2019-09-04 7:14 ` Toshiaki Makita
2019-09-04 14:32 ` Zahari Doychev
2019-09-05 11:20 ` Toshiaki Makita
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=76b7723b-68dd-0efc-9a93-0597e9d9b827@gmail.com \
--to=toshiaki.makita1@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=bridge@lists.linux-foundation.org \
--cc=dsahern@gmail.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=johannes@sipsolutions.net \
--cc=makita.toshiaki@lab.ntt.co.jp \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=roopa@cumulusnetworks.com \
--cc=simon.horman@netronome.com \
--cc=xiyou.wangcong@gmail.com \
--cc=zahari.doychev@linux.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox