summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/punt_api.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-07-10 07:10:25 +0000
committerNeale Ranns <nranns@cisco.com>2019-07-12 07:38:47 +0000
commit719beb709818b70a1fd65f3c2a625d955678ceb6 (patch)
tree02eb5efe0452f9ed87523827784cdf385131c695 /src/vnet/ip/punt_api.c
parent6d72c175edbb7654a643a86411f6f95aae16d10d (diff)
ip ipsec: Remove IPSec SPI-0 punt reason
Type: fix There's no call for an SPI-0 punt reason with UDP encap, since it's only with UDP encap that the ambiguity between IKE or IPSEC occurs (and SPI=0 determines IKE). Enhance the punt API to dum ponly the reason requested, so a client can use this as a get-ID API Change-Id: I5c6d72b03885e88c489117677e72f1ef5da90dfc Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip/punt_api.c')
-rw-r--r--src/vnet/ip/punt_api.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vnet/ip/punt_api.c b/src/vnet/ip/punt_api.c
index b356886a56f..8bb0f7fbc82 100644
--- a/src/vnet/ip/punt_api.c
+++ b/src/vnet/ip/punt_api.c
@@ -321,6 +321,7 @@ typedef struct punt_reason_dump_walk_ctx_t_
{
vl_api_registration_t *reg;
u32 context;
+ u8 *name;
} punt_reason_dump_walk_ctx_t;
static int
@@ -329,6 +330,14 @@ punt_reason_dump_walk_cb (vlib_punt_reason_t id, const u8 * name, void *args)
punt_reason_dump_walk_ctx_t *ctx = args;
vl_api_punt_reason_details_t *mp;
+ if (ctx->name)
+ {
+ /* user requested a specific punt-reason */
+ if (vec_cmp (name, ctx->name))
+ /* not the reasonn we're lookgin for */
+ return 1;
+ }
+
mp = vl_msg_api_alloc (sizeof (*mp) + vec_len (name));
if (!mp)
return (0);
@@ -357,9 +366,12 @@ vl_api_punt_reason_dump_t_handler (vl_api_punt_reason_dump_t * mp)
punt_reason_dump_walk_ctx_t ctx = {
.reg = reg,
.context = mp->context,
+ .name = vl_api_from_api_to_vec (&mp->reason.name),
};
punt_reason_walk (punt_reason_dump_walk_cb, &ctx);
+
+ vec_free (ctx.name);
}
#define vl_msg_name_crc_list