Skip to content

Commit

Permalink
netfilter: xt_socket: use sock_gen_put()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and Pablo Neira Ayuso committed Oct 17, 2013
1 parent 1255ce5 commit 1a8bf6e
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions net/netfilter/xt_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@
#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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1a8bf6e

Please sign in to comment.