]> git.baikalelectronics.ru Git - kernel.git/commit
vlan: Fix header ops passthru when doing TX VLAN offload.
authorDavid S. Miller <davem@davemloft.net>
Tue, 31 Dec 2013 21:23:35 +0000 (16:23 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Dec 2013 21:23:35 +0000 (16:23 -0500)
commit25972fef22fff2e81a79a7dbf123a7e2981192ad
tree5daa8338d99f62013631fc9c2ab1a6e6896ef0cd
parent442406fadc284c08a6e24f0f6634600e5df4a229
vlan: Fix header ops passthru when doing TX VLAN offload.

When the vlan code detects that the real device can do TX VLAN offloads
in hardware, it tries to arrange for the real device's header_ops to
be invoked directly.

But it does so illegally, by simply hooking the real device's
header_ops up to the VLAN device.

This doesn't work because we will end up invoking a set of header_ops
routines which expect a device type which matches the real device, but
will see a VLAN device instead.

Fix this by providing a pass-thru set of header_ops which will arrange
to pass the proper real device instead.

To facilitate this add a dev_rebuild_header().  There are
implementations which provide a ->cache and ->create but not a
->rebuild (f.e. PLIP).  So we need a helper function just like
dev_hard_header() to avoid crashes.

Use this helper in the one existing place where the
header_ops->rebuild was being invoked, the neighbour code.

With lots of help from Florian Westphal.

Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netdevice.h
net/8021q/vlan_dev.c
net/core/neighbour.c