Set errno when refusing to send packet in interface_send_packet
authorRafał Miłecki <rafal@milecki.pl>
Wed, 15 Feb 2017 10:37:57 +0000 (11:37 +0100)
committerRafał Miłecki <rafal@milecki.pl>
Wed, 15 Feb 2017 10:39:15 +0000 (11:39 +0100)
Callers of interface_send_packet use perror and so expect errno to be
set in case of fail.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
interface.c

index ada8acb1bf18769a470a497ef91e8b057753c327..f9fe40a5fc5d877f7851e29b48242667679fddc0 100644 (file)
@@ -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;
        }