[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130121002710.5189a959.shmulik.ladkani@gmail.com>
Date: Mon, 21 Jan 2013 00:27:10 +0200
From: Shmulik Ladkani <shmulik.ladkani@...il.com>
To: Vlad Yasevich <vyasevic@...hat.com>
Cc: netdev@...r.kernel.org, bridge@...ts.linux-foundation.org,
davem@...emloft.net, shemminger@...tta.com, mst@...hat.com
Subject: Re: [PATCH net-next V6 03/14] bridge: Validate that vlan is
permitted on ingress
Hi Vlad,
On Wed, 16 Jan 2013 13:17:58 -0500 Vlad Yasevich <vyasevic@...hat.com> wrote:
> @@ -45,6 +45,9 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
> brstats->tx_bytes += skb->len;
> u64_stats_update_end(&brstats->syncp);
>
> + if (!br_allowed_ingress(&br->vlan_info, skb))
> + goto out;
> +
Shouldn't you consume the 'skb' in case "not allowed"? the 'out' label
doesn't take care of that.
> +bool br_allowed_ingress(struct net_port_vlans *v, struct sk_buff *skb)
> +{
> + struct net_port_vlan *pve;
> + u16 vid;
> +
> + /* If there are no vlan in the permitted list, all packets are
> + * permitted.
> + */
> + if (list_empty(&v->vlan_list))
> + return true;
Rethinking this, after discussed at [1].
The above means the port having no vlans is actually a member of every
possible vlan.
IMO it might not be what users expect, and may complicate things.
Maybe we should adapt a simpler approach:
If the bridge is a vlan enabled bridge, and the port is not a member of
the given vid, drop.
If the bridge is "vlan disabled", then all packets are permitted.
Regards,
Shmulik
[1]
http://marc.info/?l=linux-netdev&m=135602065425514&w=2
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists