From 367efea8c9ba557a81158a69ecee267706a520eb Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Thu, 28 Mar 2013 18:48:25 +0100 Subject: ring: purge timer before we unmap tx ring buffers If we unmap TX ring buffers and still have timer shots that trigger the kernel to traverse the TX_RING, it can send out random crap in some situations. Prevent this by destroying the timer and flush the TX_RING first in wait mode. Signed-off-by: Daniel Borkmann --- ring_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ring_rx.c') diff --git a/ring_rx.c b/ring_rx.c index 5675a81..d89d762 100644 --- a/ring_rx.c +++ b/ring_rx.c @@ -30,7 +30,7 @@ void destroy_rx_ring(int sock, struct ring *ring) ret = setsockopt(sock, SOL_PACKET, PACKET_RX_RING, &ring->layout, sizeof(ring->layout)); if (unlikely(ret)) - panic("Cannot destroy the RX_RING!\n"); + panic("Cannot destroy the RX_RING: %s!\n", strerror(errno)); xfree(ring->frames); } -- cgit v1.2.3-54-g00ecf