chiark / gitweb /
util.c: Don't byte-swap IPv4 addresses, even if we don't have IPv6.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 28 Apr 2017 21:51:36 +0000 (22:51 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 18 May 2019 00:19:44 +0000 (01:19 +0100)
commit4bdeab805fcb0d8fe16af04eb40a6c046d97941c
treeb66bb26fe6602d98205d196ee6db30b2d04ad7ea
parent9c6a8729f6553615786878b382d4d44d2a54eec0
util.c: Don't byte-swap IPv4 addresses, even if we don't have IPv6.

The `string_item_to_ipaddr' function returns addresses as a single
integer in host byte order.  But this isn't what's wanted for setting up
`struct sockaddr_in', for example.  The function `adns_text2addr' does
the right thing.

I think this has always been wrong for setting up UDP sockets: before
the introduction of `string_item_to_iaddr', `udp_apply' would call
`string_item_to_ipaddr' directly, and neglected to swap the bytes.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
util.c