]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Default all int entries in the dhcp header to unsigned.
authorRoy Marples <roy@marples.name>
Wed, 9 Jan 2008 10:12:59 +0000 (10:12 +0000)
committerRoy Marples <roy@marples.name>
Wed, 9 Jan 2008 10:12:59 +0000 (10:12 +0000)
client.c
dhcp.c
dhcp.h

index 914f4e06ffb6c17191d368a80fd479e3cc65b826..7e382904f9f1b1864844dc5d8d30c4700d882396 100644 (file)
--- a/client.c
+++ b/client.c
@@ -247,7 +247,7 @@ int dhcp_run (const options_t *options, int *pidfd)
        int mode = SOCKET_CLOSED;
        int state = STATE_INIT;
        struct timeval tv;
-       int xid = 0;
+       uint32_t xid = 0;
        long timeout = 0;
        fd_set rset;
        int maxfd;
diff --git a/dhcp.c b/dhcp.c
index 13f6020091e27d54dabbdf30c6a85ab7dfa3a02c..847a069116902bd89b34dd719e6f0eb36ea30014 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -124,7 +124,7 @@ size_t send_message (const interface_t *iface, const dhcp_t *dhcp,
                case ARPHRD_IEEE1394:
                case ARPHRD_INFINIBAND:
                        if (message->ciaddr == 0)
-                               message->flags = (int16_t) htons (BROADCAST_FLAG);
+                               message->flags = htons (BROADCAST_FLAG);
                        message->hwlen = 0;
                        break;
                default:
diff --git a/dhcp.h b/dhcp.h
index 2987fc64fabcfd475e44a4276d77ae641020ba7d..1a7de8920a3f622db5598de09cd86b42a7e06f8d 100644 (file)
--- a/dhcp.h
+++ b/dhcp.h
@@ -189,13 +189,13 @@ typedef struct dhcpmessage_t
        unsigned char hwtype;       /* hardware address type */
        unsigned char hwlen;        /* hardware address length */
        unsigned char hwopcount;        /* should be zero in client message */
-       int32_t xid;            /* transaction id */
-       int16_t secs;           /* elapsed time in sec. from boot */
-       int16_t flags;
-       int32_t ciaddr;         /* (previously allocated) client IP */
-       int32_t yiaddr;         /* 'your' client IP address */
-       int32_t siaddr;         /* should be zero in client's messages */
-       int32_t giaddr;         /* should be zero in client's messages */
+       uint32_t xid;            /* transaction id */
+       uint16_t secs;           /* elapsed time in sec. from boot */
+       uint16_t flags;
+       uint32_t ciaddr;         /* (previously allocated) client IP */
+       uint32_t yiaddr;         /* 'your' client IP address */
+       uint32_t siaddr;         /* should be zero in client's messages */
+       uint32_t giaddr;         /* should be zero in client's messages */
        unsigned char chaddr[DHCP_CHADDR_LEN];  /* client's hardware address */
        unsigned char servername[SERVERNAME_LEN];    /* server host name */
        unsigned char bootfile[BOOTFILE_LEN];    /* boot file name */