From d8260b4e638b84b48892e87b3ce10321a18775e0 Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Wed, 16 Apr 2014 00:24:13 -0400 Subject: [PATCH] Print an error message when bind() fails when creating a UDP socket in sockd. --- src/sockd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sockd.c b/src/sockd.c index 0f2413d..fe7f8a5 100644 --- a/src/sockd.c +++ b/src/sockd.c @@ -194,8 +194,11 @@ static int create_udp_socket(uint32_t ip, uint16_t port, char *iface) .sin_port = htons(port), .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; + } return fd; out_fd: