summaryrefslogtreecommitdiffstats
path: root/net/bootp.c
diff options
context:
space:
mode:
authorAndre Renaud <andre@designa-electronics.com>2016-05-05 07:28:08 -0600
committerAndreas Bießmann <andreas@biessmann.org>2016-06-12 23:49:38 +0200
commit166c409bc42627d9e19517f6ce121c39d0f52b65 (patch)
treec923a685fa1ed7c545ab028dba8bb7839d8cb8be /net/bootp.c
parentb4d956f6bc0fe6ff9a5776cbce0fe97a344737a3 (diff)
downloadblackbird-obmc-uboot-166c409bc42627d9e19517f6ce121c39d0f52b65.tar.gz
blackbird-obmc-uboot-166c409bc42627d9e19517f6ce121c39d0f52b65.zip
net: Handle an empty bootp extension section
Avoid generating this section if there is nothing in it. Signed-off-by: Andre Renaud <andre@designa-electronics.com> Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'net/bootp.c')
-rw-r--r--net/bootp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/bootp.c b/net/bootp.c
index aa6cdf0a47..42e14eda41 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -673,6 +673,15 @@ static int bootp_extended(u8 *e)
*e++ = 255; /* End of the list */
+ /*
+ * If nothing in list, remove it altogether. Some DHCP servers get
+ * upset by this minor faux pas and do not respond at all.
+ */
+ if (e == start + 3) {
+ printf("*** Warning: no DHCP options requested\n");
+ e -= 3;
+ }
+
return e - start;
}
#endif
OpenPOWER on IntegriCloud