From 27518c2ffd0ef75e973a64870da0e3339f39ccce Mon Sep 17 00:00:00 2001 From: Nick Zavaritsky Date: Thu, 27 Feb 2020 15:54:58 +0000 Subject: geneve gtpu vxlan vxlan-gpe: VRF-aware bypass node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bypass node MUST NOT intercept a packet if destination IP doesn’t match a local address. However IP address interpretation depends on the VRF, hence bypass node must take that into account. This patch also factors-out common VTEP management and checking code. Type: improvement Signed-off-by: Nick Zavaritsky Change-Id: I5665d94882bbf45d15f8da140c7ada528ec7fa94 --- src/vnet/ip/ip.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/vnet/ip/ip.h') diff --git a/src/vnet/ip/ip.h b/src/vnet/ip/ip.h index 040e580c3a1..75750c5a192 100644 --- a/src/vnet/ip/ip.h +++ b/src/vnet/ip/ip.h @@ -289,6 +289,15 @@ void ip6_prefix_max_address_host_order (ip6_address_t * ip, u8 plen, void ip6_preflen_to_mask (u8 pref_len, ip6_address_t * mask); u32 ip6_mask_to_preflen (ip6_address_t * mask); +always_inline u32 vlib_buffer_get_ip4_fib_index (vlib_buffer_t * b); +always_inline u32 vlib_buffer_get_ip6_fib_index (vlib_buffer_t * b); +always_inline u32 +vlib_buffer_get_ip_fib_index (vlib_buffer_t * b, u8 is_ip4) +{ + return (is_ip4 ? vlib_buffer_get_ip4_fib_index + : vlib_buffer_get_ip6_fib_index) (b); +} + #endif /* included_ip_main_h */ /* -- cgit 1.2.3-korg