]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - net/sntp.c
net: Fix potential empty DHCP Parameter Request List
[people/ms/u-boot.git] / net / sntp.c
index 0a7f4782cbb5557cdd1ad225c6747725c3868f1f..76c10ecd3b5d4565c684d155659e5a2036636860 100644 (file)
 
 #include "sntp.h"
 
-#if (defined(CONFIG_CMD_NET) \
-    && defined(CONFIG_CMD_SNTP)
-
-#define SNTP_TIMEOUT 10
+#define SNTP_TIMEOUT 10000UL
 
 static int SntpOurPort;
 
@@ -26,7 +23,7 @@ SntpSend (void)
        int pktlen = SNTP_PACKET_LEN;
        int sport;
 
-       debug ("%s\n", __FUNCTION__);
+       debug("%s\n", __func__);
 
        memset (&pkt, 0, sizeof(pkt));
 
@@ -57,7 +54,7 @@ SntpHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len)
        struct rtc_time tm;
        ulong seconds;
 
-       debug ("%s\n", __FUNCTION__);
+       debug("%s\n", __func__);
 
        if (dest != SntpOurPort) return;
 
@@ -81,13 +78,11 @@ SntpHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len)
 void
 SntpStart (void)
 {
-       debug ("%s\n", __FUNCTION__);
+       debug("%s\n", __func__);
 
-       NetSetTimeout (SNTP_TIMEOUT * CFG_HZ, SntpTimeout);
+       NetSetTimeout (SNTP_TIMEOUT, SntpTimeout);
        NetSetHandler(SntpHandler);
        memset (NetServerEther, 0, 6);
 
        SntpSend ();
 }
-
-#endif