diff options
author | Neale Ranns <nranns@cisco.com> | 2018-01-29 10:43:33 -0800 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2018-01-30 08:54:29 +0000 |
commit | db14f5aff69311d13a0a90baa3567e92f3faa783 (patch) | |
tree | 2ee6edb0d8b82b840fdc90b62f782ea0b95bc8f0 /src/vnet/gre | |
parent | bb16d3ffecd357907d01f2785ac78edf0292cfd3 (diff) |
Allow the provider of a midchain adjacency to pass context data that is returned in the fixup function
Change-Id: I458e6e03b03e27775df33a2fd302743126d6ac44
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/gre')
-rw-r--r-- | src/vnet/gre/gre.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/vnet/gre/gre.c b/src/vnet/gre/gre.c index 7660bbe1d4b..c049b87b6a7 100644 --- a/src/vnet/gre/gre.c +++ b/src/vnet/gre/gre.c @@ -261,8 +261,9 @@ gre_build_rewrite (vnet_main_t * vnm, #define is_v4_packet(_h) ((*(u8*) _h) & 0xF0) == 0x40 -void -gre4_fixup (vlib_main_t * vm, ip_adjacency_t * adj, vlib_buffer_t * b0) +static void +gre4_fixup (vlib_main_t * vm, + ip_adjacency_t * adj, vlib_buffer_t * b0, const void *data) { ip4_header_t *ip0; @@ -274,8 +275,9 @@ gre4_fixup (vlib_main_t * vm, ip_adjacency_t * adj, vlib_buffer_t * b0) ip0->checksum = ip4_header_checksum (ip0); } -void -gre6_fixup (vlib_main_t * vm, ip_adjacency_t * adj, vlib_buffer_t * b0) +static void +gre6_fixup (vlib_main_t * vm, + ip_adjacency_t * adj, vlib_buffer_t * b0, const void *data) { ip6_header_t *ip0; @@ -301,6 +303,7 @@ gre_update_adj (vnet_main_t * vnm, u32 sw_if_index, adj_index_t ai) is_ipv6 = t->tunnel_dst.fp_proto == FIB_PROTOCOL_IP6 ? 1 : 0; adj_nbr_midchain_update_rewrite (ai, !is_ipv6 ? gre4_fixup : gre6_fixup, + NULL, (VNET_LINK_ETHERNET == adj_get_link_type (ai) ? ADJ_FLAG_MIDCHAIN_NO_COUNT : |