Skip to content

Commit

Permalink
ieee802154: 6lowpan: cleanup pull of iphc bytes
Browse files Browse the repository at this point in the history
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: Stefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
alexaring authored and holtmann committed Sep 17, 2015
1 parent 989d433 commit ad23d5b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions net/ieee802154/6lowpan/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,9 @@ iphc_decompress(struct sk_buff *skb, const struct ieee802154_hdr *hdr)
void *sap, *dap;

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;

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

0 comments on commit ad23d5b

Please sign in to comment.