]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix compile on Linux
authorRoy Marples <roy@marples.name>
Wed, 6 Jan 2016 12:59:38 +0000 (12:59 +0000)
committerRoy Marples <roy@marples.name>
Wed, 6 Jan 2016 12:59:38 +0000 (12:59 +0000)
if-linux.c

index 051449085a8f7bb8ba81b665327d606d1b26fb1c..874bea954660f5267813e664d0a0e60f12545bc6 100644 (file)
@@ -884,10 +884,12 @@ 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 = ++ctx->seq;
+       hdr->nlmsg_seq = (uint32_t)++ctx->seq;
+       if ((unsigned int)ctx->seq > UINT32_MAX)
+               ctx->seq = 0;
 
        if (sendmsg(s, &msg, 0) != -1) {
-               ctx->sseq = ctx-seq;
+               ctx->sseq = ctx->seq;
                r = get_netlink(ctx, ifp, s, 0, callback);
        } else
                r = -1;