summaryrefslogtreecommitdiff
path: root/ring_rx.c
diff options
context:
space:
mode:
Diffstat (limited to 'ring_rx.c')
-rw-r--r--ring_rx.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ring_rx.c b/ring_rx.c
index 4c5846c..5675a81 100644
--- a/ring_rx.c
+++ b/ring_rx.c
@@ -23,16 +23,15 @@ void destroy_rx_ring(int sock, struct ring *ring)
{
int ret;
- fmemset(&ring->layout, 0, sizeof(ring->layout));
+ munmap(ring->mm_space, ring->mm_len);
+ ring->mm_len = 0;
+ fmemset(&ring->layout, 0, sizeof(ring->layout));
ret = setsockopt(sock, SOL_PACKET, PACKET_RX_RING, &ring->layout,
sizeof(ring->layout));
if (unlikely(ret))
panic("Cannot destroy the RX_RING!\n");
- munmap(ring->mm_space, ring->mm_len);
- ring->mm_len = 0;
-
xfree(ring->frames);
}