]> git.baikalelectronics.ru Git - kernel.git/commit
ipvlan: advertise link netns via netlink
authorTaehee Yoo <ap420073@gmail.com>
Fri, 21 Aug 2020 17:47:32 +0000 (17:47 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Aug 2020 22:53:33 +0000 (15:53 -0700)
commit79df7e71961665d105e963c5c280ad46e9fc211d
treec30092d3124f35ba49365f265afa4970c459d94b
parent2774050a68f3cf10c142704096d7f15ae1e79f70
ipvlan: advertise link netns via netlink

Assign rtnl_link_ops->get_link_net() callback so that IFLA_LINK_NETNSID is
added to rtnetlink messages.

Test commands:
    ip netns add nst
    ip link add dummy0 type dummy
    ip link add ipvlan0 link dummy0 type ipvlan
    ip link set ipvlan0 netns nst
    ip netns exec nst ip link show ipvlan0

Result:
    ---Before---
    6: ipvlan0@if5: <BROADCAST,MULTICAST> ...
        link/ether 82:3a:78:ab:60:50 brd ff:ff:ff:ff:ff:ff

    ---After---
    12: ipvlan0@if11: <BROADCAST,MULTICAST> ...
        link/ether 42:b1:ad:57:4e:27 brd ff:ff:ff:ff:ff:ff link-netnsid 0
                                                           ~~~~~~~~~~~~~~

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipvlan/ipvlan_main.c