Type: improvement
There is a mode field in ipip_tunnel_details. The handler for the dump
API does not do anything to populate it so it always contains 0
(TUNNEL_API_MODE_P2P). This is correct for p2p tunnels but is wrong for
multipoint tunnels.
Populate the field with the correct mode.
Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I6c1288a0d3929db0f67100748b5760c36b594f97
REPLY_MACRO (VL_API_IPIP_DEL_TUNNEL_REPLY);
}
REPLY_MACRO (VL_API_IPIP_DEL_TUNNEL_REPLY);
}
+static vl_api_tunnel_mode_t
+ipip_tunnel_mode_encode (ipip_mode_t mode)
+{
+ switch (mode)
+ {
+ case IPIP_MODE_P2P:
+ return TUNNEL_API_MODE_P2P;
+ case IPIP_MODE_P2MP:
+ return TUNNEL_API_MODE_MP;
+ case IPIP_MODE_6RD:
+ return TUNNEL_API_MODE_P2P;
+ default:
+ return TUNNEL_API_MODE_P2P;
+ }
+}
+
static void
send_ipip_tunnel_details (ipip_tunnel_t * t, vl_api_ipip_tunnel_dump_t * mp)
{
static void
send_ipip_tunnel_details (ipip_tunnel_t * t, vl_api_ipip_tunnel_dump_t * mp)
{
bool is_ipv6 = t->transport == IPIP_TRANSPORT_IP6 ? true : false;
fib_table_t *ft;
bool is_ipv6 = t->transport == IPIP_TRANSPORT_IP6 ? true : false;
fib_table_t *ft;
- ft = fib_table_get (t->fib_index, (is_ipv6 ? FIB_PROTOCOL_IP6 :
- FIB_PROTOCOL_IP4));
+ ft = fib_table_get (t->fib_index,
+ (is_ipv6 ? FIB_PROTOCOL_IP6 : FIB_PROTOCOL_IP4));
/* *INDENT-OFF* */
REPLY_MACRO_DETAILS2(VL_API_IPIP_TUNNEL_DETAILS,
/* *INDENT-OFF* */
REPLY_MACRO_DETAILS2(VL_API_IPIP_TUNNEL_DETAILS,
rmp->tunnel.sw_if_index = htonl (t->sw_if_index);
rmp->tunnel.dscp = ip_dscp_encode(t->dscp);
rmp->tunnel.flags = tunnel_encap_decap_flags_encode(t->flags);
rmp->tunnel.sw_if_index = htonl (t->sw_if_index);
rmp->tunnel.dscp = ip_dscp_encode(t->dscp);
rmp->tunnel.flags = tunnel_encap_decap_flags_encode(t->flags);
+ rmp->tunnel.mode = ipip_tunnel_mode_encode (t->mode);