]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
When sending to an address, ensure we have a socket.
authorRoy Marples <roy@marples.name>
Sat, 4 Jul 2015 12:13:53 +0000 (12:13 +0000)
committerRoy Marples <roy@marples.name>
Sat, 4 Jul 2015 12:13:53 +0000 (12:13 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index f9fb4643787ccf901227ef8f9a9fb58f39dd5fd9..df0212b1892e00e8c467d0883fdeb6c07007dddc 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -1681,7 +1681,7 @@ send_message(struct interface *ifp, uint8_t type,
                goto fail;
        len = (size_t)r;
        from.s_addr = dhcp->ciaddr;
-       if (from.s_addr)
+       if (s != -1 && from.s_addr != INADDR_ANY)
                to.s_addr = state->lease.server.s_addr;
        else
                to.s_addr = INADDR_ANY;