aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2013-10-11 12:03:25 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2013-10-17 04:27:25 -0400
commit1a8bf6eeef9fe417f90e5338a2fd7fba69c6d0e4 (patch)
tree06eb88bea30c3b06e006e75e84f7506b8dbfde89
parent1255ce5f10dbb4646c8d43b8d59faab48ae4a6b2 (diff)
netfilter: xt_socket: use sock_gen_put()
TCP listener refactoring, part 7 : Use sock_gen_put() instead of xt_socket_put_sk() for future SYN_RECV support. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--net/netfilter/xt_socket.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/net/netfilter/xt_socket.c b/net/netfilter/xt_socket.c
index 3dd0e374bc2b..1ba67931eb1b 100644
--- a/net/netfilter/xt_socket.c
+++ b/net/netfilter/xt_socket.c
@@ -35,15 +35,6 @@
35#include <net/netfilter/nf_conntrack.h> 35#include <net/netfilter/nf_conntrack.h>
36#endif 36#endif
37 37
38static void
39xt_socket_put_sk(struct sock *sk)
40{
41 if (sk->sk_state == TCP_TIME_WAIT)
42 inet_twsk_put(inet_twsk(sk));
43 else
44 sock_put(sk);
45}
46
47static int 38static int
48extract_icmp4_fields(const struct sk_buff *skb, 39extract_icmp4_fields(const struct sk_buff *skb,
49 u8 *protocol, 40 u8 *protocol,
@@ -216,7 +207,7 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par,
216 inet_twsk(sk)->tw_transparent)); 207 inet_twsk(sk)->tw_transparent));
217 208
218 if (sk != skb->sk) 209 if (sk != skb->sk)
219 xt_socket_put_sk(sk); 210 sock_gen_put(sk);
220 211
221 if (wildcard || !transparent) 212 if (wildcard || !transparent)
222 sk = NULL; 213 sk = NULL;
@@ -381,7 +372,7 @@ socket_mt6_v1_v2(const struct sk_buff *skb, struct xt_action_param *par)
381 inet_twsk(sk)->tw_transparent)); 372 inet_twsk(sk)->tw_transparent));
382 373
383 if (sk != skb->sk) 374 if (sk != skb->sk)
384 xt_socket_put_sk(sk); 375 sock_gen_put(sk);
385 376
386 if (wildcard || !transparent) 377 if (wildcard || !transparent)
387 sk = NULL; 378 sk = NULL;