diff options
| author | Bill Paul <wpaul@FreeBSD.org> | 1995-08-07 03:42:14 +0000 | 
|---|---|---|
| committer | Bill Paul <wpaul@FreeBSD.org> | 1995-08-07 03:42:14 +0000 | 
| commit | 1e890b056ae039be18929c22b500c718bc4d0a5c (patch) | |
| tree | 094b8300be99741448346c1cc2ce125e803fa6a3 /lib/libc/net/ether_addr.c | |
| parent | 02d5c7b197ef3368fe3a04cbb43047be931bec6a (diff) | |
Notes
Diffstat (limited to 'lib/libc/net/ether_addr.c')
| -rw-r--r-- | lib/libc/net/ether_addr.c | 31 | 
1 files changed, 8 insertions, 23 deletions
diff --git a/lib/libc/net/ether_addr.c b/lib/libc/net/ether_addr.c index c6288261ebe9..711bb7d93a05 100644 --- a/lib/libc/net/ether_addr.c +++ b/lib/libc/net/ether_addr.c @@ -35,7 +35,7 @@   * Center for Telecommunications Research   * Columbia University, New York City   * - *	$Id: ether_addr.c,v 1.5 1995/03/26 02:37:00 wpaul Exp $ + *	$Id: ether_addr.c,v 1.1 1995/04/02 01:31:17 wpaul Exp $   */ @@ -142,23 +142,16 @@ int ether_ntohost(hostname, e)  			continue;  #ifdef YP  		if (buf[0] == '+') { -			fclose(fp);  /* Can ignore /etc/ethers from here on. */  			if (yp_get_default_domain(&yp_domain)) -				return(1); +				continue;  			ether_a = ether_ntoa(e);  			if (yp_match(yp_domain, "ethers.byaddr", ether_a,  				strlen(ether_a), &result, &resultlen)) {  				free(result); -				return(1); +				continue;  			} -			if (!ether_line(result, &local_ether, &local_host)) { -				strcpy(hostname, (char *)&local_host); -				free(result); -				return(0); -			} else { +			strncpy((char *)&buf, result, resultlen);  				free(result); -				return(1); -			}  		}  #endif  		if (!ether_line(&buf, &local_ether, &local_host)) { @@ -200,23 +193,15 @@ int ether_hostton(hostname, e)  			continue;  #ifdef YP  		if (buf[0] == '+') { -			fclose(fp);  /* Can ignore /etc/ethers from here on. */  			if (yp_get_default_domain(&yp_domain)) -				return(1); +				continue;  			if (yp_match(yp_domain, "ethers.byname", hostname,  				strlen(hostname), &result, &resultlen)) {  				free(result); -				return(1); -			} -			if (!ether_line(result, &local_ether, &local_host)) { -				bcopy((char *)&local_ether.octet[0], -					(char *)&e->octet[0], 6); -				free(result); -				return(0); -			} else { -				free(result); -				return(1); +				continue;  			} +			strncpy((char *)&buf, result, resultlen); +			free(result);  		}  #endif  		if (!ether_line(&buf, &local_ether, &local_host)) {  | 
