svn commit: trunk/busybox/networking/udhcp
vda at busybox.net
vda at busybox.net
Fri Dec 21 08:32:48 PST 2007
Author: vda
Date: 2007-12-21 08:32:30 -0800 (Fri, 21 Dec 2007)
New Revision: 20660
Log:
udhcp: decided to not send "short" dhcp packets,
but lets add comments how to do it if needed.
Modified:
trunk/busybox/networking/udhcp/packet.c
Changeset:
Modified: trunk/busybox/networking/udhcp/packet.c
===================================================================
--- trunk/busybox/networking/udhcp/packet.c 2007-12-20 21:11:38 UTC (rev 20659)
+++ trunk/busybox/networking/udhcp/packet.c 2007-12-21 16:32:30 UTC (rev 20660)
@@ -122,7 +122,7 @@
}
-/* Construct a ip/udp header for a packet, and specify the source and dest hardware address */
+/* Construct a ip/udp header for a packet, send packet */
int udhcp_send_raw_packet(struct dhcpMessage *payload,
uint32_t source_ip, int source_port,
uint32_t dest_ip, int dest_port, const uint8_t *dest_arp, int ifindex)
@@ -175,6 +175,10 @@
packet.ip.ttl = IPDEFTTL;
packet.ip.check = udhcp_checksum(&packet.ip, sizeof(packet.ip));
+ /* Currently we send full-sized DHCP packets (zero padded).
+ * If you need to change this: last byte of the packet is
+ * packet.data.options[end_option(packet.data.options)]
+ */
result = sendto(fd, &packet, IP_UPD_DHCP_SIZE, 0, (struct sockaddr *) &dest, sizeof(dest));
if (result <= 0) {
bb_perror_msg("sendto");
@@ -222,6 +226,7 @@
return -1;
}
+ /* Currently we send full-sized DHCP packets (see above) */
result = write(fd, payload, DHCP_SIZE);
close(fd);
return result;
More information about the busybox-cvs
mailing list