Mercurial > hg > dhcpcd
changeset 4940:a0d2d9dd08f3 draft
DHCP: Fix a bogus gcc warning
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Sat, 04 Jan 2020 07:44:10 +0000 |
| parents | b82b1e772a3d |
| children | 384a97a92e86 |
| files | src/dhcp.c |
| diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/dhcp.c Wed Jan 08 00:13:44 2020 +0000 +++ b/src/dhcp.c Sat Jan 04 07:44:10 2020 +0000 @@ -1714,7 +1714,7 @@ struct in_addr from, to; unsigned int RT; - if (!callback) { + if (callback == NULL) { /* No carrier? Don't bother sending the packet. */ if (ifp->carrier <= LINK_DOWN) return; @@ -1722,6 +1722,7 @@ ifp->name, ifo->options & DHCPCD_BOOTP ? "BOOTP" : get_dhcp_op(type), state->xid); + RT = 0; /* bogus gcc warning */ } else { if (state->interval == 0) state->interval = 4; @@ -1825,7 +1826,7 @@ fail: /* Even if we fail to send a packet we should continue as we are * as our failure timeouts will change out codepath when needed. */ - if (callback) + if (callback != NULL) eloop_timeout_add_msec(ifp->ctx->eloop, RT, callback, ifp); }
