X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=VNFs%2FDPPD-PROX%2Fhandle_dump.c;h=29a46fef8e5e51cb4f2e9127dc62729a7dc95fae;hb=9efb0fe5411cd3cd4eb7b8a6dbf2645ed18dbd1d;hp=c35a6e9e8a9d0b5f4989bb623f1d3d36a5899880;hpb=d923180e4af2612361dd7d4bf1627092a4d552d8;p=samplevnf.git diff --git a/VNFs/DPPD-PROX/handle_dump.c b/VNFs/DPPD-PROX/handle_dump.c index c35a6e9e..29a46fef 100644 --- a/VNFs/DPPD-PROX/handle_dump.c +++ b/VNFs/DPPD-PROX/handle_dump.c @@ -24,13 +24,14 @@ #include "task_init.h" #include "task_base.h" #include "stats.h" +#include "prox_compat.h" struct task_dump { struct task_base base; uint32_t n_mbufs; struct rte_mbuf **mbufs; uint32_t n_pkts; - char pcap_file[128]; + char pcap_file[256]; }; static uint16_t buffer_packets(struct task_dump *task, struct rte_mbuf **mbufs, uint16_t n_pkts) @@ -64,12 +65,14 @@ static void init_task_dump(struct task_base *tbase, __attribute__((unused)) stru struct task_dump *task = (struct task_dump *)tbase; const int socket_id = rte_lcore_to_socket_id(targ->lconf->id); + if (targ->n_pkts == 0) + targ->n_pkts = 64 * 1024; task->mbufs = prox_zmalloc(sizeof(*task->mbufs) * targ->n_pkts, socket_id); task->n_pkts = targ->n_pkts; if (!strcmp(targ->pcap_file, "")) { strcpy(targ->pcap_file, "out.pcap"); } - strncpy(task->pcap_file, targ->pcap_file, sizeof(task->pcap_file)); + prox_strncpy(task->pcap_file, targ->pcap_file, sizeof(task->pcap_file)); } static void stop(struct task_base *tbase)