Skip to content

Commit

Permalink
netfilter: tproxy: nf_tproxy_assign_sock() can handle tw sockets
Browse files Browse the repository at this point in the history
transparent field of a socket is either inet_twsk(sk)->tw_transparent
for timewait sockets, or inet_sk(sk)->transparent for other sockets
(TCP/UDP).

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Sep 22, 2010
1 parent 3d13008 commit d485d50
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/netfilter/nf_tproxy_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ nf_tproxy_destructor(struct sk_buff *skb)
int
nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk)
{
if (inet_sk(sk)->transparent) {
bool transparent = (sk->sk_state == TCP_TIME_WAIT) ?
inet_twsk(sk)->tw_transparent :
inet_sk(sk)->transparent;

if (transparent) {
skb_orphan(skb);
skb->sk = sk;
skb->destructor = nf_tproxy_destructor;
Expand Down

0 comments on commit d485d50

Please sign in to comment.