net: cdc_mbim: handle unaccelerated VLAN tagged frames
authorBjørn Mork <bjorn@mork.no>
Fri, 9 May 2014 12:45:00 +0000 (14:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 May 2014 04:52:16 +0000 (21:52 -0700)
commitb237dc48b3c64aa48c822e0387d9ea1d00714dcb
tree17f594bd7c72a4ac571b6f86020bb488bbeccf4d
parent6e020d8ab8dad5c4ebb5317898d05d437a6f5c49
net: cdc_mbim: handle unaccelerated VLAN tagged frames

[ Upstream commit 6b5eeb7f874b689403e52a646e485d0191ab9507 ]

This driver maps 802.1q VLANs to MBIM sessions. The mapping is based on
a bogus assumption that all tagged frames will use the acceleration API
because we enable NETIF_F_HW_VLAN_CTAG_TX. This fails for e.g. frames
tagged in userspace using packet sockets. Such frames will erroneously
be considered as untagged and silently dropped based on not being IP.

Fix by falling back to looking into the ethernet header for a tag if no
accelerated tag was found.

Fixes: a82c7ce5bc5b ("net: cdc_ncm: map MBIM IPS SessionID to VLAN ID")
Cc: Greg Suarez <gsuarez@smithmicro.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/usb/cdc_mbim.c