aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip4.h
diff options
context:
space:
mode:
authorNick Zavaritsky <nick.zavaritsky@emnify.com>2020-02-27 15:54:58 +0000
committerJohn Lo <loj@cisco.com>2020-03-03 16:15:15 +0000
commit27518c2ffd0ef75e973a64870da0e3339f39ccce (patch)
tree3fb7afdb06963ae3ef36cc74bfe33e10b8668d5d /src/vnet/ip/ip4.h
parent297d288ed653abac9d719013c4ead5215230e7da (diff)
geneve gtpu vxlan vxlan-gpe: VRF-aware bypass node
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 <nick.zavaritsky@emnify.com> Change-Id: I5665d94882bbf45d15f8da140c7ada528ec7fa94
Diffstat (limited to 'src/vnet/ip/ip4.h')
-rw-r--r--src/vnet/ip/ip4.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vnet/ip/ip4.h b/src/vnet/ip/ip4.h
index bed552b982c..7a42510166f 100644
--- a/src/vnet/ip/ip4.h
+++ b/src/vnet/ip/ip4.h
@@ -410,6 +410,16 @@ vlib_buffer_push_ip4 (vlib_main_t * vm, vlib_buffer_t * b,
return ih;
}
+
+always_inline u32
+vlib_buffer_get_ip4_fib_index (vlib_buffer_t * b)
+{
+ u32 fib_index, sw_if_index;
+ sw_if_index = vnet_buffer (b)->sw_if_index[VLIB_RX];
+ fib_index = vnet_buffer (b)->sw_if_index[VLIB_TX];
+ return (fib_index == (u32) ~ 0) ?
+ vec_elt (ip4_main.fib_index_by_sw_if_index, sw_if_index) : fib_index;
+}
#endif /* included_ip_ip4_h */
/*