mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 01:32:08 +00:00
dhcp: typo fix: UPD_DHCP_SIZE -> UDP_DHCP_SIZE
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
parent
c59e06e471
commit
2c3b71a0d2
@ -63,14 +63,14 @@ struct udp_dhcp_packet {
|
||||
} PACKED;
|
||||
|
||||
enum {
|
||||
IP_UPD_DHCP_SIZE = sizeof(struct ip_udp_dhcp_packet) - CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS,
|
||||
UPD_DHCP_SIZE = sizeof(struct udp_dhcp_packet) - CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS,
|
||||
IP_UDP_DHCP_SIZE = sizeof(struct ip_udp_dhcp_packet) - CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS,
|
||||
UDP_DHCP_SIZE = sizeof(struct udp_dhcp_packet) - CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS,
|
||||
DHCP_SIZE = sizeof(struct dhcp_packet) - CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS,
|
||||
};
|
||||
|
||||
/* Let's see whether compiler understood us right */
|
||||
struct BUG_bad_sizeof_struct_ip_udp_dhcp_packet {
|
||||
char c[IP_UPD_DHCP_SIZE == 576 ? 1 : -1];
|
||||
char c[IP_UDP_DHCP_SIZE == 576 ? 1 : -1];
|
||||
};
|
||||
|
||||
|
||||
|
@ -216,19 +216,19 @@ int FAST_FUNC udhcp_send_raw_packet(struct dhcp_packet *dhcp_pkt,
|
||||
packet.udp.source = htons(source_port);
|
||||
packet.udp.dest = htons(dest_port);
|
||||
/* size, excluding IP header: */
|
||||
packet.udp.len = htons(UPD_DHCP_SIZE - padding);
|
||||
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 = udhcp_checksum(&packet, IP_UPD_DHCP_SIZE - padding);
|
||||
packet.udp.check = udhcp_checksum(&packet, IP_UDP_DHCP_SIZE - padding);
|
||||
/* but for sending, it is set to IP packet len */
|
||||
packet.ip.tot_len = htons(IP_UPD_DHCP_SIZE - padding);
|
||||
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 = udhcp_checksum(&packet.ip, sizeof(packet.ip));
|
||||
|
||||
udhcp_dump_packet(dhcp_pkt);
|
||||
result = sendto(fd, &packet, IP_UPD_DHCP_SIZE - padding, /*flags:*/ 0,
|
||||
result = sendto(fd, &packet, IP_UDP_DHCP_SIZE - padding, /*flags:*/ 0,
|
||||
(struct sockaddr *) &dest_sll, sizeof(dest_sll));
|
||||
msg = "sendto";
|
||||
ret_close:
|
||||
|
Loading…
Reference in New Issue
Block a user