netfilter: xt_socket: use sock_gen_put()
authorEric Dumazet <edumazet@google.com>
Fri, 11 Oct 2013 16:03:25 +0000 (09:03 -0700)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 17 Oct 2013 08:27:25 +0000 (10:27 +0200)
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>
net/netfilter/xt_socket.c

index 3dd0e374bc2b3952f845470c67e3a8f77391ff23..1ba67931eb1b168fabfa78790f5ed53713188f9d 100644 (file)
 #include <net/netfilter/nf_conntrack.h>
 #endif
 
-static void
-xt_socket_put_sk(struct sock *sk)
-{
-       if (sk->sk_state == TCP_TIME_WAIT)
-               inet_twsk_put(inet_twsk(sk));
-       else
-               sock_put(sk);
-}
-
 static int
 extract_icmp4_fields(const struct sk_buff *skb,
                    u8 *protocol,
@@ -216,7 +207,7 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par,
                                        inet_twsk(sk)->tw_transparent));
 
                if (sk != skb->sk)
-                       xt_socket_put_sk(sk);
+                       sock_gen_put(sk);
 
                if (wildcard || !transparent)
                        sk = NULL;
@@ -381,7 +372,7 @@ socket_mt6_v1_v2(const struct sk_buff *skb, struct xt_action_param *par)
                                        inet_twsk(sk)->tw_transparent));
 
                if (sk != skb->sk)
-                       xt_socket_put_sk(sk);
+                       sock_gen_put(sk);
 
                if (wildcard || !transparent)
                        sk = NULL;