提交 989d433d 编写于 作者: A Alexander Aring 提交者: Marcel Holtmann

ieee802154: 6lowpan: change if lowpan dev is running

We don't need to check if the wpan interface is running because the
lowpan_rcv is the packet layer receive handler for the wpan interface.

Instead doing a check if wpan interface is running we should check if
the lowpan interface is running before starting 6lowpan adaptation layer.
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>
上级 348a882e
...@@ -65,19 +65,20 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *wdev, ...@@ -65,19 +65,20 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *wdev,
struct packet_type *pt, struct net_device *orig_wdev) struct packet_type *pt, struct net_device *orig_wdev)
{ {
struct ieee802154_hdr hdr; struct ieee802154_hdr hdr;
struct net_device *ldev;
int ret; int ret;
if (wdev->type != ARPHRD_IEEE802154 || if (wdev->type != ARPHRD_IEEE802154)
!wdev->ieee802154_ptr->lowpan_dev) goto drop;
ldev = wdev->ieee802154_ptr->lowpan_dev;
if (!ldev || !netif_running(ldev))
goto drop; goto drop;
skb = skb_share_check(skb, GFP_ATOMIC); skb = skb_share_check(skb, GFP_ATOMIC);
if (!skb) if (!skb)
goto drop; goto drop;
if (!netif_running(wdev))
goto drop_skb;
if (skb->pkt_type == PACKET_OTHERHOST) if (skb->pkt_type == PACKET_OTHERHOST)
goto drop_skb; goto drop_skb;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册