# Re: \[PATCH net-next\] net: bail on sock\_wfree, sock\_rfree when we have a TCP\_TIMEWAIT sk

- From: David Miller \<davem@davemloft.net\>
- Date: 2015-07-01 21:14:04 
- List: netdev
- Page: https://ratatoskr.run/netdev/2015/07/10990988
- Thread: https://ratatoskr.run/netdev/2015/07/10990983/t.md

```text
From: Alex Gartrell <redacted>
Date: Wed, 1 Jul 2015 13:13:09 -0700

> If we early-demux bind a TCP_TIMEWAIT socket to an skb and then orphan it
> (as we need to do in the ipvs forwarding case), sock_wfree and sock_rfree
> are going to reach into the inet_timewait_sock and mess with fields that
> don't exist.
> 
> Signed-off-by: Alex Gartrell <redacted>

If we're forwarding, we should not find a local socket, period.

We should only match sockets for locally destined packets.

So I'd say that the state in which you say this can occur is illegal.
```
