diff options
Diffstat (limited to 'net')
| -rw-r--r-- | net/bootp.c | 18 | ||||
| -rw-r--r-- | net/net.c | 13 | ||||
| -rw-r--r-- | net/nfs.c | 10 | ||||
| -rw-r--r-- | net/tftp.c | 10 | 
4 files changed, 14 insertions, 37 deletions
| diff --git a/net/bootp.c b/net/bootp.c index 83465e41a..d1cbd39c2 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); @@ -942,9 +936,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) { @@ -1461,9 +1461,7 @@ NetReceive(volatile uchar * inpkt, int len)  			case ICMP_REDIRECT:  				if (icmph->code != ICMP_REDIR_HOST)  					return; -				puts (" ICMP Host Redirect to "); -				print_IPaddr(icmph->un.gateway); -				putc(' '); +				printf (" ICMP Host Redirect to %pI4 ", &icmph->un.gateway);  				return;  #if defined(CONFIG_CMD_PING)  			case ICMP_ECHO_REPLY: @@ -1805,15 +1803,6 @@ ushort string_to_VLAN(char *s)  	return htons(id);  } -void print_IPaddr (IPaddr_t x) -{ -	char tmp[16]; - -	ip_to_string (x, tmp); - -	puts (tmp); -} -  IPaddr_t getenv_IPaddr (char *var)  {  	return (string_to_ip(getenv(var))); @@ -741,18 +741,16 @@ NfsStart (void)  	printf ("Using %s device\n", eth_get_name());  #endif -	puts ("File transfer via NFS from server "); print_IPaddr (NfsServerIP); -	puts ("; our IP address is ");		    print_IPaddr (NetOurIP); +	printf("File transfer via NFS from server %pI4" +		"; our IP address is %pI4", &NfsServerIP, &NetOurIP);  	/* Check if we need to send across this subnet */  	if (NetOurGatewayIP && NetOurSubnetMask) {  		IPaddr_t OurNet	    = NetOurIP	  & NetOurSubnetMask;  		IPaddr_t ServerNet  = NetServerIP & NetOurSubnetMask; -		if (OurNet != ServerNet) { -			puts ("; sending through gateway "); -			print_IPaddr (NetOurGatewayIP) ; -		} +		if (OurNet != ServerNet) +			printf("; sending through gateway %pI4", &NetOurGatewayIP);  	}  	printf ("\nFilename '%s/%s'.", nfs_path, nfs_filename); diff --git a/net/tftp.c b/net/tftp.c index 3dac3d853..b0f1cca0b 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -508,18 +508,16 @@ TftpStart (void)  #if defined(CONFIG_NET_MULTI)  	printf ("Using %s device\n", eth_get_name());  #endif -	puts ("TFTP from server ");	print_IPaddr (TftpServerIP); -	puts ("; our IP address is ");	print_IPaddr (NetOurIP); +	printf("TFTP from server %pI4" +		"; our IP address is %pI4", &TftpServerIP, &NetOurIP);  	/* Check if we need to send across this subnet */  	if (NetOurGatewayIP && NetOurSubnetMask) {  	    IPaddr_t OurNet	= NetOurIP    & NetOurSubnetMask;  	    IPaddr_t ServerNet	= TftpServerIP & NetOurSubnetMask; -	    if (OurNet != ServerNet) { -		puts ("; sending through gateway "); -		print_IPaddr (NetOurGatewayIP) ; -	    } +	    if (OurNet != ServerNet) +		printf("; sending through gateway %pI4", &NetOurGatewayIP);  	}  	putc ('\n'); |