Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 02 Aug 2022 14:51:33 +0000
From:      bugzilla-noreply@freebsd.org
To:        net@FreeBSD.org
Subject:   [Bug 265064] connect(2): unexpected EADDRINUSE when connecting from IPv6 wildcard to IPv4 address
Message-ID:  <bug-265064-7501-Sa1UcY7Fqv@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-265064-7501@https.bugs.freebsd.org/bugzilla/>
References:  <bug-265064-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=3D265064

--- Comment #15 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=3D637f317c6d9c0c689677f499fc78ac545=
b192071

commit 637f317c6d9c0c689677f499fc78ac545b192071
Author:     Mike Karels <karels@FreeBSD.org>
AuthorDate: 2022-07-29 14:23:23 +0000
Commit:     Mike Karels <karels@FreeBSD.org>
CommitDate: 2022-08-02 14:49:46 +0000

    IPv6: fix problem with duplicate port assignment with v4-mapped addrs

    In in_pcb_lport_dest(), if an IPv6 socket does not match any other IPv6
    socket using in6_pcblookup_local(), and if the socket can also connect
    to IPv4 (the INP_IPV4 vflag is set), check for IPv4 matches as well.
    Otherwise, we can allocate a port that is used by an IPv4 socket
    (possibly one created from IPv6 via the same procedure), and then
    connect() can fail with EADDRINUSE, when it could have succeeded if
    the bound port was not in use.

    PR:             265064
    Submitted by:   firk at cantconnect.ru (with modifications)
    Reviewed by:    bz, melifaro
    Differential Revision: https://reviews.freebsd.org/D36012

 sys/netinet/in_pcb.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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