diff options
author | wollman <wollman@FreeBSD.org> | 1995-03-16 17:32:27 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1995-03-16 17:32:27 +0000 |
commit | 8882d76eda0f65db86b70a8641d460198eb851a8 (patch) | |
tree | 5c2d441929d3849ef1585bf6a45ffbf8efc7b3b3 /sys/netinet/if_ether.c | |
parent | 9c613cfeaeb4019f90ec8d3ffdfc4142386b7463 (diff) | |
download | FreeBSD-src-8882d76eda0f65db86b70a8641d460198eb851a8.zip FreeBSD-src-8882d76eda0f65db86b70a8641d460198eb851a8.tar.gz |
Add inet_ntoa() and replace ARP's private routine with same.
Diffstat (limited to 'sys/netinet/if_ether.c')
-rw-r--r-- | sys/netinet/if_ether.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 1de191a..9517a3c 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)if_ether.c 8.1 (Berkeley) 6/10/93 - * $Id: if_ether.c,v 1.10 1994/12/22 22:00:29 wollman Exp $ + * $Id: if_ether.c,v 1.11 1995/02/20 15:48:40 davidg Exp $ */ /* @@ -97,24 +97,6 @@ int arp_proxyall = 1; #endif /* - * Support: format an IP address. There should be a standard kernel routine - * to do this. - */ -static char * -arp_ntoa(struct in_addr *x) -{ - static char buf[4*sizeof "123"]; - unsigned char *ucp = (unsigned char *)x; - - sprintf(buf, "%d.%d.%d.%d", - ucp[0] & 0xff, - ucp[1] & 0xff, - ucp[2] & 0xff, - ucp[3] & 0xff); - return buf; -} - -/* * Timeout routine. Age arp_tab entries periodically. */ /* ARGSUSED */ @@ -467,13 +449,13 @@ in_arpinput(m) sizeof (ea->arp_sha))) { log(LOG_ERR, "arp: ether address is broadcast for IP address %s!\n", - arp_ntoa(&isaddr)); + inet_ntoa(isaddr)); goto out; } if (isaddr.s_addr == myaddr.s_addr) { log(LOG_ERR, "duplicate IP address %s! sent from ethernet address: %s\n", - arp_ntoa(&isaddr), ether_sprintf(ea->arp_sha)); + inet_ntoa(isaddr), ether_sprintf(ea->arp_sha)); itaddr = myaddr; goto reply; } @@ -482,7 +464,7 @@ in_arpinput(m) if (sdl->sdl_alen && bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen)) log(LOG_INFO, "arp info overwritten for %s by %s\n", - arp_ntoa(&isaddr), ether_sprintf(ea->arp_sha)); + inet_ntoa(isaddr), ether_sprintf(ea->arp_sha)); bcopy((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen = sizeof(ea->arp_sha)); if (rt->rt_expire) @@ -539,7 +521,7 @@ reply: rtfree(rt); #ifdef DEBUG_PROXY printf("arp: proxying for %s\n", - arp_ntoa(&itaddr)); + inet_ntoa(itaddr)); #endif #else goto out; @@ -617,7 +599,7 @@ arplookup(addr, create, proxy) if(why && create) { log(LOG_DEBUG, "arplookup %s failed: %s\n", - arp_ntoa(&sin.sin_addr), why); + inet_ntoa(sin.sin_addr), why); return 0; } else if(why) { return 0; |