summaryrefslogtreecommitdiff
path: root/networking/udhcp/packet.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-09-26 23:45:20 +0000
committerDenis Vlasenko2008-09-26 23:45:20 +0000
commit739e30fbc3363756e574b5761ff63ea97ffd61c1 (patch)
treee2a42d90dcc984d6ad6dc1736d75095991a1ab09 /networking/udhcp/packet.c
parent7d9399e8dcfb9853f435c2936f449377d92f6e47 (diff)
downloadbusybox-739e30fbc3363756e574b5761ff63ea97ffd61c1.zip
busybox-739e30fbc3363756e574b5761ff63ea97ffd61c1.tar.gz
udhcp: add inline docs; small code shrink
function old new delta send_packet 103 87 -16 udhcpc_main 2359 2323 -36
Diffstat (limited to 'networking/udhcp/packet.c')
-rw-r--r--networking/udhcp/packet.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
index 4eedbb5..1a6f7e6 100644
--- a/networking/udhcp/packet.c
+++ b/networking/udhcp/packet.c
@@ -18,12 +18,12 @@
void FAST_FUNC udhcp_init_header(struct dhcpMessage *packet, char type)
{
memset(packet, 0, sizeof(struct dhcpMessage));
- packet->op = BOOTREQUEST;
+ packet->op = BOOTREQUEST; /* if client to a server */
switch (type) {
case DHCPOFFER:
case DHCPACK:
case DHCPNAK:
- packet->op = BOOTREPLY;
+ packet->op = BOOTREPLY; /* if server to client */
}
packet->htype = ETH_10MB;
packet->hlen = ETH_10MB_LEN;
@@ -65,7 +65,7 @@ int FAST_FUNC udhcp_recv_kernel_packet(struct dhcpMessage *packet, int fd)
if (vendor[OPT_LEN - 2] == (uint8_t)strlen(broken_vendors[i])
&& !strncmp((char*)vendor, broken_vendors[i], vendor[OPT_LEN - 2])
) {
- DEBUG("broken client (%s), forcing broadcast",
+ DEBUG("broken client (%s), forcing broadcast replies",
broken_vendors[i]);
packet->flags |= htons(BROADCAST_FLAG);
}
@@ -74,7 +74,7 @@ int FAST_FUNC udhcp_recv_kernel_packet(struct dhcpMessage *packet, int fd)
if (vendor[OPT_LEN - 2] == (uint8_t)(sizeof("MSFT 98")-1)
&& memcmp(vendor, "MSFT 98", sizeof("MSFT 98")-1) == 0
) {
- DEBUG("broken client (%s), forcing broadcast", "MSFT 98");
+ DEBUG("broken client (%s), forcing broadcast replies", "MSFT 98");
packet->flags |= htons(BROADCAST_FLAG);
}
#endif