/* * netsniff-ng - the packet sniffing beast * Copyright 2009, 2010 Daniel Borkmann. * Subject to the GPL, version 2. */ #ifndef TX_RING_H #define TX_RING_H #include #include "ring.h" #include "built_in.h" /* Give userland 10 us time to push packets to the ring */ #define TX_KERNEL_PULL_INT 10 extern void destroy_tx_ring(int sock, struct ring *ring); extern void create_tx_ring(int sock, struct ring *ring, int verbose); extern void mmap_tx_ring(int sock, struct ring *ring); extern void alloc_tx_ring_frames(int sock, struct ring *ring); extern void bind_tx_ring(int sock, struct ring *ring, int ifindex); extern void setup_tx_ring_layout(int sock, struct ring *ring, unsigned int size, bool jumbo_support); 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_SEND_REQUEST | TP_STATUS_SENDING)); } static inline void kernel_may_pull_from_tx(struct tpacket2_hdr *hdr) { hdr->tp_status = TP_STATUS_SEND_REQUEST; } 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 */ ack net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2016-09-07 15:28:54 +0100
committerDavid Howells <dhowells@redhat.com>2016-09-07 15:30:22 +0100
commit8b7fac50ab7f2668c43795c135025c472922a344 (patch)
tree9c2fe229af8e976518911b2b38576db84dc05753
parent278ac0cdd5e516bdef2b9b8f5a4dd6366a5bccfe (diff)
rxrpc: Pass the connection pointer to rxrpc_post_packet_to_call()
Pass the connection pointer to rxrpc_post_packet_to_call() as the call might get disconnected whilst we're looking at it, but the connection pointer determined by rxrpc_data_read() is guaranteed by RCU for the duration of the call. Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--net/rxrpc/input.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c