Re: [PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-05 Thread Julian Anastasov
Hello, On Fri, 3 Jul 2015, Alex Gartrell wrote: > > - if packets go to local server IPVS should not touch > > skb->dst, skb->sk, etc (NF_ACCEPT case) > > Yeah, the thing is that early demux could totally match for a socket > that existed before we created the service, an

Re: [PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-05 Thread Eric Dumazet
> Looks like routing by definition can not divert skbs with > early-demux socket because input routing is not called. Only if found socket has a valid sk->sk_rx_dst Early demux : 1) if TCP lookup found a matching socket, we do the attachment skb->sk = sk; skb->destructor = sock_ede

Re: [PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-03 Thread Alex Gartrell
Hey On Fri, Jul 3, 2015 at 1:32 AM, Julian Anastasov wrote: > To summarize: > - we should call skb_orphan as soon as possible after > deciding if packets goes to local or remote real server > but only for skb->sk set by early_demux, not for packets > sent by TCP

Re: [PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-03 Thread Julian Anastasov
Hello, On Thu, 2 Jul 2015, Alex Gartrell wrote: > On Thu, Jul 2, 2015 at 2:18 PM, Alex Gartrell wrote: > > If early demux was enabled, we'd use the route from the socket > > Actually now that I think about it, this is probably broken, because > we don't reply to the packet but instead

Re: [PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-02 Thread Eric Dumazet
On Thu, 2015-07-02 at 14:18 -0700, Alex Gartrell wrote: > On Thu, Jul 2, 2015 at 1:44 AM, Julian Anastasov wrote: > > I think, your patch from January is almost > > good: > > I'll rebase it, add your other suggestions, test it, and send it in. > > > And the patch from Eric for IPVS looks

Re: [PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-02 Thread Alex Gartrell
On Thu, Jul 2, 2015 at 2:18 PM, Alex Gartrell wrote: > If early demux was enabled, we'd use the route from the socket Actually now that I think about it, this is probably broken, because we don't reply to the packet but instead silently drop it. -- Alex Gartrell http://vger.kernel.org/majordomo

Re: [PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-02 Thread Alex Gartrell
On Thu, Jul 2, 2015 at 1:44 AM, Julian Anastasov wrote: > I think, your patch from January is almost > good: I'll rebase it, add your other suggestions, test it, and send it in. > And the patch from Eric for IPVS looks good too. Are we sure that we want to change the semantics of set_ow

Re: [PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-02 Thread Julian Anastasov
Hello, On Thu, 2 Jul 2015, Julian Anastasov wrote: > Alex, in our discussion on January I thought > we can skip calling skb_orphan for some cases but as > input and output path use different skb->destructor > we should call skb_orphan for every method, in every > case when skb->dev

Re: [PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-02 Thread Julian Anastasov
Hello, On Wed, 1 Jul 2015, Alex Gartrell wrote: > On Wed, Jul 1, 2015 at 4:26 PM, Eric Dumazet wrote: > > I think you are mistaken Alex. > > Indeed, I was! Should be unsurpising. > > > > > socket early demux cannot possibly set skb->destructor to sock_rfree() > > Yeah I will admit a

Re: [PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-01 Thread Alex Gartrell
On Wed, Jul 1, 2015 at 4:26 PM, Eric Dumazet wrote: > I think you are mistaken Alex. Indeed, I was! Should be unsurpising. > > socket early demux cannot possibly set skb->destructor to sock_rfree() Yeah I will admit adding the code to sock_rfree reflexively out of paranoia. > If skb->destruct

Re: [PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-01 Thread Eric Dumazet
On Thu, 2015-07-02 at 01:26 +0200, Eric Dumazet wrote: > On Thu, Jul 2, 2015 at 1:18 AM, Alex Gartrell wrote: > > On Wednesday, July 1, 2015, Eric Dumazet wrote: > >> > >> On Wed, Jul 1, 2015 at 11:14 PM, David Miller wrote: > >> > From: Alex Gartrell > >> > Date: Wed, 1 Jul 2015 13:13:09 -0700

Re: [PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-01 Thread Eric Dumazet
On Thu, Jul 2, 2015 at 1:18 AM, Alex Gartrell wrote: > On Wednesday, July 1, 2015, Eric Dumazet wrote: >> >> On Wed, Jul 1, 2015 at 11:14 PM, David Miller wrote: >> > From: Alex Gartrell >> > Date: Wed, 1 Jul 2015 13:13:09 -0700 >> > >> >> If we early-demux bind a TCP_TIMEWAIT socket to an skb

Re: [PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-01 Thread Eric Dumazet
On Wed, Jul 1, 2015 at 11:14 PM, David Miller wrote: > From: Alex Gartrell > 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

Re: [PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-01 Thread David Miller
From: Alex Gartrell 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

[PATCH net-next] net: bail on sock_wfree, sock_rfree when we have a TCP_TIMEWAIT sk

2015-07-01 Thread Alex Gartrell
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 --- net/core/sock.c | 6 ++ 1