aboutsummaryrefslogtreecommitdiff
path: root/networking/udhcp/packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/packet.c')
-rw-r--r--networking/udhcp/packet.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
index 32b489476..a3c7ae153 100644
--- a/networking/udhcp/packet.c
+++ b/networking/udhcp/packet.c
@@ -69,7 +69,7 @@ int get_packet(struct dhcpMessage *packet, int fd)
69 69
70 if (packet->op == BOOTREQUEST && (vendor = get_option(packet, DHCP_VENDOR))) { 70 if (packet->op == BOOTREQUEST && (vendor = get_option(packet, DHCP_VENDOR))) {
71 for (i = 0; broken_vendors[i][0]; i++) { 71 for (i = 0; broken_vendors[i][0]; i++) {
72 if (vendor[OPT_LEN - 2] == (unsigned char) strlen(broken_vendors[i]) && 72 if (vendor[OPT_LEN - 2] == (uint8_t) strlen(broken_vendors[i]) &&
73 !strncmp(vendor, broken_vendors[i], vendor[OPT_LEN - 2])) { 73 !strncmp(vendor, broken_vendors[i], vendor[OPT_LEN - 2])) {
74 DEBUG(LOG_INFO, "broken client (%s), forcing broadcast", 74 DEBUG(LOG_INFO, "broken client (%s), forcing broadcast",
75 broken_vendors[i]); 75 broken_vendors[i]);
@@ -83,13 +83,13 @@ int get_packet(struct dhcpMessage *packet, int fd)
83} 83}
84 84
85 85
86u_int16_t checksum(void *addr, int count) 86uint16_t checksum(void *addr, int count)
87{ 87{
88 /* Compute Internet Checksum for "count" bytes 88 /* Compute Internet Checksum for "count" bytes
89 * beginning at location "addr". 89 * beginning at location "addr".
90 */ 90 */
91 register int32_t sum = 0; 91 register int32_t sum = 0;
92 u_int16_t *source = (u_int16_t *) addr; 92 uint16_t *source = (uint16_t *) addr;
93 93
94 while (count > 1) { 94 while (count > 1) {
95 /* This is the inner loop */ 95 /* This is the inner loop */
@@ -101,8 +101,8 @@ u_int16_t checksum(void *addr, int count)
101 if (count > 0) { 101 if (count > 0) {
102 /* Make sure that the left-over byte is added correctly both 102 /* Make sure that the left-over byte is added correctly both
103 * with little and big endian hosts */ 103 * with little and big endian hosts */
104 u_int16_t tmp = 0; 104 uint16_t tmp = 0;
105 *(unsigned char *) (&tmp) = * (unsigned char *) source; 105 *(uint8_t *) (&tmp) = * (uint8_t *) source;
106 sum += tmp; 106 sum += tmp;
107 } 107 }
108 /* Fold 32-bit sum to 16 bits */ 108 /* Fold 32-bit sum to 16 bits */
@@ -114,8 +114,8 @@ u_int16_t checksum(void *addr, int count)
114 114
115 115
116/* Constuct a ip/udp header for a packet, and specify the source and dest hardware address */ 116/* Constuct a ip/udp header for a packet, and specify the source and dest hardware address */
117int raw_packet(struct dhcpMessage *payload, u_int32_t source_ip, int source_port, 117int raw_packet(struct dhcpMessage *payload, uint32_t source_ip, int source_port,
118 u_int32_t dest_ip, int dest_port, unsigned char *dest_arp, int ifindex) 118 uint32_t dest_ip, int dest_port, uint8_t *dest_arp, int ifindex)
119{ 119{
120 int fd; 120 int fd;
121 int result; 121 int result;
@@ -167,8 +167,8 @@ int raw_packet(struct dhcpMessage *payload, u_int32_t source_ip, int source_port
167 167
168 168
169/* Let the kernel do all the work for packet generation */ 169/* Let the kernel do all the work for packet generation */
170int kernel_packet(struct dhcpMessage *payload, u_int32_t source_ip, int source_port, 170int kernel_packet(struct dhcpMessage *payload, uint32_t source_ip, int source_port,
171 u_int32_t dest_ip, int dest_port) 171 uint32_t dest_ip, int dest_port)
172{ 172{
173 int n = 1; 173 int n = 1;
174 int fd, result; 174 int fd, result;