diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2004-02-16 19:41:13 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2004-02-16 19:41:13 +0000 |
commit | 3f2dad64aa7b17535fbbe86ef6791e09b1c3ce35 (patch) | |
tree | 07b52c3c5280ba4aca617023a6176f617770585a | |
parent | d1769aaab63dcb4c5074ba90eb00807c25b0366e (diff) |
remove redundant code, u_int8_t cannot be > 0xff
ok deraadt@ millert@
-rw-r--r-- | lib/libc/net/ethers.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/lib/libc/net/ethers.c b/lib/libc/net/ethers.c index 899022a6221..2c1e562245b 100644 --- a/lib/libc/net/ethers.c +++ b/lib/libc/net/ethers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ethers.c,v 1.16 2003/06/17 21:56:24 millert Exp $ */ +/* $OpenBSD: ethers.c,v 1.17 2004/02/16 19:41:12 otto Exp $ */ /* * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> @@ -23,7 +23,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: ethers.c,v 1.16 2003/06/17 21:56:24 millert Exp $"; +static char rcsid[] = "$OpenBSD: ethers.c,v 1.17 2004/02/16 19:41:12 otto Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -54,13 +54,6 @@ ether_ntoa(e) { static char a[] = "xx:xx:xx:xx:xx:xx"; - if (e->ether_addr_octet[0] > 0xFF || e->ether_addr_octet[1] > 0xFF || - e->ether_addr_octet[2] > 0xFF || e->ether_addr_octet[3] > 0xFF || - e->ether_addr_octet[4] > 0xFF || e->ether_addr_octet[5] > 0xFF) { - errno = EINVAL; - return (NULL); - } - (void)snprintf(a, sizeof a, "%02x:%02x:%02x:%02x:%02x:%02x", e->ether_addr_octet[0], e->ether_addr_octet[1], e->ether_addr_octet[2], e->ether_addr_octet[3], @@ -119,13 +112,6 @@ ether_ntohost(hostname, e) int trylen; #endif - if (e->ether_addr_octet[0] > 0xFF || e->ether_addr_octet[1] > 0xFF || - e->ether_addr_octet[2] > 0xFF || e->ether_addr_octet[3] > 0xFF || - e->ether_addr_octet[4] > 0xFF || e->ether_addr_octet[5] > 0xFF) { - errno = EINVAL; - return (-1); - } - #ifdef YP snprintf(trybuf, sizeof trybuf, "%x:%x:%x:%x:%x:%x", e->ether_addr_octet[0], e->ether_addr_octet[1], |