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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
index 6d4375237..51374646d 100644
--- a/networking/udhcp/packet.c
+++ b/networking/udhcp/packet.c
@@ -164,14 +164,14 @@ int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet *dhcp_pkt,
164 packet.udp.len = htons(UDP_DHCP_SIZE - padding); 164 packet.udp.len = htons(UDP_DHCP_SIZE - padding);
165 /* for UDP checksumming, ip.len is set to UDP packet len */ 165 /* for UDP checksumming, ip.len is set to UDP packet len */
166 packet.ip.tot_len = packet.udp.len; 166 packet.ip.tot_len = packet.udp.len;
167 packet.udp.check = inet_cksum((uint16_t *)&packet, 167 packet.udp.check = inet_cksum(&packet,
168 IP_UDP_DHCP_SIZE - padding); 168 IP_UDP_DHCP_SIZE - padding);
169 /* but for sending, it is set to IP packet len */ 169 /* but for sending, it is set to IP packet len */
170 packet.ip.tot_len = htons(IP_UDP_DHCP_SIZE - padding); 170 packet.ip.tot_len = htons(IP_UDP_DHCP_SIZE - padding);
171 packet.ip.ihl = sizeof(packet.ip) >> 2; 171 packet.ip.ihl = sizeof(packet.ip) >> 2;
172 packet.ip.version = IPVERSION; 172 packet.ip.version = IPVERSION;
173 packet.ip.ttl = IPDEFTTL; 173 packet.ip.ttl = IPDEFTTL;
174 packet.ip.check = inet_cksum((uint16_t *)&packet.ip, sizeof(packet.ip)); 174 packet.ip.check = inet_cksum(&packet.ip, sizeof(packet.ip));
175 175
176 udhcp_dump_packet(dhcp_pkt); 176 udhcp_dump_packet(dhcp_pkt);
177 result = sendto(fd, &packet, IP_UDP_DHCP_SIZE - padding, /*flags:*/ 0, 177 result = sendto(fd, &packet, IP_UDP_DHCP_SIZE - padding, /*flags:*/ 0,