From: Florian Fainelli <f.fainelli@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] net: dsa: rtl8366: Check VLAN ID and not ports
Date: Fri, 27 Sep 2019 09:40:44 -0700 [thread overview]
Message-ID: <e21e9a80-c8e0-d758-2309-1a8f03dda400@gmail.com> (raw)
In-Reply-To: <20190927163911.11179-1-linus.walleij@linaro.org>
On 9/27/19 9:39 AM, Linus Walleij wrote:
> There has been some confusion between the port number and
> the VLAN ID in this driver. What we need to check for
> validity is the VLAN ID, nothing else.
>
> The current confusion came from assigning a few default
> VLANs for default routing and we need to rewrite that
> properly.
>
> Instead of checking if the port number is a valid VLAN
> ID, check the actual VLAN IDs passed in to the callback
> one by one as expected.
>
> Fixes: d8652956cf37 ("net: dsa: realtek-smi: Add Realtek SMI driver")
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> drivers/net/dsa/rtl8366.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/dsa/rtl8366.c b/drivers/net/dsa/rtl8366.c
> index ca3d17e43ed8..e2c91b75e843 100644
> --- a/drivers/net/dsa/rtl8366.c
> +++ b/drivers/net/dsa/rtl8366.c
> @@ -340,9 +340,11 @@ int rtl8366_vlan_prepare(struct dsa_switch *ds, int port,
> {
> struct realtek_smi *smi = ds->priv;
> int ret;
> + int i;
>
> - if (!smi->ops->is_vlan_valid(smi, port))
> - return -EINVAL;
> + for (i = vlan->vid_begin; i < vlan->vid_end; i++)
> + if (!smi->ops->is_vlan_valid(smi, port))
> + return -EINVAL;
You are still checking the port and not the "i" (VLAN ID) argument here,
is there something I am missing?
--
Florian
next prev parent reply other threads:[~2019-09-27 16:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-27 16:39 [PATCH] net: dsa: rtl8366: Check VLAN ID and not ports Linus Walleij
2019-09-27 16:40 ` Florian Fainelli [this message]
2019-09-28 20:26 ` Linus Walleij
2019-09-28 20:36 ` Florian Fainelli
2019-09-28 20:43 ` Linus Walleij
-- strict thread matches above, loose matches on Subject: below --
2019-10-01 14:28 Linus Walleij
2019-10-02 16:10 ` David Miller
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=e21e9a80-c8e0-d758-2309-1a8f03dda400@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=linus.walleij@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.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