OSDN Git Service

net: bridge: notify on vlan tunnel changes done via the old api
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Sat, 11 Jul 2020 15:05:04 +0000 (18:05 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 12 Jul 2020 22:18:24 +0000 (15:18 -0700)
commit94339443686b36d3223bc032b7947267474e2679
tree4716911375d38fc0536f5ccebbb8083680f854f4
parent71930d61025e7d0254f3c682cb1b5242e0499cf3
net: bridge: notify on vlan tunnel changes done via the old api

If someone uses the old vlan API to configure tunnel mappings we'll only
generate the old-style full port notification. That would be a problem
if we are monitoring the new vlan notifications for changes. The patch
resolves the issue by adding vlan notifications to the old tunnel netlink
code. As usual we try to compress the notifications for as many vlans
in a range as possible, thus a vlan tunnel change is considered able
to enter the "current" vlan notification range if:
 1. vlan exists
 2. it has actually changed (curr_change == true)
 3. it passes all standard vlan notification range checks done by
    br_vlan_can_enter_range() such as option equality, id continuity etc

Note that vlan tunnel changes (add/del) are considered a part of vlan
options so only RTM_NEWVLAN notification is generated with the relevant
information inside.

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_netlink_tunnel.c