[Bug 210726] tcp connect() can return invalid EADDRINUSE (Eg: multiple jails with the same IP address)

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 05 Apr 2022 02:25:38 UTC

--- Comment #27 from firk@cantconnect.ru ---
Created attachment 232951
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=232951&action=edit
test program

Test program

First, reduce portrange to hit the problem faster:

sysctl net.inet.ip.portrange.first=10000
sysctl net.inet.ip.portrange.last=10004

cc -o test test.c

Open two screens, first:

./test 10


jail / x your.real.ip.address csh
cd /your/dir
./test 10

with unpatched system, second program will show (EADDRINUSE)
> connect() error 48 (Address already in use)
with patched, it will show the proper error (EADDRNOTAVAIL)
> bind() error 49 (Can't assign requested address)

You are receiving this mail because:
You are on the CC list for the bug.