On line 357 in src/lib/libc/resolv/res_send.c,v 188.8.131.52.2.1
the code calls _getsockname(2) to see if the old peer is the same
as the new peer (the nameserver it plans to connect to).
This getsockname(2) call should however be getpeername(2), as that
is what gives the remote peeraddress.
replace the getsockname(2) call with getpeername(2).
How-To-Repeat: Not so easy as this bug does not cause a direct problem, but rather
a needless close(2), socket(2), and connect(3) for repeated i/o
with the same nameserver.
Unfortunatly it creates a more serious problem in a larger third-party
Bug still present in 10.1-release.
Hmm? It looks like SVN r270838, which is included in 10.1-RELEASE, changed getsockname to getpeername in that location.
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017
- Set Status to "Open"