Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad23d5b9 authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann
Browse files

ieee802154: 6lowpan: cleanup pull of iphc bytes



This patch cleanups the pull of the iphc bytes. We don't need to check
if the skb->len contains two bytes, this will be checked by
lowpan_fetch_skb_u8.

Reviewed-by: default avatarStefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 989d433d
Loading
Loading
Loading
Loading
+2 −7
Original line number Original line Diff line number Diff line
@@ -33,14 +33,9 @@ iphc_decompress(struct sk_buff *skb, const struct ieee802154_hdr *hdr)
	void *sap, *dap;
	void *sap, *dap;


	raw_dump_table(__func__, "raw skb data dump", skb->data, skb->len);
	raw_dump_table(__func__, "raw skb data dump", skb->data, skb->len);
	/* at least two bytes will be used for the encoding */
	if (skb->len < 2)
		return -EINVAL;

	if (lowpan_fetch_skb_u8(skb, &iphc0))
		return -EINVAL;


	if (lowpan_fetch_skb_u8(skb, &iphc1))
	if (lowpan_fetch_skb_u8(skb, &iphc0) ||
	    lowpan_fetch_skb_u8(skb, &iphc1))
		return -EINVAL;
		return -EINVAL;


	ieee802154_addr_to_sa(&sa, &hdr->source);
	ieee802154_addr_to_sa(&sa, &hdr->source);