From: Alexander Aring Date: Wed, 2 Sep 2015 12:21:21 +0000 (+0200) Subject: ieee802154: 6lowpan: change if lowpan dev is running X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=989d433dca558fda85e592fc675af2a59af88858;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: Stefan Schmidt Signed-off-by: Alexander Aring Signed-off-by: Marcel Holtmann --- diff --git a/net/ieee802154/6lowpan/rx.c b/net/ieee802154/6lowpan/rx.c index b1442f397cda..c529d9f2561f 100644 --- a/net/ieee802154/6lowpan/rx.c +++ b/net/ieee802154/6lowpan/rx.c @@ -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 ieee802154_hdr hdr; + struct net_device *ldev; int ret; - if (wdev->type != ARPHRD_IEEE802154 || - !wdev->ieee802154_ptr->lowpan_dev) + if (wdev->type != ARPHRD_IEEE802154) + goto drop; + + ldev = wdev->ieee802154_ptr->lowpan_dev; + if (!ldev || !netif_running(ldev)) goto drop; skb = skb_share_check(skb, GFP_ATOMIC); if (!skb) goto drop; - if (!netif_running(wdev)) - goto drop_skb; - if (skb->pkt_type == PACKET_OTHERHOST) goto drop_skb;