提交 742c3afe 编写于 作者: A Alexander Aring 提交者: Marcel Holtmann

ieee802154: 6lowpan: trivial checks at first

This patch moves some trivial checks at first before calling
skb_share_check which could do some memcpy if the buffer is shared.
Reviewed-by: NStefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: NAlexander Aring <alex.aring@gmail.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 ad23d5b9
......@@ -63,7 +63,8 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *wdev,
struct net_device *ldev;
int ret;
if (wdev->type != ARPHRD_IEEE802154)
if (wdev->type != ARPHRD_IEEE802154 ||
skb->pkt_type == PACKET_OTHERHOST)
goto drop;
ldev = wdev->ieee802154_ptr->lowpan_dev;
......@@ -74,9 +75,6 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *wdev,
if (!skb)
goto drop;
if (skb->pkt_type == PACKET_OTHERHOST)
goto drop_skb;
if (ieee802154_hdr_peek_addrs(skb, &hdr) < 0)
goto drop_skb;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册