diff options
author | Taehee Yoo <ap420073@gmail.com> | 2020-02-28 21:02:10 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-01 08:37:03 +0300 |
commit | e0a4b99773d3d8d3fb40087805f8fd858a23e582 (patch) | |
tree | b0be89db312dca6289579c56a8259177aa1c2c6b /net/hsr/hsr_main.c | |
parent | 81390d0c4e56ac7752c97d7e8209357673d1a8ab (diff) | |
download | linux-e0a4b99773d3d8d3fb40087805f8fd858a23e582.tar.xz |
hsr: use upper/lower device infrastructure
netdev_upper_dev_link() is useful to manage lower/upper interfaces.
And this function internally validates looping, maximum depth.
All or most virtual interfaces that could have a real interface
(e.g. macsec, macvlan, ipvlan etc.) use lower/upper infrastructure.
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/hsr/hsr_main.c')
-rw-r--r-- | net/hsr/hsr_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/hsr/hsr_main.c b/net/hsr/hsr_main.c index 9e389accbfc7..26d6c39f24e1 100644 --- a/net/hsr/hsr_main.c +++ b/net/hsr/hsr_main.c @@ -85,7 +85,8 @@ static int hsr_netdev_notify(struct notifier_block *nb, unsigned long event, master->dev->mtu = mtu_max; break; case NETDEV_UNREGISTER: - hsr_del_port(port); + if (!is_hsr_master(dev)) + hsr_del_port(port); break; case NETDEV_PRE_TYPE_CHANGE: /* HSR works only on Ethernet devices. Refuse slave to change |