Labels added to endifs to aid readability of the net/bootp.c file.
A block of code was marked for conditional compilation but the condition
could never arise, the ifdef\endif code block has been deleted.
Signed-off-by: Gray Remlin g_rem...@rocketmail.com
---
net/bootp.c | 93
++-
1 files changed, 41 insertions(+), 52 deletions(-)
diff --git a/net/bootp.c b/net/bootp.c
index e679f8b..45abb46 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -66,9 +66,9 @@ static char *dhcpmsg2str(int type)
#if defined(CONFIG_BOOTP_VENDOREX)
extern u8 *dhcp_vendorex_prep (u8 *e); /*rtn new e after add own opts. */
extern u8 *dhcp_vendorex_proc (u8 *e); /*rtn next e if mine,else NULL */
-#endif
+#endif /* CONFIG_BOOTP_VENDOREX */
-#endif
+#endif /* CONFIG_CMD_DHCP */
static int BootpCheckPkt(uchar *pkt, unsigned dest, unsigned src,
unsigned len)
{
@@ -112,7 +112,7 @@ static void BootpCopyNetParams(Bootp_t *bp)
if (tmp_ip != 0)
NetCopyIP(NetServerIP, bp-bp_siaddr);
memcpy (NetServerEther, ((Ethernet_t *)NetRxPacket)-et_src, 6);
-#endif
+#endif /* CONFIG_BOOTP_SERVERIP */
if (strlen(bp-bp_file) 0)
copy_filename (BootFile, bp-bp_file, sizeof(BootFile));
@@ -174,7 +174,7 @@ static void BootpVendorFieldProcess (u8 * ext)
if ((NetOurDNS2IP == 0) (size 4)) {
NetCopyIP (NetOurDNS2IP, (IPaddr_t *) (ext + 2
+ 4));
}
-#endif
+#endif /* CONFIG_BOOTP_DNS2 */
break;
case 7: /* Log server - Not yet supported
*/
break;
@@ -300,7 +300,7 @@ BootpHandler(uchar * pkt, unsigned dest, unsigned
src, unsigned len)
*/
#ifdef CONFIG_STATUS_LED
status_led_set (STATUS_LED_BOOT, STATUS_LED_OFF);
-#endif
+#endif /* CONFIG_STATUS_LED */
BootpCopyNetParams(bp); /* Store net parameters from
reply */
@@ -327,13 +327,13 @@ BootpHandler(uchar * pkt, unsigned dest, unsigned
src, unsigned len)
*/
NfsStart();
return;
-#endif
+#endif /* CONFIG_CMD_NFS */
}
}
TftpStart();
}
-#endif
+#endif /* CONFIG_CMD_DHCP */
/*
* Timeout on BOOTP/DHCP request.
@@ -361,10 +361,10 @@ static int DhcpExtended (u8 * e, int message_type,
IPaddr_t ServerID, IPaddr_t R
#if defined(CONFIG_BOOTP_VENDOREX)
u8 *x;
-#endif
+#endif /* CONFIG_BOOTP_VENDOREX */
#if defined(CONFIG_BOOTP_SEND_HOSTNAME)
char *hostname;
-#endif
+#endif /* CONFIG_BOOTP_SEND_HOSTNAME */
*e++ = 99; /* RFC1048 Magic Cookie */
*e++ = 130;
@@ -410,12 +410,12 @@ static int DhcpExtended (u8 * e, int message_type,
IPaddr_t ServerID, IPaddr_t R
memcpy (e, hostname, hostnamelen);
e += hostnamelen;
}
-#endif
+#endif /* CONFIG_BOOTP_SEND_HOSTNAME */
#if defined(CONFIG_BOOTP_VENDOREX)
if ((x = dhcp_vendorex_prep (e)))
return x - start;
-#endif
+#endif /* CONFIG_BOOTP_VENDOREX */
*e++ = 55; /* Parameter Request List */
cnt = e++; /* Pointer to count of requested items */
@@ -423,51 +423,51 @@ static int DhcpExtended (u8 * e, int message_type,
IPaddr_t ServerID, IPaddr_t R
#if defined(CONFIG_BOOTP_SUBNETMASK)
*e++ = 1; /* Subnet Mask */
*cnt += 1;
-#endif
+#endif /* CONFIG_BOOTP_SUBNETMASK */
#if defined(CONFIG_BOOTP_TIMEOFFSET)
*e++ = 2;
*cnt += 1;
-#endif
+#endif /* CONFIG_BOOTP_TIMEOFFSET */
#if defined(CONFIG_BOOTP_GATEWAY)
*e++ = 3; /* Router Option */
*cnt += 1;
-#endif
+#endif /* CONFIG_BOOTP_GATEWAY */
#if defined(CONFIG_BOOTP_DNS)
*e++ = 6; /* DNS Server(s) */
*cnt += 1;
-#endif
+#endif /* CONFIG_BOOTP_DNS */
#if defined(CONFIG_BOOTP_HOSTNAME)
*e++ = 12; /* Hostname */
*cnt += 1;
-#endif
+#endif /* CONFIG_BOOTP_HOSTNAME */
#if defined(CONFIG_BOOTP_BOOTFILESIZE)
*e++ = 13; /* Boot File Size */
*cnt += 1;
-#endif
+#endif /* CONFIG_BOOTP_BOOTFILESIZE */
#if defined(CONFIG_BOOTP_BOOTPATH)
*e++ = 17; /* Boot path */
*cnt += 1;
-#endif
+#endif /* CONFIG_BOOTP_BOOTPATH */
#if defined(CONFIG_BOOTP_NISDOMAIN)
*e++ = 40; /* NIS Domain name request */
*cnt += 1;
-#endif
+#endif /* CONFIG_BOOTP_NISDOMAIN */
#if defined(CONFIG_BOOTP_NTPSERVER)
*e++ = 42;
*cnt += 1;
-#endif
+#endif /* CONFIG_BOOTP_NTPSERVER */
*e++ = 255;/* End of the list */
/* Pad to minimal length */
#ifdef CONFIG_DHCP_MIN_EXT_LEN
while ((e - start) = CONFIG_DHCP_MIN_EXT_LEN)
*e++ = 0;
-#endif
+#endif /* CONFIG_DHCP_MIN_EXT_LEN */
return e - start;
}
-#else
+#else /* CONFIG_CMD_DHCP */
/*
* Warning: no