ieee802154: 6lowpan: fix packet layer registration
authorAlexander Aring <alex.aring@gmail.com>
Sat, 15 Aug 2015 09:00:32 +0000 (11:00 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 15 Aug 2015 21:28:09 +0000 (23:28 +0200)
commit0751272880f3a0c74c786ecfaba2b3d98748482f
tree9ee572eb7c60aaadb841686c2a2eb517384cb3dd
parent4481c0767e52eea674794de4b9123c9bc3d24f24
ieee802154: 6lowpan: fix packet layer registration

This patch fixes 802.15.4 packet layer registration when mutliple
lowpan interfaces will be added. We need to register the packet layer at
the first lowpan interface and deregister it at the last interface. This
done by open_count variable which is protected by rtnl.

Additional do a quiet fix by adding dev_put(real_dev) when netdev
registration fails, which fix the refcount for the wpan dev.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/ieee802154/6lowpan/core.c