]> git.sur5r.net Git - u-boot/blobdiff - net/bootp.c
ColdFire 54455: Fix correct boot location for atmel and intel
[u-boot] / net / bootp.c
index ac9455e1ab495ccf1f4193810fc1afb595ad0d5d..749d3e5e0c24ce08fb3ea7f9ccc8726b56445ed8 100644 (file)
@@ -81,7 +81,7 @@ 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 /* CFG_CMD_DHCP */
+#endif
 
 static int BootpCheckPkt(uchar *pkt, unsigned dest, unsigned src, unsigned len)
 {
@@ -120,10 +120,12 @@ static void BootpCopyNetParams(Bootp_t *bp)
        IPaddr_t tmp_ip;
 
        NetCopyIP(&NetOurIP, &bp->bp_yiaddr);
+#if !defined(CONFIG_BOOTP_SERVERIP)
        NetCopyIP(&tmp_ip, &bp->bp_siaddr);
        if (tmp_ip != 0)
                NetCopyIP(&NetServerIP, &bp->bp_siaddr);
        memcpy (NetServerEther, ((Ethernet_t *)NetRxPkt)->et_src, 6);
+#endif
        if (strlen(bp->bp_file) > 0)
                copy_filename (BootFile, bp->bp_file, sizeof(BootFile));
 
@@ -357,7 +359,7 @@ BootpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
 
        TftpStart();
 }
-#endif /* !CFG_CMD_DHCP */
+#endif
 
 /*
  *     Timeout on BOOTP/DHCP request.
@@ -491,7 +493,7 @@ static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t R
        return e - start;
 }
 
-#else  /* CFG_CMD_DHCP */
+#else
 /*
  *     Warning: no field size check - change CONFIG_BOOTP_* at your own risk!
  */
@@ -513,7 +515,7 @@ static int BootpExtended (u8 * e)
        *e++ = 2;
        *e++ = (576 - 312 + OPT_SIZE) >> 16;
        *e++ = (576 - 312 + OPT_SIZE) & 0xff;
-#endif /* CFG_CMD_DHCP */
+#endif
 
 #if defined(CONFIG_BOOTP_SUBNETMASK)
        *e++ = 1;               /* Subnet mask request */
@@ -561,7 +563,7 @@ static int BootpExtended (u8 * e)
 
        return e - start;
 }
-#endif /* CFG_CMD_DHCP */
+#endif
 
 void
 BootpRequest (void)
@@ -682,7 +684,7 @@ BootpRequest (void)
        ext_len = DhcpExtended((u8 *)bp->bp_vend, DHCP_DISCOVER, 0, 0);
 #else
        ext_len = BootpExtended((u8 *)bp->bp_vend);
-#endif /* CFG_CMD_DHCP */
+#endif
 
        /*
         *      Bootp ID is the lower 4 bytes of our ethernet address
@@ -710,7 +712,7 @@ BootpRequest (void)
        NetSetHandler(DhcpHandler);
 #else
        NetSetHandler(BootpHandler);
-#endif /* CFG_CMD_DHCP */
+#endif
        NetSendPacket(NetTxPacket, pktlen);
 }
 
@@ -728,7 +730,7 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
                        break;
 #if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET)
                case 2:         /* Time offset  */
-                       NetCopyLong (&NetTimeOffset, (ulong *) (popt + 2));
+                       NetCopyLong ((ulong *)&NetTimeOffset, (ulong *) (popt + 2));
                        NetTimeOffset = ntohl (NetTimeOffset);
                        break;
 #endif
@@ -975,6 +977,6 @@ void DhcpRequest(void)
 {
        BootpRequest();
 }
-#endif /* CFG_CMD_DHCP */
+#endif
 
-#endif /* CFG_CMD_NET */
+#endif