summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/ethers.c
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2004-02-16 19:41:12 +0000
committerotto <otto@openbsd.org>2004-02-16 19:41:12 +0000
commit42c35b4a87c621cdf23accebeadda321a489e883 (patch)
tree2abdadfb9e22121f7aa05f445f8a03bd55ebb646 /lib/libc/net/ethers.c
parenthandle allocation failure; jjy2+@pitt.edu (diff)
downloadwireguard-openbsd-42c35b4a87c621cdf23accebeadda321a489e883.tar.xz
wireguard-openbsd-42c35b4a87c621cdf23accebeadda321a489e883.zip
remove redundant code, u_int8_t cannot be > 0xff
ok deraadt@ millert@
Diffstat (limited to 'lib/libc/net/ethers.c')
-rw-r--r--lib/libc/net/ethers.c18
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],