Since size of struct in_aliasreq has just been changed in r228571,
and thus ifconfig(8) needs recompile, it is a good chance to make parameter checks on SIOCAIFADDR arguments more strict.
This commit is contained in:
parent
9ee4b7eb64
commit
92ed4e1a24
@ -126,6 +126,7 @@ in_getaddr(const char *s, int which)
|
||||
*p = '/';
|
||||
errx(1, "%s: bad value (width %s)", s, errstr);
|
||||
}
|
||||
min->sin_family = AF_INET;
|
||||
min->sin_len = sizeof(*min);
|
||||
min->sin_addr.s_addr = htonl(~((1LL << (32 - masklen)) - 1) &
|
||||
0xffffffff);
|
||||
|
@ -253,16 +253,10 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
|
||||
sizeof(struct sockaddr_in) ||
|
||||
ifra->ifra_broadaddr.sin_family != AF_INET))
|
||||
return (EINVAL);
|
||||
#if 0
|
||||
/*
|
||||
* ifconfig(8) historically doesn't set af_family for mask
|
||||
* for unknown reason.
|
||||
*/
|
||||
if (ifra->ifra_mask.sin_len != 0 &&
|
||||
(ifra->ifra_mask.sin_len != sizeof(struct sockaddr_in) ||
|
||||
ifra->ifra_mask.sin_family != AF_INET))
|
||||
return (EINVAL);
|
||||
#endif
|
||||
break;
|
||||
case SIOCSIFADDR:
|
||||
case SIOCSIFBRDADDR:
|
||||
|
Loading…
x
Reference in New Issue
Block a user