@ -56,6 +56,9 @@ unsigned int bootp_num_ids;
int BootpTry ;
ulong bootp_start ;
ulong bootp_timeout ;
char net_nis_domain [ 32 ] = { 0 , } ; /* Our NIS domain */
char net_hostname [ 32 ] = { 0 , } ; /* Our hostname */
char net_root_path [ 64 ] = { 0 , } ; /* Our bootpath */
# if defined(CONFIG_CMD_DHCP)
static dhcp_state_t dhcp_state = INIT ;
@ -220,11 +223,11 @@ static void BootpVendorFieldProcess(u8 *ext)
case 11 : /* RPL server - Not yet supported */
break ;
case 12 : /* Host name */
if ( NetOurHostN ame[ 0 ] = = 0 ) {
if ( net_hostn ame[ 0 ] = = 0 ) {
size = truncate_sz ( " Host Name " ,
sizeof ( NetOurHostN ame) , size ) ;
memcpy ( & NetOurHostN ame, ext + 2 , size ) ;
NetOurHostN ame[ size ] = 0 ;
sizeof ( net_hostn ame) , size ) ;
memcpy ( & net_hostn ame, ext + 2 , size ) ;
net_hostn ame[ size ] = 0 ;
}
break ;
case 13 : /* Boot file size */
@ -242,11 +245,11 @@ static void BootpVendorFieldProcess(u8 *ext)
case 16 : /* Swap server - Not yet supported */
break ;
case 17 : /* Root path */
if ( NetOurRootP ath[ 0 ] = = 0 ) {
if ( net_root_p ath[ 0 ] = = 0 ) {
size = truncate_sz ( " Root Path " ,
sizeof ( NetOurRootP ath) , size ) ;
memcpy ( & NetOurRootP ath, ext + 2 , size ) ;
NetOurRootP ath[ size ] = 0 ;
sizeof ( net_root_p ath) , size ) ;
memcpy ( & net_root_p ath, ext + 2 , size ) ;
net_root_p ath[ size ] = 0 ;
}
break ;
case 18 : /* Extension path - Not yet supported */
@ -258,11 +261,11 @@ static void BootpVendorFieldProcess(u8 *ext)
break ;
/* IP host layer fields */
case 40 : /* NIS Domain name */
if ( NetOurNISD omain[ 0 ] = = 0 ) {
if ( net_nis_d omain[ 0 ] = = 0 ) {
size = truncate_sz ( " NIS Domain Name " ,
sizeof ( NetOurNISD omain) , size ) ;
memcpy ( & NetOurNISD omain, ext + 2 , size ) ;
NetOurNISD omain[ size ] = 0 ;
sizeof ( net_nis_d omain) , size ) ;
memcpy ( & net_nis_d omain, ext + 2 , size ) ;
net_nis_d omain[ size ] = 0 ;
}
break ;
# if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER)
@ -310,14 +313,14 @@ static void BootpVendorProcess(u8 *ext, int size)
debug ( " net_boot_file_expected_size_in_blocks : %d \n " ,
net_boot_file_expected_size_in_blocks ) ;
if ( NetOurHostN ame[ 0 ] )
debug ( " NetOurHostN ame : %s\n " , NetOurHostN ame) ;
if ( net_hostn ame[ 0 ] )
debug ( " net_hostn ame : %s\n " , net_hostn ame) ;
if ( NetOurRootP ath[ 0 ] )
debug ( " NetOurRootP ath : %s\n " , NetOurRootP ath) ;
if ( net_root_p ath[ 0 ] )
debug ( " net_root_p ath : %s\n " , net_root_p ath) ;
if ( NetOurNISD omain[ 0 ] )
debug ( " NetOurNISD omain : %s\n " , NetOurNISD omain) ;
if ( net_nis_d omain[ 0 ] )
debug ( " net_nis_d omain : %s\n " , net_nis_d omain) ;
# if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER)
if ( net_ntp_server )
@ -793,17 +796,17 @@ static void DhcpOptionsProcess(uchar *popt, struct Bootp_t *bp)
break ;
case 12 :
size = truncate_sz ( " Host Name " ,
sizeof ( NetOurHostN ame) , oplen ) ;
memcpy ( & NetOurHostN ame, popt + 2 , size ) ;
NetOurHostN ame[ size ] = 0 ;
sizeof ( net_hostn ame) , oplen ) ;
memcpy ( & net_hostn ame, popt + 2 , size ) ;
net_hostn ame[ size ] = 0 ;
break ;
case 15 : /* Ignore Domain Name Option */
break ;
case 17 :
size = truncate_sz ( " Root Path " ,
sizeof ( NetOurRootP ath) , oplen ) ;
memcpy ( & NetOurRootP ath, popt + 2 , size ) ;
NetOurRootP ath[ size ] = 0 ;
sizeof ( net_root_p ath) , oplen ) ;
memcpy ( & net_root_p ath, popt + 2 , size ) ;
net_root_p ath[ size ] = 0 ;
break ;
case 28 : /* Ignore Broadcast Address Option */
break ;