diff options
author | Neale Ranns <nranns@cisco.com> | 2018-07-11 10:31:26 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-07-20 13:21:03 +0000 |
commit | 1855b8e48d95289cc9f0a6e339f2148d64ac705c (patch) | |
tree | 71e888d9aabc16a388c07a5f3c3089ade0fdadab /src/vnet/ip/ip6_forward.c | |
parent | 631de0dffebf2633e32b55c5c9b4663867a50371 (diff) |
IP directed broadcast
with ip direct broadcast enable a packet to the interface's
subnet broadcast address with be sent L2 broadcast on the
interface. dissabled, it will be dropped. it is disabled by
default, which preserves current behaviour
Change-Id: If154cb92e64834e97a541b32624354348a0eafb3
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip6_forward.c')
-rw-r--r-- | src/vnet/ip/ip6_forward.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c index 41f5b151a09..888b52643c1 100644 --- a/src/vnet/ip/ip6_forward.c +++ b/src/vnet/ip/ip6_forward.c @@ -1944,6 +1944,16 @@ ip6_rewrite (vlib_main_t * vm, } static uword +ip6_rewrite_bcast (vlib_main_t * vm, + vlib_node_runtime_t * node, vlib_frame_t * frame) +{ + if (adj_are_counters_enabled ()) + return ip6_rewrite_inline (vm, node, frame, 1, 0, 0); + else + return ip6_rewrite_inline (vm, node, frame, 0, 0, 0); +} + +static uword ip6_rewrite_mcast (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { @@ -1982,11 +1992,9 @@ VLIB_REGISTER_NODE (ip6_midchain_node) = .format_trace = format_ip6_forward_next_trace, .sibling_of = "ip6-rewrite", }; -/* *INDENT-ON* */ VLIB_NODE_FUNCTION_MULTIARCH (ip6_midchain_node, ip6_midchain); -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (ip6_rewrite_node) = { .function = ip6_rewrite, @@ -2001,11 +2009,19 @@ VLIB_REGISTER_NODE (ip6_rewrite_node) = [IP6_REWRITE_NEXT_FRAGMENT] = "ip6-frag", }, }; -/* *INDENT-ON* */ VLIB_NODE_FUNCTION_MULTIARCH (ip6_rewrite_node, ip6_rewrite); -/* *INDENT-OFF* */ +VLIB_REGISTER_NODE (ip6_rewrite_bcast_node) = { + .function = ip6_rewrite, + .name = "ip6-rewrite-bcast", + .vector_size = sizeof (u32), + + .format_trace = format_ip6_rewrite_trace, + .sibling_of = "ip6-rewrite", +}; +VLIB_NODE_FUNCTION_MULTIARCH (ip6_rewrite_bcast_node, ip6_rewrite_bcast) + VLIB_REGISTER_NODE (ip6_rewrite_mcast_node) = { .function = ip6_rewrite_mcast, @@ -2014,11 +2030,9 @@ VLIB_REGISTER_NODE (ip6_rewrite_mcast_node) = .format_trace = format_ip6_rewrite_trace, .sibling_of = "ip6-rewrite", }; -/* *INDENT-ON* */ VLIB_NODE_FUNCTION_MULTIARCH (ip6_rewrite_mcast_node, ip6_rewrite_mcast); -/* *INDENT-OFF* */ VLIB_REGISTER_NODE (ip6_mcast_midchain_node, static) = { .function = ip6_mcast_midchain, @@ -2027,9 +2041,9 @@ VLIB_REGISTER_NODE (ip6_mcast_midchain_node, static) = .format_trace = format_ip6_rewrite_trace, .sibling_of = "ip6-rewrite", }; -/* *INDENT-ON* */ VLIB_NODE_FUNCTION_MULTIARCH (ip6_mcast_midchain_node, ip6_mcast_midchain); +/* *INDENT-ON* */ /* * Hop-by-Hop handling |