summaryrefslogtreecommitdiffstats
path: root/net/bridge/br_private.h
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>2020-01-14 19:56:14 +0200
committerDavid S. Miller <davem@davemloft.net>2020-01-15 13:48:18 +0100
commitf545923b4a6bd7abedac50ea3fce76c713be1b74 (patch)
treefabdf1329730096e3334d1a478749d8dd6be344d /net/bridge/br_private.h
parentcf5bddb95cbe5340e486e84d46cf2f0bb324078c (diff)
downloadlinux-f545923b4a6bd7abedac50ea3fce76c713be1b74.tar.gz
linux-f545923b4a6bd7abedac50ea3fce76c713be1b74.tar.bz2
linux-f545923b4a6bd7abedac50ea3fce76c713be1b74.zip
net: bridge: vlan: notify on vlan add/delete/change flags
Now that we can notify, send a notification on add/del or change of flags. Notifications are also compressed when possible to reduce their number and relieve user-space of extra processing, due to that we have to manually notify after each add/del in order to avoid double notifications. We try hard to notify only about the vlans which actually changed, thus a single command can result in multiple notifications about disjoint ranges if there were vlans which didn't change inside. Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_private.h')
-rw-r--r--net/bridge/br_private.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index ba162c8197da..a6226ff2f0cc 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -554,6 +554,18 @@ static inline bool br_vlan_valid_range(const struct bridge_vlan_info *cur,
return true;
}
+static inline int br_afspec_cmd_to_rtm(int cmd)
+{
+ switch (cmd) {
+ case RTM_SETLINK:
+ return RTM_NEWVLAN;
+ case RTM_DELLINK:
+ return RTM_DELVLAN;
+ }
+
+ return 0;
+}
+
static inline int br_opt_get(const struct net_bridge *br,
enum net_bridge_opts opt)
{