]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[dns] Pass a non-null peer socket address to xfer_open_socket() master
authorMichael Brown <mcb30@ipxe.org>
Tue, 21 Jul 2026 12:28:23 +0000 (13:28 +0100)
committerMichael Brown <mcb30@ipxe.org>
Tue, 21 Jul 2026 12:35:25 +0000 (13:35 +0100)
commitebca9ed2b2e62ee579100142ee61f5ba77a3c712
treea4e9bf378cc13b8ee7435528e053d99a63a96173
parentbb4b3b1c195e0f0ec63a716531ff7d7cbc326f13
[dns] Pass a non-null peer socket address to xfer_open_socket()

Commit 3662065 ("[dns] Use all configured DNS servers") changed the
logic from opening a single defined nameserver address to opening an
unspecified peer socket address and then specifying the full peer
address for each transmitted packet.

The peer socket address was left unspecified by passing a null pointer
to xfer_open_socket().  This is supported by the UDP socket opener,
but technically violates the internal API (which allows the local
socket address to be a null pointer, but not the peer socket address).
In particular, in a debug build using DEBUG=open, the debug code will
itself dereference the peer address pointer.

Fix by embedding the name server socket address within the DNS request
structure, and passing this to xfer_open_socket().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/udp/dns.c