Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Apr 2022 02:25:38 +0000
From:      bugzilla-noreply@freebsd.org
To:        net@FreeBSD.org
Subject:   [Bug 210726] tcp connect() can return invalid EADDRINUSE (Eg: multiple jails with the same IP address)
Message-ID:  <bug-210726-7501-KmpzcNDwVA@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-210726-7501@https.bugs.freebsd.org/bugzilla/>
References:  <bug-210726-7501@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D210726

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

Test program

First, reduce portrange to hit the problem faster:

sysctl net.inet.ip.portrange.first=3D10000
sysctl net.inet.ip.portrange.last=3D10004

Compile:
cc -o test test.c

Open two screens, first:

./test 10 1.2.3.4 0.0.0.0

Second:

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

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)

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-210726-7501-KmpzcNDwVA>