numam-dpdk/drivers/net/pcap
Reshma Pattan e07f80c850 net/pcap: fix crash on close
Testpmd application will crash in fclose() upon quit after running
the below command.

"sudo gdb --args ./x86_64-native-linuxapp-gcc/app/testpmd -c 0xf0 -n 4
          --vdev 'eth_pcap0,tx_iface=enp1s0f1,rx_pcap=/tmp/test.pcap' --
          --port-topology=chained -i"

The reason is, pcap vdev creation with tx stream type as "iface"
as in above command doesn't need member "dumpers" of
"struct tx_pcaps", hence will not have memory allocated for it.
It contains a garbage values, as local object of struct tx_pcaps
is not initialized to 0 inside rte_pmd_pcap_dev_init().
So calling pcap_dump_close() on dumper as part of eth_dev_stop()
is causing segfault in fclose().

Fix is to initialize local object of struct tx_pcaps to 0.
Also initialize local object of struct rx_pcaps to 0.
So during eth_dev_stop(), pcap_dump_close() will not be called if dumper
is NULL.

Fixes: 4c173302c3 ("pcap: add new driver")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
2016-06-15 17:13:56 +02:00
..
Makefile mk: fix internal dependencies 2016-06-29 13:33:01 +02:00
rte_eth_pcap.c net/pcap: fix crash on close 2016-06-15 17:13:56 +02:00
rte_pmd_pcap_version.map pcap: move drivers/net/ 2015-05-22 16:06:22 +02:00