aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-11-13 04:03:39 -0500
committerDavid S. Miller <davem@davemloft.net>2013-11-15 03:11:06 -0500
commit1188f05497e7bd2f2614b99c54adfbe7413d5749 (patch)
tree642411b179ceffd508f30e78fc94125a3d35e7cb /net/ieee802154
parent3db0a197ed86317ab2915bc8bddb91807b0f0e96 (diff)
6lowpan: Uncompression of traffic class field was incorrect
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>
Diffstat (limited to 'net/ieee802154')
-rw-r--r--net/ieee802154/6lowpan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 426b5df1c98f..459e200c08a4 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -956,7 +956,7 @@ lowpan_process_data(struct sk_buff *skb)
956 * Traffic class carried in-line 956 * Traffic class carried in-line
957 * ECN + DSCP (1 byte), Flow Label is elided 957 * ECN + DSCP (1 byte), Flow Label is elided
958 */ 958 */
959 case 1: /* 10b */ 959 case 2: /* 10b */
960 if (lowpan_fetch_skb_u8(skb, &tmp)) 960 if (lowpan_fetch_skb_u8(skb, &tmp))
961 goto drop; 961 goto drop;
962 962
@@ -967,7 +967,7 @@ lowpan_process_data(struct sk_buff *skb)
967 * Flow Label carried in-line 967 * Flow Label carried in-line
968 * ECN + 2-bit Pad + Flow Label (3 bytes), DSCP is elided 968 * ECN + 2-bit Pad + Flow Label (3 bytes), DSCP is elided
969 */ 969 */
970 case 2: /* 01b */ 970 case 1: /* 01b */
971 if (lowpan_fetch_skb_u8(skb, &tmp)) 971 if (lowpan_fetch_skb_u8(skb, &tmp))
972 goto drop; 972 goto drop;
973 973