diff options
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index c9fad6fb629b..d10dfecb6cbd 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -40,7 +40,6 @@ | |||
40 | #ifndef _SOCK_H | 40 | #ifndef _SOCK_H |
41 | #define _SOCK_H | 41 | #define _SOCK_H |
42 | 42 | ||
43 | #include <linux/config.h> | ||
44 | #include <linux/list.h> | 43 | #include <linux/list.h> |
45 | #include <linux/timer.h> | 44 | #include <linux/timer.h> |
46 | #include <linux/cache.h> | 45 | #include <linux/cache.h> |
@@ -132,6 +131,7 @@ struct sock_common { | |||
132 | * @sk_receive_queue: incoming packets | 131 | * @sk_receive_queue: incoming packets |
133 | * @sk_wmem_alloc: transmit queue bytes committed | 132 | * @sk_wmem_alloc: transmit queue bytes committed |
134 | * @sk_write_queue: Packet sending queue | 133 | * @sk_write_queue: Packet sending queue |
134 | * @sk_async_wait_queue: DMA copied packets | ||
135 | * @sk_omem_alloc: "o" is "option" or "other" | 135 | * @sk_omem_alloc: "o" is "option" or "other" |
136 | * @sk_wmem_queued: persistent queue size | 136 | * @sk_wmem_queued: persistent queue size |
137 | * @sk_forward_alloc: space allocated forward | 137 | * @sk_forward_alloc: space allocated forward |
@@ -205,6 +205,7 @@ struct sock { | |||
205 | atomic_t sk_omem_alloc; | 205 | atomic_t sk_omem_alloc; |
206 | struct sk_buff_head sk_receive_queue; | 206 | struct sk_buff_head sk_receive_queue; |
207 | struct sk_buff_head sk_write_queue; | 207 | struct sk_buff_head sk_write_queue; |
208 | struct sk_buff_head sk_async_wait_queue; | ||
208 | int sk_wmem_queued; | 209 | int sk_wmem_queued; |
209 | int sk_forward_alloc; | 210 | int sk_forward_alloc; |
210 | gfp_t sk_allocation; | 211 | gfp_t sk_allocation; |
@@ -871,10 +872,7 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb, int needlock) | |||
871 | if (filter) { | 872 | if (filter) { |
872 | unsigned int pkt_len = sk_run_filter(skb, filter->insns, | 873 | unsigned int pkt_len = sk_run_filter(skb, filter->insns, |
873 | filter->len); | 874 | filter->len); |
874 | if (!pkt_len) | 875 | err = pkt_len ? pskb_trim(skb, pkt_len) : -EPERM; |
875 | err = -EPERM; | ||
876 | else | ||
877 | skb_trim(skb, pkt_len); | ||
878 | } | 876 | } |
879 | 877 | ||
880 | if (needlock) | 878 | if (needlock) |
@@ -1271,11 +1269,22 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | |||
1271 | * This routine must be called with interrupts disabled or with the socket | 1269 | * This routine must be called with interrupts disabled or with the socket |
1272 | * locked so that the sk_buff queue operation is ok. | 1270 | * locked so that the sk_buff queue operation is ok. |
1273 | */ | 1271 | */ |
1274 | static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb) | 1272 | #ifdef CONFIG_NET_DMA |
1273 | static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_early) | ||
1274 | { | ||
1275 | __skb_unlink(skb, &sk->sk_receive_queue); | ||
1276 | if (!copied_early) | ||
1277 | __kfree_skb(skb); | ||
1278 | else | ||
1279 | __skb_queue_tail(&sk->sk_async_wait_queue, skb); | ||
1280 | } | ||
1281 | #else | ||
1282 | static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_early) | ||
1275 | { | 1283 | { |
1276 | __skb_unlink(skb, &sk->sk_receive_queue); | 1284 | __skb_unlink(skb, &sk->sk_receive_queue); |
1277 | __kfree_skb(skb); | 1285 | __kfree_skb(skb); |
1278 | } | 1286 | } |
1287 | #endif | ||
1279 | 1288 | ||
1280 | extern void sock_enable_timestamp(struct sock *sk); | 1289 | extern void sock_enable_timestamp(struct sock *sk); |
1281 | extern int sock_get_timestamp(struct sock *, struct timeval __user *); | 1290 | extern int sock_get_timestamp(struct sock *, struct timeval __user *); |