From: Roy Marples Date: Tue, 3 May 2016 12:34:34 +0000 (+0000) Subject: Fix a constant expression result. X-Git-Tag: v6.11.0~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6b84d0e00a7ad6b46ef3159a2e5e225271e88ecb;p=thirdparty%2Fdhcpcd.git Fix a constant expression result. --- diff --git a/dhcpcd.h b/dhcpcd.h index 08c7723b..a5b8cf45 100644 --- a/dhcpcd.h +++ b/dhcpcd.h @@ -122,8 +122,8 @@ struct dhcpcd_ctx { #endif void *priv; int link_fd; - int seq; /* route message sequence no */ - int sseq; /* successful seq no sent */ + unsigned int seq; /* route message sequence no */ + unsigned int sseq; /* successful seq no sent */ #ifdef USE_SIGNALS sigset_t sigset; diff --git a/if-linux.c b/if-linux.c index 3f526f3e..3898635f 100644 --- a/if-linux.c +++ b/if-linux.c @@ -925,9 +925,9 @@ send_netlink(struct dhcpcd_ctx *ctx, struct interface *ifp, msg.msg_iovlen = 1; /* Request a reply */ hdr->nlmsg_flags |= NLM_F_ACK; - hdr->nlmsg_seq = (uint32_t)++ctx->seq; - if ((unsigned int)ctx->seq > UINT32_MAX) + if (++ctx->seq > UINT32_MAX) ctx->seq = 0; + hdr->nlmsg_seq = (uint32_t)ctx->seq; if (sendmsg(s, &msg, 0) != -1) { ctx->sseq = ctx->seq; r = get_netlink(ctx, ifp, s, 0, callback); @@ -1290,7 +1290,7 @@ if_sendrawpacket(const struct interface *ifp, uint16_t protocol, /* sockaddr_ll is not big enough for IPoIB which is why * sockaddr_storage is included in the union. * Ugly as sin, but it works. */ - /* coverity[buffer-size] */ + /* coverity[buffer_size] */ /* coverity[overrun-buffer-arg] */ memcpy(&su.sll.sll_addr, &ipv4_bcast_addr, sizeof(ipv4_bcast_addr));