Print an error message when bind() fails when creating a UDP socket in sockd.

This commit is contained in:
Nicholas J. Kain 2014-04-16 00:24:13 -04:00
parent 0884d96d1e
commit d8260b4e63

View File

@ -194,8 +194,11 @@ static int create_udp_socket(uint32_t ip, uint16_t port, char *iface)
.sin_port = htons(port), .sin_port = htons(port),
.sin_addr.s_addr = ip, .sin_addr.s_addr = ip,
}; };
if (bind(fd, (struct sockaddr *)&sa, sizeof sa) < 0) if (bind(fd, (struct sockaddr *)&sa, sizeof sa) < 0) {
log_error("%s: (%s) bind failed: %s",
client_config.interface, __func__, strerror(errno));
goto out_fd; goto out_fd;
}
return fd; return fd;
out_fd: out_fd: