diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-04-22 22:51:09 +0200 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-04-22 22:51:09 +0200 |
commit | 89c9d876cffac1867b668359f3b60657450130a1 (patch) | |
tree | 2e47b288734c583865ccae8d3775ec55d3889407 | |
parent | 2640c81e49ad52a5223689bffcbe8c1c14ddfdc9 (diff) |
ring_tx: user_may_pull_from_tx: fix check for user frame
TP_STATUS_AVAILABLE is 0, thus the condition will always be
successful. Fix this bug by properly checking kernel flags.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
-rw-r--r-- | ring_tx.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -24,7 +24,7 @@ extern void set_packet_loss_discard(int sock); static inline int user_may_pull_from_tx(struct tpacket2_hdr *hdr) { - return ((hdr->tp_status & TP_STATUS_AVAILABLE) == TP_STATUS_AVAILABLE); + return !(hdr->tp_status & (TP_STATUS_SEND_REQUEST | TP_STATUS_SENDING)); } static inline void kernel_may_pull_from_tx(struct tpacket2_hdr *hdr) |