diff options
Diffstat (limited to 'net/bootp.c')
-rw-r--r-- | net/bootp.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/net/bootp.c b/net/bootp.c index 83465e4..3dea70aa 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -271,17 +271,11 @@ static void BootpVendorProcess (u8 * ext, int size) #ifdef DEBUG_BOOTP_EXT puts ("[BOOTP] Received fields: \n"); - if (NetOurSubnetMask) { - puts ("NetOurSubnetMask : "); - print_IPaddr (NetOurSubnetMask); - putc ('\n'); - } + if (NetOurSubnetMask) + printf ("NetOurSubnetMask : %pI4\n", &NetOurSubnetMask); - if (NetOurGatewayIP) { - puts ("NetOurGatewayIP : "); - print_IPaddr (NetOurGatewayIP); - putc ('\n'); - } + if (NetOurGatewayIP) + printf ("NetOurGatewayIP : %pI4", &NetOurGatewayIP); if (NetBootFileSize) { printf ("NetBootFileSize : %d\n", NetBootFileSize); @@ -579,21 +573,12 @@ BootpRequest (void) #ifdef CONFIG_BOOTP_RANDOM_DELAY /* Random BOOTP delay */ unsigned char bi_enetaddr[6]; int reg; - char *e,*s; - char tmp[64]; ulong tst1, tst2, sum, m_mask, m_value = 0; if (BootpTry ==0) { /* get our mac */ - reg = getenv_r ("ethaddr", tmp, sizeof(tmp)); - s = (reg > 0) ? tmp : NULL; + eth_getenv_enetaddr("ethaddr", bi_enetaddr); - for (reg=0; reg<6; ++reg) { - bi_enetaddr[reg] = s ? simple_strtoul(s, &e, 16) : 0; - if (s) { - s = (*e) ? e+1 : e; - } - } #ifdef DEBUG puts ("BootpRequest => Our Mac: "); for (reg=0; reg<6; reg++) { @@ -942,9 +927,7 @@ DhcpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len) DhcpOptionsProcess((u8 *)&bp->bp_vend[4], bp); BootpCopyNetParams(bp); /* Store net params from reply */ dhcp_state = BOUND; - puts ("DHCP client bound to address "); - print_IPaddr(NetOurIP); - putc ('\n'); + printf ("DHCP client bound to address %pI4\n", &NetOurIP); /* Obey the 'autoload' setting */ if ((s = getenv("autoload")) != NULL) { |