1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Disallow half-configured point-to-point interfaces. It's still possible to

get into a half-configured state by using the old-style ioctls;this
may be a feature.
This commit is contained in:
Garrett Wollman 1995-04-25 19:50:20 +00:00
parent cd02a0b741
commit 1067217d5d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8071

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)in.c 8.2 (Berkeley) 11/15/93
* $Id: in.c,v 1.10 1995/03/16 18:14:50 bde Exp $
* $Id: in.c,v 1.11 1995/03/23 18:14:40 wollman Exp $
*/
#include <sys/param.h>
@ -202,12 +202,19 @@ in_control(so, cmd, data, ifp)
case SIOCAIFADDR:
case SIOCDIFADDR:
if (ifra->ifra_addr.sin_family == AF_INET)
for (oia = ia; ia; ia = ia->ia_next) {
if (ia->ia_ifp == ifp &&
ia->ia_addr.sin_addr.s_addr ==
ifra->ifra_addr.sin_addr.s_addr)
break;
if (ifra->ifra_addr.sin_family == AF_INET) {
for (oia = ia; ia; ia = ia->ia_next) {
if (ia->ia_ifp == ifp &&
ia->ia_addr.sin_addr.s_addr ==
ifra->ifra_addr.sin_addr.s_addr)
break;
}
if ((ifp->if_flags & IFF_POINTOPOINT)
&& (cmd == SIOCAIFADDR)
&& (ifra->ifra_dstaddr.sin_addr.s_addr
== INADDR_ANY)) {
return EADDRNOTAVAIL;
}
}
if (cmd == SIOCDIFADDR && ia == 0)
return (EADDRNOTAVAIL);