All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	David Ahern <dsahern@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Gabriel Krisman Bertazi <krisman@collabora.com>,
	open list <linux-kernel@vger.kernel.org>,
	Collabora Kernel ML <kernel@collabora.com>,
	Paul Gofman <pgofman@codeweavers.com>,
	"open list:NETWORKING [TCP]" <netdev@vger.kernel.org>,
	Sami Farin <hvtaifwkbgefbaei@gmail.com>
Subject: Re: [RFC] EADDRINUSE from bind() on application restart after killing
Date: Mon, 27 Jun 2022 13:47:25 +0200	[thread overview]
Message-ID: <CANn89iK96naKmc5Ep1PBxvksShQk=WMEoY_V0qZneN_JAEgtRg@mail.gmail.com> (raw)
In-Reply-To: <63316ba7-f612-af5a-3f33-125cf89de754@collabora.com>

On Mon, Jun 27, 2022 at 12:20 PM Muhammad Usama Anjum
<usama.anjum@collabora.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@collabora.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

  reply	other threads:[~2022-06-27 12:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24  8:18 [RFC] EADDRINUSE from bind() on application restart after killing Muhammad Usama Anjum
2022-05-24 22:13 ` Eric Dumazet
2022-05-30 13:15   ` Muhammad Usama Anjum
2022-05-30 15:28     ` Eric Dumazet
2022-06-27 10:20       ` Muhammad Usama Anjum
2022-06-27 11:47         ` Eric Dumazet [this message]
2022-09-30 13:24 ` Muhammad Usama Anjum
2022-09-30 15:16   ` Eric Dumazet
2022-10-14 15:52     ` Paul Gofman
2022-10-14 16:20       ` Eric Dumazet
2022-10-14 16:31         ` Paul Gofman
2022-10-14 16:34           ` Eric Dumazet
2022-10-14 16:39             ` Paul Gofman
2022-10-14 16:45               ` Eric Dumazet
2022-10-14 17:20                 ` Paul Gofman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANn89iK96naKmc5Ep1PBxvksShQk=WMEoY_V0qZneN_JAEgtRg@mail.gmail.com' \
    --to=edumazet@google.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=hvtaifwkbgefbaei@gmail.com \
    --cc=kernel@collabora.com \
    --cc=krisman@collabora.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pgofman@codeweavers.com \
    --cc=usama.anjum@collabora.com \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.