aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipip/node.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-12-21 09:52:24 +0000
committerNeale Ranns <neale@graphiant.com>2021-01-07 15:48:43 +0000
commite294de6f876587ddc34ab02771771aea60087adc (patch)
treea68640401fac25d1d137dd119dbb6a03c7938173 /src/vnet/ipip/node.c
parenta9e2774f5561ccb77c8243a196f93f5070f6c5ad (diff)
ipip: Support MPLS over IP
Type: feature Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: Ief1755131297afcaa14fe74fd8dd28c71a92fbe6
Diffstat (limited to 'src/vnet/ipip/node.c')
-rw-r--r--src/vnet/ipip/node.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/vnet/ipip/node.c b/src/vnet/ipip/node.c
index baaeee863fc..b008a21a20f 100644
--- a/src/vnet/ipip/node.c
+++ b/src/vnet/ipip/node.c
@@ -22,11 +22,12 @@
#include <vnet/tunnel/tunnel_dp.h>
#include <vppinfra/sparse_vec.h>
-#define foreach_ipip_input_next \
- _(PUNT, "error-punt") \
- _(DROP, "error-drop") \
- _(IP4_INPUT, "ip4-input") \
- _(IP6_INPUT, "ip6-input")
+#define foreach_ipip_input_next \
+ _ (PUNT, "error-punt") \
+ _ (DROP, "error-drop") \
+ _ (IP4_INPUT, "ip4-input") \
+ _ (IP6_INPUT, "ip6-input") \
+ _ (MPLS_INPUT, "mpls-input")
typedef enum
{
@@ -175,6 +176,17 @@ ipip_input (vlib_main_t * vm, vlib_node_runtime_t * node,
else
tunnel_decap_fixup_4o4 (t0->flags, ip40 + 1, ip40);
}
+ else if (inner_protocol0 == IP_PROTOCOL_MPLS_IN_IP)
+ {
+ next0 = IPIP_INPUT_NEXT_MPLS_INPUT;
+
+ if (is_ipv6)
+ tunnel_decap_fixup_mplso6 (
+ t0->flags, (mpls_unicast_header_t *) (ip60 + 1), ip60);
+ else
+ tunnel_decap_fixup_mplso4 (
+ t0->flags, (mpls_unicast_header_t *) ip40 + 1, ip40);
+ }
if (!is_ipv6 && t0->mode == IPIP_MODE_6RD
&& t0->sixrd.security_check)