summaryrefslogtreecommitdiff
path: root/ring_tx.h
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-03-28 18:48:25 +0100
committerDaniel Borkmann <dborkman@redhat.com>2013-03-28 18:48:25 +0100
commit367efea8c9ba557a81158a69ecee267706a520eb (patch)
tree461ddf127e076a99d792e59006fd599ad1704c01 /ring_tx.h
parentb55fde49e9f3e772b62e175cdbbec8f9fcc77567 (diff)
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 <dborkman@redhat.com>
Diffstat (limited to 'ring_tx.h')
-rw-r--r--ring_tx.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/ring_tx.h b/ring_tx.h
index 7970045..769f27e 100644
--- a/ring_tx.h
+++ b/ring_tx.h
@@ -37,4 +37,9 @@ static inline int pull_and_flush_tx_ring(int sock)
return sendto(sock, NULL, 0, MSG_DONTWAIT, NULL, 0);
}
+static inline int pull_and_flush_tx_ring_wait(int sock)
+{
+ return sendto(sock, NULL, 0, 0, NULL, 0);
+}
+
#endif /* TX_RING_H */