From: Roy Marples Date: Sat, 4 Jan 2020 07:44:10 +0000 (+0000) Subject: DHCP: Fix a bogus gcc warning X-Git-Tag: v9.0.0~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8678269923e12db121baa19905c688ef8f7e8a9a;p=thirdparty%2Fdhcpcd.git DHCP: Fix a bogus gcc warning --- diff --git a/src/dhcp.c b/src/dhcp.c index 36374c44..428259cf 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -1714,7 +1714,7 @@ send_message(struct interface *ifp, uint8_t type, 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 @@ send_message(struct interface *ifp, uint8_t type, 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 @@ out: 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); }