From 607b0bd3f2b9ac118f2c67dbd18c55f1f5aefeb1 Mon Sep 17 00:00:00 2001 From: Alexander Aring Date: Tue, 20 Oct 2015 08:31:21 +0200 Subject: 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 Signed-off-by: Marcel Holtmann --- net/6lowpan/iphc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'net/6lowpan/iphc.c') 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 -- cgit v1.2.3