aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154/6lowpan.c
Commit message (Collapse)AuthorAgeFilesLines
* 6lowpan: Uncompression of traffic class field was incorrectJukka Rissanen2014-01-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ Upstream commit 1188f05497e7bd2f2614b99c54adfbe7413d5749 ] If priority/traffic class field in IPv6 header is set (seen when using ssh), the uncompression sets the TC and Flow fields incorrectly. Example: This is IPv6 header of a sent packet. Note the priority/TC (=1) in the first byte. 00000000: 61 00 00 00 00 2c 06 40 fe 80 00 00 00 00 00 00 00000010: 02 02 72 ff fe c6 42 10 fe 80 00 00 00 00 00 00 00000020: 02 1e ab ff fe 4c 52 57 This gets compressed like this in the sending side 00000000: 72 31 04 06 02 1e ab ff fe 4c 52 57 ec c2 00 16 00000010: aa 2d fe 92 86 4e be c6 .... In the receiving end, the packet gets uncompressed to this IPv6 header 00000000: 60 06 06 02 00 2a 1e 40 fe 80 00 00 00 00 00 00 00000010: 02 02 72 ff fe c6 42 10 fe 80 00 00 00 00 00 00 00000020: ab ff fe 4c 52 57 ec c2 First four bytes are set incorrectly and we have also lost two bytes from destination address. The fix is to switch the case values in switch statement when checking the TC field. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
* 6LoWPAN: fix skb_copy callalex.bluesman.smirnov@gmail.com2011-09-151-8/+9
| | | | | | | | | | | This patch fixes 2 issues in lowpan_skb_deliver function: 1. Check for return status of skb_copy call; 2. Use skb_copy with proper GFP flag, drop check for non-interrupt context. Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* 6LoWPAN: call dev_put() on error in lowpan_newlink()Dan Carpenter2011-09-151-1/+4
| | | | | | | We should release the dev_hold() on error before returning here. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* 6LoWPAN: use the _safe version of list_for_eachDan Carpenter2011-09-151-1/+3
| | | | | | | | When we kfree(entry) that causes a use-after-free bug so we have to use list_for_each_entry_safe() safe here. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* 6LoWPAN: use kfree_skb() instead of kfree()Dan Carpenter2011-09-151-1/+1
| | | | | | | Use kfree_skb() to free sbk_buffs. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* IEEE802.15.4: 6LoWPAN basic supportAlexander Smirnov2011-08-241-0/+885
This patch provides base support for transmission of IPv6 packets as well as the formation of IPv6 link-local addresses and statelessly autoconfigured addresses on top of IEEE 802.15.4 networks. For more information please look at the RFC4944 "Compression Format for IPv6 Datagrams in Low Power and Losst Networks (6LoWPAN). Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>