X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=net%2Fbootp.c;h=4db63cbbe64c65dd6722d94b91b5e2fb9aeb863a;hb=bdb3c20386e0c3b80c1e5d2408ce567c1df1ca18;hp=e679f8b7f876e236bd7ec84b7218299c3bb82f57;hpb=f7767c7541a8cdae55655d10f039a5bc62894ee8;p=oweals%2Fu-boot.git diff --git a/net/bootp.c b/net/bootp.c index e679f8b7f8..4db63cbbe6 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -44,7 +44,8 @@ ulong seed1, seed2; dhcp_state_t dhcp_state = INIT; unsigned long dhcp_leasetime = 0; IPaddr_t NetDHCPServerIP = 0; -static void DhcpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len); +static void DhcpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, + unsigned len); /* For Debug */ #if 0 @@ -282,7 +283,8 @@ static void BootpVendorProcess (u8 * ext, int size) * Handle a BOOTP received packet. */ static void -BootpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len) +BootpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, + unsigned len) { Bootp_t *bp; char *s; @@ -456,11 +458,15 @@ static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t R *e++ = 42; *cnt += 1; #endif + /* no options, so back up to avoid sending an empty request list */ + if (*cnt == 0) + e -= 2; + *e++ = 255; /* End of the list */ /* Pad to minimal length */ #ifdef CONFIG_DHCP_MIN_EXT_LEN - while ((e - start) <= CONFIG_DHCP_MIN_EXT_LEN) + while ((e - start) < CONFIG_DHCP_MIN_EXT_LEN) *e++ = 0; #endif @@ -854,7 +860,8 @@ static void DhcpSendRequestPkt(Bootp_t *bp_offer) * Handle DHCP received packets. */ static void -DhcpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len) +DhcpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, + unsigned len) { Bootp_t *bp = (Bootp_t *)pkt;