[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iK96naKmc5Ep1PBxvksShQk=WMEoY_V0qZneN_JAEgtRg@mail.gmail.com>
Date: Mon, 27 Jun 2022 13:47:25 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Muhammad Usama Anjum <usama.anjum@...labora.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
David Ahern <dsahern@...nel.org>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Gabriel Krisman Bertazi <krisman@...labora.com>,
open list <linux-kernel@...r.kernel.org>,
Collabora Kernel ML <kernel@...labora.com>,
Paul Gofman <pgofman@...eweavers.com>,
"open list:NETWORKING [TCP]" <netdev@...r.kernel.org>,
Sami Farin <hvtaifwkbgefbaei@...il.com>
Subject: Re: [RFC] EADDRINUSE from bind() on application restart after killing
On Mon, Jun 27, 2022 at 12:20 PM Muhammad Usama Anjum
<usama.anjum@...labora.com> wrote:
>
> Hi Eric,
>
> On 5/30/22 8:28 PM, Eric Dumazet wrote:
> >> The following command and patch work for my use case. The socket in
> >> TIME_WAIT_2 or TIME_WAIT state are closed when zapped.
> >>
> >> Can you please upstream this patch?
> > Yes, I will when net-next reopens, thanks for testing it.
> Have you tried upstreaming it?
>
> Tested-by: Muhammad Usama Anjum <usama.anjum@...labora.com>
>
I will do this today, thanks for the heads up.
> >
> >>> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> >>> index 9984d23a7f3e1353d2e1fc9053d98c77268c577e..1b7bde889096aa800b2994c64a3a68edf3b62434
> >>> 100644
> >>> --- a/net/ipv4/tcp.c
> >>> +++ b/net/ipv4/tcp.c
> >>> @@ -4519,6 +4519,15 @@ int tcp_abort(struct sock *sk, int err)
> >>> local_bh_enable();
> >>> return 0;
> >>> }
> >>> + if (sk->sk_state == TCP_TIME_WAIT) {
> >>> + struct inet_timewait_sock *tw = inet_twsk(sk);
> >>> +
> >>> + refcount_inc(&tw->tw_refcnt);
> >>> + local_bh_disable();
> >>> + inet_twsk_deschedule_put(tw);
> >>> + local_bh_enable();
> >>> + return 0;
> >>> + }
> >>> return -EOPNOTSUPP;
> >>> }
>
> --
> Muhammad Usama Anjum
Powered by blists - more mailing lists