xt_qtaguid: use sock_gen_put() instead of xt_socket_put_sk()
Removing obsolete xt_socket_put_sk() and using sock_gen_put() instead.
xt_socket_put_sk() was reintroduced for xt_qtaguid in one of the patches,
but it turned out sock_gen_put() supersedes xt_socket_put_sk(). So we
don't need xt_socket_put_sk() any more.
This patch is based on commit 1a8bf6eeef
(netfilter: xt_socket: use sock_gen_put())
Change-Id: I976d5f7f7eded0f3cc91b596acfeb35e4c2057e5
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
(cherry picked from commit 551780fc28cb7480dbc4f585ef80ca02c2922ec1)
Signed-off-by: John Stultz <john.stultz@linaro.org>
This commit is contained in:
parent
7c36bff505
commit
62ade5c47d
3 changed files with 2 additions and 13 deletions
|
@ -26,7 +26,6 @@ struct xt_socket_mtinfo3 {
|
||||||
| XT_SOCKET_NOWILDCARD \
|
| XT_SOCKET_NOWILDCARD \
|
||||||
| XT_SOCKET_RESTORESKMARK)
|
| XT_SOCKET_RESTORESKMARK)
|
||||||
|
|
||||||
void xt_socket_put_sk(struct sock *sk);
|
|
||||||
struct sock *xt_socket_get4_sk(const struct sk_buff *skb,
|
struct sock *xt_socket_get4_sk(const struct sk_buff *skb,
|
||||||
struct xt_action_param *par);
|
struct xt_action_param *par);
|
||||||
struct sock *xt_socket_get6_sk(const struct sk_buff *skb,
|
struct sock *xt_socket_get6_sk(const struct sk_buff *skb,
|
||||||
|
|
|
@ -1605,7 +1605,7 @@ static struct sock *qtaguid_find_sk(const struct sk_buff *skb,
|
||||||
* "struct inet_timewait_sock" which is missing fields.
|
* "struct inet_timewait_sock" which is missing fields.
|
||||||
*/
|
*/
|
||||||
if (sk->sk_state == TCP_TIME_WAIT) {
|
if (sk->sk_state == TCP_TIME_WAIT) {
|
||||||
xt_socket_put_sk(sk);
|
sock_gen_put(sk);
|
||||||
sk = NULL;
|
sk = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1803,7 +1803,7 @@ static bool qtaguid_mt(const struct sk_buff *skb, struct xt_action_param *par)
|
||||||
|
|
||||||
put_sock_ret_res:
|
put_sock_ret_res:
|
||||||
if (got_sock)
|
if (got_sock)
|
||||||
xt_socket_put_sk(sk);
|
sock_gen_put(sk);
|
||||||
if (set_sk_callback_lock)
|
if (set_sk_callback_lock)
|
||||||
read_unlock_bh(&sk->sk_callback_lock);
|
read_unlock_bh(&sk->sk_callback_lock);
|
||||||
ret_res:
|
ret_res:
|
||||||
|
|
|
@ -35,16 +35,6 @@
|
||||||
#include <net/netfilter/nf_conntrack.h>
|
#include <net/netfilter/nf_conntrack.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(xt_socket_put_sk);
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
extract_icmp4_fields(const struct sk_buff *skb,
|
extract_icmp4_fields(const struct sk_buff *skb,
|
||||||
u8 *protocol,
|
u8 *protocol,
|
||||||
|
|
Loading…
Add table
Reference in a new issue