From 656df7e2c9b688150ebe991d79a64ac096bb5f8e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 23 Oct 2014 23:50:45 +0100 Subject: [PATCH] string_item_to_iaddr: Actually set port if !CONFIG_IPV6 This bug was introduced along with this function in bb839899 `Provide string_item_to_iaddr', which simply forgot to set the port. The practical implications are that the port number of a locally bound socket would not be specified, if an address was supplied, but only in builds without IPv6 support. (This might result in the kernel picking a port nmber; if authbind is in use it would probably cause authbind to refuse.) Signed-off-by: Ian Jackson --- util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util.c b/util.c index 1d05822..d1621fc 100644 --- a/util.c +++ b/util.c @@ -526,6 +526,7 @@ void string_item_to_iaddr(const item_t *item, uint16_t port, union iaddr *ia, ia->sin.sin_family=AF_INET; ia->sin.sin_addr.s_addr=string_item_to_ipaddr(item,desc); + ia->sin.sin_port=htons(port); #else /* CONFIG_IPV6 => we have adns_text2addr */ -- 2.30.2