diff options
author | Ethan Sommer <e5ten.arch@gmail.com> | 2020-05-26 19:40:25 -0400 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-05-27 14:25:59 -0500 |
commit | 3c01911b0f85b6c70100b7f3e1e18ac7d28666c4 (patch) | |
tree | ce15b738118f41ba728a574d393662a65c61c872 /toys | |
parent | 2e1efcf186237b2078f966094d88e0623f4334f0 (diff) | |
download | toybox-3c01911b0f85b6c70100b7f3e1e18ac7d28666c4.tar.gz |
dhcpd: fix warnings
Add presumably intended conversion specifier for gconfig.valid_lifetime
as it is an argument to error_msg despite the format string having no
conversion specifiers.
Remove always true false inverse check for address of array
gstate.rcvd.rcvd_pkt6.transaction_id.
Diffstat (limited to 'toys')
-rw-r--r-- | toys/pending/dhcpd.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/toys/pending/dhcpd.c b/toys/pending/dhcpd.c index 5d143167..8c5ad3df 100644 --- a/toys/pending/dhcpd.c +++ b/toys/pending/dhcpd.c @@ -1287,7 +1287,7 @@ static uint32_t get_lease(uint32_t req_exp) req_exp > gconfig.valid_lifetime) { if ((gconfig.pref_lifetime > gconfig.valid_lifetime)) { error_msg("The valid lifetime must be greater than the preferred lifetime, \ - setting to valid lifetime", gconfig.valid_lifetime); + setting to valid lifetime %u", gconfig.valid_lifetime); return gconfig.valid_lifetime; } return gconfig.pref_lifetime; @@ -1748,8 +1748,7 @@ void dhcpd_main(void) dbg("no or bad message type option, ignoring packet.\n"); continue; } - if (!gstate.rcvd.rcvd_pkt6.transaction_id || - memcmp(gstate.rcvd.rcvd_pkt6.transaction_id, transactionid, 3)) { + if (memcmp(gstate.rcvd.rcvd_pkt6.transaction_id, transactionid, 3)) { dbg("no or bad transaction id, ignoring packet.\n"); continue; } |