All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, pabeni@redhat.com,
	joannelkoong@gmail.com
Subject: Re: [PULL] Networking for next-6.1
Date: Fri, 16 Dec 2022 11:49:01 +0100	[thread overview]
Message-ID: <6b971a4e-c7d8-411e-1f92-fda29b5b2fb9@kernel.org> (raw)
In-Reply-To: <20221004052000.2645894-1-kuba@kernel.org>

Hi,

On 04. 10. 22, 7:20, Jakub Kicinski wrote:
> Joanne Koong (7):

>        net: Add a bhash2 table hashed by port and address

This makes regression tests of python-ephemeral-port-reserve to fail.

I'm not sure if the issue is in the commit or in the test.

This C reproducer used to fail with 6.0, now it succeeds:
#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#include <sys/socket.h>

#include <arpa/inet.h>
#include <netinet/ip.h>

int main()
{
         int x;
         int s1 = socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_IP);
         if (s1 < 0)
                 err(1, "sock1");
         x = 1;
         if (setsockopt(s1, SOL_SOCKET, SO_REUSEADDR, &x, sizeof(x)))
                 err(1, "setsockopt1");

         struct sockaddr_in in = {
                 .sin_family = AF_INET,
                 .sin_port = INADDR_ANY,
                 .sin_addr = { htonl(INADDR_LOOPBACK) },
         };
         if (bind(s1, (const struct sockaddr *)&in, sizeof(in)) < 0)
                 err(1, "bind1");

         if (listen(s1, 1) < 0)
                 err(1, "listen1");

         socklen_t inl = sizeof(in);
         if (getsockname(s1, (struct sockaddr *)&in, &inl) < 0)
                 err(1, "getsockname1");

         int s2 = socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_IP);
         if (s1 < 0)
                 err(1, "sock2");

         if (connect(s2, (struct sockaddr *)&in, inl) < 0)
                 err(1, "conn2");

         struct sockaddr_in acc;
         inl = sizeof(acc);
         int fdX = accept(s1, (struct sockaddr *)&acc, &inl);
         if (fdX < 0)
                 err(1, "accept");

         close(fdX);
         close(s2);
         close(s1);

         int s3 = socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_IP);
         if (s3 < 0)
                 err(1, "sock3");

         if (bind(s3, (struct sockaddr *)&in, sizeof(in)) < 0)
                 err(1, "bind3");

         close(s3);

         return 0;
}



thanks,
-- 
js
suse labs


  parent reply	other threads:[~2022-12-16 10:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04  5:20 [PULL] Networking for next-6.1 Jakub Kicinski
2022-10-04 21:40 ` pr-tracker-bot
2022-12-16 10:49 ` Jiri Slaby [this message]
2022-12-18 23:25   ` Kuniyuki Iwashima
2022-12-20  6:22     ` Jiri Slaby
2022-12-20  6:28       ` Kuniyuki Iwashima
2022-12-21 11:30   ` [PULL] Networking for next-6.1 #forregzbot Thorsten Leemhuis
2022-12-22 12:20     ` Thorsten Leemhuis
2023-01-30 15:19       ` Linux kernel regression tracking (#update)

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=6b971a4e-c7d8-411e-1f92-fda29b5b2fb9@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=davem@davemloft.net \
    --cc=joannelkoong@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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.