linux-hardened/net/ieee802154
Simon Vincent f19f4f9525 ieee802154: 6lowpan: ensure header compression does not corrupt ipv6 header
The 6lowpan ipv6 header compression was causing problems for other interfaces
that expected a ipv6 header to still be in place, as we were replacing the
ipv6 header with a compressed version. This happened if you sent a packet to a
multicast address as the packet would be output on 802.15.4, ethernet, and also
be sent to the loopback interface. The skb data was shared between these
interfaces so all interfaces ended up with a compressed ipv6 header.

The solution is to ensure that before we do any header compression we are not
sharing the skb or skb data with any other interface. If we are then we must
take a copy of the skb and skb data before modifying the ipv6 header.
The only place we can copy the skb is inside the xmit function so we don't
leave dangling references to skb.

This patch moves all the header compression to inside the xmit function. Very
little code has been changed it has mostly been moved from lowpan_header_create
to lowpan_xmit. At the top of the xmit function we now check if the skb is
shared and if so copy it. In lowpan_header_create all we do now is store the
source and destination addresses for use later when we compress the header.

Signed-off-by: Simon Vincent <simon.vincent@xsilon.com>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2014-09-24 14:15:08 +02:00
..
6lowpan_rtnl.c ieee802154: 6lowpan: ensure header compression does not corrupt ipv6 header 2014-09-24 14:15:08 +02:00
af802154.h mac802154: use header operations to create/parse headers 2014-03-14 22:15:26 -04:00
af_ieee802154.c 6lowpan: mac802154: fix coding style issues 2014-07-07 20:55:22 -07:00
dgram.c 6lowpan: mac802154: fix coding style issues 2014-07-07 20:55:22 -07:00
header_ops.c ieee802154: add definitions for link-layer security and header functions 2014-05-15 15:51:42 -04:00
ieee802154.h 6lowpan: mac802154: fix coding style issues 2014-07-07 20:55:22 -07:00
Kconfig 6lowpan: introduce new net/6lowpan directory 2014-07-12 01:53:30 +02:00
Makefile 6lowpan: introduce new net/6lowpan directory 2014-07-12 01:53:30 +02:00
netlink.c 6lowpan: mac802154: fix coding style issues 2014-07-07 20:55:22 -07:00
nl-mac.c 6lowpan: mac802154: fix coding style issues 2014-07-07 20:55:22 -07:00
nl-phy.c 6lowpan: mac802154: fix coding style issues 2014-07-07 20:55:22 -07:00
nl_policy.c ieee802154: add netlink interfaces for llsec 2014-05-16 17:23:41 -04:00
raw.c 6lowpan: mac802154: fix coding style issues 2014-07-07 20:55:22 -07:00
reassembly.c ieee802154: 6lowpan: ensure MTU of 1280 for 6lowpan 2014-08-19 19:17:42 +02:00
reassembly.h ieee802154: use ieee802154_addr instead of *_sa variants 2014-03-14 22:15:26 -04:00
wpan-class.c 6lowpan: mac802154: fix coding style issues 2014-07-07 20:55:22 -07:00