diff options
author | Ido Schimmel <idosch@nvidia.com> | 2023-04-24 19:09:50 +0300 |
---|---|---|
committer | David Ahern <dsahern@kernel.org> | 2023-04-25 08:52:28 -0600 |
commit | 5fe0aeb88427b69acc373d5bd342a095bab51957 (patch) | |
tree | e51d509d553bc21d67e909cf8a8dc7d7bf355b9d /bridge | |
parent | 11f2630a1133e2bd2475c99ed774d5358a9f93b8 (diff) | |
download | iproute2-5fe0aeb88427b69acc373d5bd342a095bab51957.tar.gz |
bridge: vlan: Add support for neigh_suppress option
Add support for the per-VLAN neigh_suppress option. Example:
# bridge vlan set vid 10 dev swp1 neigh_suppress on
# bridge -d -j -p vlan show dev swp1 vid 10
[ {
"ifname": "swp1",
"vlans": [ {
"vlan": 10,
"state": "forwarding",
"mcast_router": 1,
"neigh_suppress": true
} ]
} ]
# bridge -d vlan show dev swp1 vid 10
port vlan-id
swp1 10
state forwarding mcast_router 1 neigh_suppress on
# bridge vlan set vid 10 dev swp1 neigh_suppress off
# bridge -d -j -p vlan show dev swp1 vid 10
[ {
"ifname": "swp1",
"vlans": [ {
"vlan": 10,
"state": "forwarding",
"mcast_router": 1,
"neigh_suppress": false
} ]
} ]
# bridge -d vlan show dev swp1 vid 10
port vlan-id
swp1 10
state forwarding mcast_router 1 neigh_suppress off
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
Diffstat (limited to 'bridge')
-rw-r--r-- | bridge/vlan.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/bridge/vlan.c b/bridge/vlan.c index 44e1ba39..5b304ea9 100644 --- a/bridge/vlan.c +++ b/bridge/vlan.c @@ -38,6 +38,7 @@ static void usage(void) " bridge vlan { set } vid VLAN_ID dev DEV [ state STP_STATE ]\n" " [ mcast_router MULTICAST_ROUTER ]\n" " [ mcast_max_groups MAX_GROUPS ]\n" + " [ neigh_suppress {on | off} ]\n" " bridge vlan { show } [ dev DEV ] [ vid VLAN_ID ]\n" " bridge vlan { tunnelshow } [ dev DEV ] [ vid VLAN_ID ]\n" " bridge vlan global { set } vid VLAN_ID dev DEV\n" @@ -354,6 +355,18 @@ static int vlan_option_set(int argc, char **argv) addattr32(&req.n, sizeof(req), BRIDGE_VLANDB_ENTRY_MCAST_MAX_GROUPS, max_groups); + } else if (strcmp(*argv, "neigh_suppress") == 0) { + bool neigh_suppress; + int ret; + + NEXT_ARG(); + neigh_suppress = parse_on_off("neigh_suppress", *argv, + &ret); + if (ret) + return ret; + addattr8(&req.n, sizeof(req), + BRIDGE_VLANDB_ENTRY_NEIGH_SUPPRESS, + neigh_suppress); } else { if (matches(*argv, "help") == 0) NEXT_ARG(); @@ -1041,6 +1054,11 @@ static void print_vlan_opts(struct rtattr *a, int ifindex) print_uint(PRINT_ANY, "mcast_max_groups", "mcast_max_groups %u ", rta_getattr_u32(vattr)); } + if (vtb[BRIDGE_VLANDB_ENTRY_NEIGH_SUPPRESS]) { + vattr = vtb[BRIDGE_VLANDB_ENTRY_NEIGH_SUPPRESS]; + print_on_off(PRINT_ANY, "neigh_suppress", "neigh_suppress %s ", + rta_getattr_u8(vattr)); + } print_nl(); if (show_stats) __print_one_vlan_stats(&vstats); |