diff options
author | 2018-04-26 12:23:56 +0000 | |
---|---|---|
committer | 2018-04-26 12:23:56 +0000 | |
commit | e4ca1de84acfb3d96ed8f94e7ceaee0f2ca5acfe (patch) | |
tree | d0159c646857b2502e39f2f4924acfe30f4ef9a3 | |
parent | Make ed's 'l' command end lines with a '$' and make sure that literal (diff) | |
download | wireguard-openbsd-e4ca1de84acfb3d96ed8f94e7ceaee0f2ca5acfe.tar.xz wireguard-openbsd-e4ca1de84acfb3d96ed8f94e7ceaee0f2ca5acfe.zip |
Do not try getnetbyname(3) if gethostbyname(3) returns no result.
This is part of the project to delete /etc/networks support.
OK deraadt@
-rw-r--r-- | sbin/ifconfig/ifconfig.8 | 7 | ||||
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 5 |
2 files changed, 3 insertions, 9 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index aea53873019..6d6be8ff049 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ifconfig.8,v 1.306 2018/04/26 06:58:50 akoshibe Exp $ +.\" $OpenBSD: ifconfig.8,v 1.307 2018/04/26 12:23:56 schwarze Exp $ .\" $NetBSD: ifconfig.8,v 1.11 1996/01/04 21:27:29 pk Exp $ .\" $FreeBSD: ifconfig.8,v 1.16 1998/02/01 07:03:29 steve Exp $ .\" @@ -408,9 +408,7 @@ networks into subnetworks. The mask includes the network part of the local address and the subnet part, which is taken from the host field of the address. The mask can be specified as a single hexadecimal number -with a leading 0x, with a dot-notation Internet address, -or with a pseudo-network name listed in the network table -.Xr networks 5 . +with a leading 0x, or with a dot-notation Internet address. The mask contains 1's for the bit positions in the 32-bit address which are to be used for the network and subnet parts, and 0's for the host part. @@ -1847,7 +1845,6 @@ tried to alter an interface's configuration. .Xr route 4 , .Xr hostname.if 5 , .Xr hosts 5 , -.Xr networks 5 , .Xr rc 8 , .Xr slaacd 8 , .Xr tcpdump 8 diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 01924216c35..f426e615ef9 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.363 2018/04/26 06:58:50 akoshibe Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.364 2018/04/26 12:23:56 schwarze Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -5412,7 +5412,6 @@ in_getaddr(const char *s, int which) { struct sockaddr_in *sin = sintab[which], tsin; struct hostent *hp; - struct netent *np; int bits, l; char p[3]; @@ -5432,8 +5431,6 @@ in_getaddr(const char *s, int which) } else if (inet_aton(s, &sin->sin_addr) == 0) { if ((hp = gethostbyname(s))) memcpy(&sin->sin_addr, hp->h_addr, hp->h_length); - else if ((np = getnetbyname(s))) - sin->sin_addr = inet_makeaddr(np->n_net, INADDR_ANY); else errx(1, "%s: bad value", s); } |