diff mbox

ieee802154: 6lowpan: set IFLA_LINK

Message ID 20180702092147.56331-1-lkundrak@v3.sk (mailing list archive)
State Accepted
Headers show

Commit Message

Lubomir Rintel July 2, 2018, 9:21 a.m. UTC
Otherwise NetworkManager (and iproute alike) is not able to identify the
parent IEEE 802.15.4 interface of a 6LoWPAN link.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
 net/ieee802154/6lowpan/core.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Alexander Aring July 2, 2018, 6:40 p.m. UTC | #1
Hi,

On Mon, Jul 02, 2018 at 11:21:47AM +0200, Lubomir Rintel wrote:
> Otherwise NetworkManager (and iproute alike) is not able to identify the
> parent IEEE 802.15.4 interface of a 6LoWPAN link.
> 
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>

Thanks, actually I was thinking if such feature exists... That's good to
know that the slave knows about the master and can be requested on
userspace. Especially on 6LoWPAN. I tested it iproute shows
"lowpan0@wpan0" now. :-)

Acked-by: Alexander Aring <aring@mojatatu.com>

- Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stefan Schmidt July 5, 2018, 9:57 a.m. UTC | #2
Hello.

On 02.07.2018 11:21, Lubomir Rintel wrote:
> Otherwise NetworkManager (and iproute alike) is not able to identify the
> parent IEEE 802.15.4 interface of a 6LoWPAN link.
> 
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> ---
>  net/ieee802154/6lowpan/core.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
> index 275449b0d633..3297e7fa9945 100644
> --- a/net/ieee802154/6lowpan/core.c
> +++ b/net/ieee802154/6lowpan/core.c
> @@ -90,12 +90,18 @@ static int lowpan_neigh_construct(struct net_device *dev, struct neighbour *n)
>  	return 0;
>  }
>  
> +static int lowpan_get_iflink(const struct net_device *dev)
> +{
> +	return lowpan_802154_dev(dev)->wdev->ifindex;
> +}
> +
>  static const struct net_device_ops lowpan_netdev_ops = {
>  	.ndo_init		= lowpan_dev_init,
>  	.ndo_start_xmit		= lowpan_xmit,
>  	.ndo_open		= lowpan_open,
>  	.ndo_stop		= lowpan_stop,
>  	.ndo_neigh_construct    = lowpan_neigh_construct,
> +	.ndo_get_iflink         = lowpan_get_iflink,
>  };
>  
>  static void lowpan_setup(struct net_device *ldev)
> 

This patch has been applied to the wpan tree and will be
part of the next pull request to net. Thanks!

regards
Stefan Schmidt
--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c
index 275449b0d633..3297e7fa9945 100644
--- a/net/ieee802154/6lowpan/core.c
+++ b/net/ieee802154/6lowpan/core.c
@@ -90,12 +90,18 @@  static int lowpan_neigh_construct(struct net_device *dev, struct neighbour *n)
 	return 0;
 }
 
+static int lowpan_get_iflink(const struct net_device *dev)
+{
+	return lowpan_802154_dev(dev)->wdev->ifindex;
+}
+
 static const struct net_device_ops lowpan_netdev_ops = {
 	.ndo_init		= lowpan_dev_init,
 	.ndo_start_xmit		= lowpan_xmit,
 	.ndo_open		= lowpan_open,
 	.ndo_stop		= lowpan_stop,
 	.ndo_neigh_construct    = lowpan_neigh_construct,
+	.ndo_get_iflink         = lowpan_get_iflink,
 };
 
 static void lowpan_setup(struct net_device *ldev)