diff options
author | Alexander Aring <alex.aring@gmail.com> | 2015-10-20 09:31:21 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-10-21 01:49:25 +0300 |
commit | 607b0bd3f2b9ac118f2c67dbd18c55f1f5aefeb1 (patch) | |
tree | a468c264189290359c05bb38b8603dae90e9ff70 /net/6lowpan/iphc.c | |
parent | 478208e3b9988adc7ec2c480f237049aaf7c4609 (diff) | |
download | linux-607b0bd3f2b9ac118f2c67dbd18c55f1f5aefeb1.tar.xz |
6lowpan: nhc: move iphc manipulation out of nhc
This patch moves the iphc setting of next header commpression bit inside
iphc functionality. Setting of IPHC bits should be happen at iphc.c file
only.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/6lowpan/iphc.c')
-rw-r--r-- | net/6lowpan/iphc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c index 87d8f1fe7a4a..afe36aab04ca 100644 --- a/net/6lowpan/iphc.c +++ b/net/6lowpan/iphc.c @@ -532,9 +532,12 @@ int lowpan_header_compress(struct sk_buff *skb, const struct net_device *dev, /* Check if we provide the nhc format for nexthdr and compression * functionality. If not nexthdr is handled inline and not compressed. */ - ret = lowpan_nhc_check_compression(skb, hdr, &hc_ptr, &iphc0); - if (ret < 0) - return ret; + ret = lowpan_nhc_check_compression(skb, hdr, &hc_ptr); + if (ret == -ENOENT) + lowpan_push_hc_data(&hc_ptr, &hdr->nexthdr, + sizeof(hdr->nexthdr)); + else + iphc0 |= LOWPAN_IPHC_NH_C; /* Hop limit * if 1: compress, encoding is 01 |