]> git.baikalelectronics.ru Git - kernel.git/commit
l3mdev: add function to retreive upper master
authorAlexis Bauvin <abauvin@scaleway.com>
Mon, 3 Dec 2018 09:54:39 +0000 (10:54 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Dec 2018 22:15:26 +0000 (14:15 -0800)
commit2eb308585befcc1f38c3b8fd5e4b230e242d5ba2
treef35b58db6fd9aee9d5801b9891869f1335a322cb
parent74d6be282d72111dfa633ebe97f74ec6967ae528
l3mdev: add function to retreive upper master

Existing functions to retreive the l3mdev of a device did not walk the
master chain to find the upper master. This patch adds a function to
find the l3mdev, even indirect through e.g. a bridge:

+----------+
|          |
| vrf-blue |
|          |
+----+-----+
     |
     |
+----+-----+
|          |
| br-blue  |
|          |
+----+-----+
     |
     |
+----+-----+
|          |
|   eth0   |
|          |
+----------+

This will properly resolve the l3mdev of eth0 to vrf-blue.

Signed-off-by: Alexis Bauvin <abauvin@scaleway.com>
Reviewed-by: Amine Kherbouche <akherbouche@scaleway.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Tested-by: Amine Kherbouche <akherbouche@scaleway.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/l3mdev.h
net/l3mdev/l3mdev.c