]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix a constant expression result.
authorRoy Marples <roy@marples.name>
Tue, 3 May 2016 12:34:34 +0000 (12:34 +0000)
committerRoy Marples <roy@marples.name>
Tue, 3 May 2016 12:34:34 +0000 (12:34 +0000)
dhcpcd.h
if-linux.c

index 08c7723b5c292ed435826ecd58ac4629bf4b435c..a5b8cf45b088c2aec4e18fa57aa230c4310b5440 100644 (file)
--- 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;
index 3f526f3e22effb2d5792fd25371916710d7ede76..3898635f6a957f597967fb026b01ba485926f67b 100644 (file)
@@ -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));