From: Roy Marples Date: Wed, 9 Jan 2008 10:12:59 +0000 (+0000) Subject: Default all int entries in the dhcp header to unsigned. X-Git-Tag: v3.2.3~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cea28afc8608614ac7e6651f41941a5fe4ce732;p=thirdparty%2Fdhcpcd.git Default all int entries in the dhcp header to unsigned. --- diff --git a/client.c b/client.c index 914f4e06..7e382904 100644 --- 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 13f60200..847a0691 100644 --- 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 2987fc64..1a7de892 100644 --- 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 */