X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdpo%2Freceive_dpo.c;h=949dbfa6587de254923693f4b81588a9b2d5e98d;hb=02bfd641b;hp=2b2571c6c831b792d9e27e08a6917c096ee5928f;hpb=7cd468a3d7dee7d6c92f69a0bb7061ae208ec727;p=vpp.git diff --git a/src/vnet/dpo/receive_dpo.c b/src/vnet/dpo/receive_dpo.c index 2b2571c6c83..949dbfa6587 100644 --- a/src/vnet/dpo/receive_dpo.c +++ b/src/vnet/dpo/receive_dpo.c @@ -25,13 +25,19 @@ */ receive_dpo_t *receive_dpo_pool; +int +dpo_is_receive (const dpo_id_t *dpo) +{ + return (dpo->dpoi_type == DPO_RECEIVE); +} + static receive_dpo_t * receive_dpo_alloc (void) { receive_dpo_t *rd; pool_get_aligned(receive_dpo_pool, rd, CLIB_CACHE_LINE_BYTES); - memset(rd, 0, sizeof(*rd)); + clib_memset(rd, 0, sizeof(*rd)); return (rd); } @@ -102,6 +108,11 @@ format_receive_dpo (u8 *s, va_list *ap) vnet_main_t * vnm = vnet_get_main(); receive_dpo_t *rd; + if (pool_is_free_index(receive_dpo_pool, index)) + { + return (format(s, "dpo-receive DELETED")); + } + rd = receive_dpo_get(index); if (~0 != rd->rd_sw_if_index)