From 0d545ed7287026584722a3f9aa855c29bd24d59f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 15 Feb 2017 11:37:57 +0100 Subject: [PATCH] Set errno when refusing to send packet in interface_send_packet MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Callers of interface_send_packet use perror and so expect errno to be set in case of fail. Signed-off-by: Rafał Miłecki --- interface.c | 1 + 1 file changed, 1 insertion(+) diff --git a/interface.c b/interface.c index ada8acb..f9fe40a 100644 --- a/interface.c +++ b/interface.c @@ -125,6 +125,7 @@ interface_send_packet(struct interface *iface, struct sockaddr *to, struct iovec { if (!iface->multicast && !to) { fprintf(stderr, "No IP address specified for unicast interface\n"); + errno = EINVAL; return -1; } -- 2.25.1