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>
This commit is contained in:

committed by
Marcel Holtmann

parent
478208e3b9
commit
607b0bd3f2
@@ -95,23 +95,20 @@ static struct lowpan_nhc *lowpan_nhc_by_nhcid(const struct sk_buff *skb)
|
||||
}
|
||||
|
||||
int lowpan_nhc_check_compression(struct sk_buff *skb,
|
||||
const struct ipv6hdr *hdr, u8 **hc_ptr,
|
||||
u8 *iphc0)
|
||||
const struct ipv6hdr *hdr, u8 **hc_ptr)
|
||||
{
|
||||
struct lowpan_nhc *nhc;
|
||||
int ret = 0;
|
||||
|
||||
spin_lock_bh(&lowpan_nhc_lock);
|
||||
|
||||
nhc = lowpan_nexthdr_nhcs[hdr->nexthdr];
|
||||
if (nhc && nhc->compress)
|
||||
*iphc0 |= LOWPAN_IPHC_NH_C;
|
||||
else
|
||||
lowpan_push_hc_data(hc_ptr, &hdr->nexthdr,
|
||||
sizeof(hdr->nexthdr));
|
||||
if (!(nhc && nhc->compress))
|
||||
ret = -ENOENT;
|
||||
|
||||
spin_unlock_bh(&lowpan_nhc_lock);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int lowpan_nhc_do_compression(struct sk_buff *skb, const struct ipv6hdr *hdr,
|
||||
|
Reference in New Issue
Block a user