]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Only open the IP UDP port if we have added the address
authorRoy Marples <roy@marples.name>
Fri, 17 Oct 2014 16:44:55 +0000 (16:44 +0000)
committerRoy Marples <roy@marples.name>
Fri, 17 Oct 2014 16:44:55 +0000 (16:44 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index ea7c159a0581bedebeaa900e55d82c63200069b3..1e1cd66bc04c808f88f7af5cb95efd88bbf57a2e 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -1601,7 +1601,7 @@ send_message(struct interface *iface, uint8_t type,
        if (dhcp_open(iface) == -1)
                return;
 
-       if (state->addr.s_addr != INADDR_ANY &&
+       if (state->added && state->addr.s_addr != INADDR_ANY &&
            state->new != NULL &&
            (state->new->cookie == htonl(MAGIC_COOKIE) ||
            iface->options->options & DHCPCD_INFORM))