gcc-9.x warning fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@ -164,14 +164,14 @@ int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet *dhcp_pkt,
|
||||
packet.udp.len = htons(UDP_DHCP_SIZE - padding);
|
||||
/* for UDP checksumming, ip.len is set to UDP packet len */
|
||||
packet.ip.tot_len = packet.udp.len;
|
||||
packet.udp.check = inet_cksum((uint16_t *)&packet,
|
||||
packet.udp.check = inet_cksum(&packet,
|
||||
IP_UDP_DHCP_SIZE - padding);
|
||||
/* but for sending, it is set to IP packet len */
|
||||
packet.ip.tot_len = htons(IP_UDP_DHCP_SIZE - padding);
|
||||
packet.ip.ihl = sizeof(packet.ip) >> 2;
|
||||
packet.ip.version = IPVERSION;
|
||||
packet.ip.ttl = IPDEFTTL;
|
||||
packet.ip.check = inet_cksum((uint16_t *)&packet.ip, sizeof(packet.ip));
|
||||
packet.ip.check = inet_cksum(&packet.ip, sizeof(packet.ip));
|
||||
|
||||
udhcp_dump_packet(dhcp_pkt);
|
||||
result = sendto(fd, &packet, IP_UDP_DHCP_SIZE - padding, /*flags:*/ 0,
|
||||
|
Reference in New Issue
Block a user