Skip to content

Commit bbd95bf

Browse files
committed
Add a verbose log message if socket creation fails in cf-serverd
It's only an error if all socket creations or binding attempts fail and there already is a log message for this case (see 5e1e7e5f74a0). But for debugging purposes or for customers to be able to see what's going on, we should have more detailed logging. Ticket: ENT-7362 Changelog: None
1 parent 4d67db3 commit bbd95bf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

libcfnet/server_code.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,20 @@ static int OpenReceiverChannel(char *bind_address)
169169
sd = socket(ap->ai_family, ap->ai_socktype, ap->ai_protocol);
170170
if (sd == -1)
171171
{
172+
if (ap->ai_family == AF_INET)
173+
{
174+
Log(LOG_LEVEL_VERBOSE, "Failed to create socket for binding to an IPV4 interface");
175+
}
176+
else if (ap->ai_family == AF_INET6)
177+
{
178+
Log(LOG_LEVEL_VERBOSE, "Failed to create socket for binding to an IPV6 interface");
179+
}
180+
else
181+
{
182+
Log(LOG_LEVEL_VERBOSE,
183+
"Failed to create socket for binding to an interface of ai_family %d",
184+
ap->ai_family);
185+
}
172186
continue;
173187
}
174188

0 commit comments

Comments
 (0)