aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTom Rini2012-10-04 12:00:42 -0500
committerTom Rini2012-10-04 12:00:42 -0500
commit198166877768cf4d0197289a524df8a6ca0e2f19 (patch)
treed8fb2afc6d5b09ceeb4e3e62dc20b64d167ab346 /net
parent73c15c634dda388e21eaf0ebc85e324872df0d25 (diff)
parent777544085d2b417a36df50eb564bf037a044e60e (diff)
downloadu-boot-198166877768cf4d0197289a524df8a6ca0e2f19.tar.gz
u-boot-198166877768cf4d0197289a524df8a6ca0e2f19.tar.xz
u-boot-198166877768cf4d0197289a524df8a6ca0e2f19.zip
Merge branch 'master' of git://git.denx.de/u-boot-arm
Diffstat (limited to 'net')
-rw-r--r--net/bootp.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/net/bootp.c b/net/bootp.c
index 661e371063..cd5c5dd1d7 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -341,6 +341,15 @@ BootpTimeout(void)
341 } 341 }
342} 342}
343 343
344#define put_vci(e, str) \
345 do { \
346 size_t vci_strlen = strlen(str); \
347 *e++ = 60; /* Vendor Class Identifier */ \
348 *e++ = vci_strlen; \
349 memcpy(e, str, vci_strlen); \
350 e += vci_strlen; \
351 } while (0)
352
344/* 353/*
345 * Initialize BOOTP extension fields in the request. 354 * Initialize BOOTP extension fields in the request.
346 */ 355 */
@@ -352,7 +361,6 @@ static int DhcpExtended(u8 *e, int message_type, IPaddr_t ServerID,
352 u8 *cnt; 361 u8 *cnt;
353#if defined(CONFIG_BOOTP_PXE) 362#if defined(CONFIG_BOOTP_PXE)
354 char *uuid; 363 char *uuid;
355 size_t vci_strlen;
356 u16 clientarch; 364 u16 clientarch;
357#endif 365#endif
358 366
@@ -437,12 +445,10 @@ static int DhcpExtended(u8 *e, int message_type, IPaddr_t ServerID,
437 printf("Invalid pxeuuid: %s\n", uuid); 445 printf("Invalid pxeuuid: %s\n", uuid);
438 } 446 }
439 } 447 }
448#endif
440 449
441 *e++ = 60; /* Vendor Class Identifier */ 450#ifdef CONFIG_BOOTP_VCI_STRING
442 vci_strlen = strlen(CONFIG_BOOTP_VCI_STRING); 451 put_vci(e, CONFIG_BOOTP_VCI_STRING);
443 *e++ = vci_strlen;
444 memcpy(e, CONFIG_BOOTP_VCI_STRING, vci_strlen);
445 e += vci_strlen;
446#endif 452#endif
447 453
448#if defined(CONFIG_BOOTP_VENDOREX) 454#if defined(CONFIG_BOOTP_VENDOREX)
@@ -529,6 +535,15 @@ static int BootpExtended(u8 *e)
529 *e++ = (576 - 312 + OPT_FIELD_SIZE) & 0xff; 535 *e++ = (576 - 312 + OPT_FIELD_SIZE) & 0xff;
530#endif 536#endif
531 537
538#if defined(CONFIG_BOOTP_VCI_STRING) || \
539 (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_NET_VCI_STRING))
540#ifdef CONFIG_SPL_BUILD
541 put_vci(e, CONFIG_SPL_NET_VCI_STRING);
542#else
543 put_vci(e, CONFIG_BOOTP_VCI_STRING);
544#endif
545#endif
546
532#if defined(CONFIG_BOOTP_SUBNETMASK) 547#if defined(CONFIG_BOOTP_SUBNETMASK)
533 *e++ = 1; /* Subnet mask request */ 548 *e++ = 1; /* Subnet mask request */
534 *e++ = 4; 549 *e++ = 4;