Revert "net: vlan: fix VLAN 0 refcount imbalance of toggling filtering during runtime"
This reverts commit bb515c4130
which is
commit 579d4f9ca9a9a605184a9b162355f6ba131f678d upstream.
It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.
Bug: 161946584
Change-Id: Ifc93239dd363a86deab7507780d22f4bc31dddcc
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -358,35 +358,6 @@ static int __vlan_device_event(struct net_device *dev, unsigned long event)
|
||||
return err;
|
||||
}
|
||||
|
||||
static void vlan_vid0_add(struct net_device *dev)
|
||||
{
|
||||
struct vlan_info *vlan_info;
|
||||
int err;
|
||||
|
||||
if (!(dev->features & NETIF_F_HW_VLAN_CTAG_FILTER))
|
||||
return;
|
||||
|
||||
pr_info("adding VLAN 0 to HW filter on device %s\n", dev->name);
|
||||
|
||||
err = vlan_vid_add(dev, htons(ETH_P_8021Q), 0);
|
||||
if (err)
|
||||
return;
|
||||
|
||||
vlan_info = rtnl_dereference(dev->vlan_info);
|
||||
vlan_info->auto_vid0 = true;
|
||||
}
|
||||
|
||||
static void vlan_vid0_del(struct net_device *dev)
|
||||
{
|
||||
struct vlan_info *vlan_info = rtnl_dereference(dev->vlan_info);
|
||||
|
||||
if (!vlan_info || !vlan_info->auto_vid0)
|
||||
return;
|
||||
|
||||
vlan_info->auto_vid0 = false;
|
||||
vlan_vid_del(dev, htons(ETH_P_8021Q), 0);
|
||||
}
|
||||
|
||||
static int vlan_device_event(struct notifier_block *unused, unsigned long event,
|
||||
void *ptr)
|
||||
{
|
||||
@@ -408,10 +379,15 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
|
||||
return notifier_from_errno(err);
|
||||
}
|
||||
|
||||
if (event == NETDEV_UP)
|
||||
vlan_vid0_add(dev);
|
||||
else if (event == NETDEV_DOWN)
|
||||
vlan_vid0_del(dev);
|
||||
if ((event == NETDEV_UP) &&
|
||||
(dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) {
|
||||
pr_info("adding VLAN 0 to HW filter on device %s\n",
|
||||
dev->name);
|
||||
vlan_vid_add(dev, htons(ETH_P_8021Q), 0);
|
||||
}
|
||||
if (event == NETDEV_DOWN &&
|
||||
(dev->features & NETIF_F_HW_VLAN_CTAG_FILTER))
|
||||
vlan_vid_del(dev, htons(ETH_P_8021Q), 0);
|
||||
|
||||
vlan_info = rtnl_dereference(dev->vlan_info);
|
||||
if (!vlan_info)
|
||||
|
@@ -33,7 +33,6 @@ struct vlan_info {
|
||||
struct vlan_group grp;
|
||||
struct list_head vid_list;
|
||||
unsigned int nr_vids;
|
||||
bool auto_vid0;
|
||||
struct rcu_head rcu;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user