pcap: fix double stop error
authorNicolás Pernas Maradei <nicolas.pernas.maradei@emutex.com>
Sat, 4 Oct 2014 22:24:17 +0000 (23:24 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 9 Oct 2014 18:02:35 +0000 (20:02 +0200)
commita0fce1193ce13a50c00624cb36605ebef7a3e60b
treeb126ff451bff1fdf10b0aded071adeaa1e9dabb7
parentf7eda85b9cebb7cf45a3426d4b9aaec874774b9f
pcap: fix double stop error

librte_pmd_pcap driver was opening the pcap/interfaces only at init time and
closing them only when the port was being stopped. This behaviour would cause
problems (leading to segfault) if the user closed the port 2 times. The first
time the pcap/interfaces would be normally closed but libpcap would throw an
error causing a segfault if the closed pcaps/interfaces were closed again.
This behaviour is solved by re-openning pcaps/interfaces when the port is
started (only if these weren't open already for example at init time).

Signed-off-by: Nicolás Pernas Maradei <nico@emutex.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
lib/librte_pmd_pcap/rte_eth_pcap.c