Differentiate between addifaddr and delifaddr for the privilege check.

Reviewed by:	rwatson
MFC after:	2 weeks
This commit is contained in:
Bjoern A. Zeeb 2008-01-24 08:14:38 +00:00
parent c4579b502b
commit 107d12440a

View File

@ -294,7 +294,8 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
case SIOCSIFNETMASK:
case SIOCSIFDSTADDR:
if (td != NULL) {
error = priv_check(td, PRIV_NET_ADDIFADDR);
error = priv_check(td, (cmd == SIOCDIFADDR) ?
PRIV_NET_DELIFADDR : PRIV_NET_ADDIFADDR);
if (error)
return (error);
}