From da96ddce062a45f9808d8bc7ec08ca6ac4faf949 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 9 Nov 1999 17:49:02 +0000 Subject: Add SIOCSIFMEDIA and SIOCGIFMEDIA to the switch in ifioctl(). SIOCSIFMEDIA is only allowed if the user is the superuser. Aparently this got missed when the ifmedia support was added in ages ago. More or less based on how NetBSD does it (though it is rather obvious). --- sys/net/if.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/net/if.c') diff --git a/sys/net/if.c b/sys/net/if.c index e9a22bddc07..96f9b3b345e 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.22 1999/10/27 16:36:25 deraadt Exp $ */ +/* $OpenBSD: if.c,v 1.23 1999/11/09 17:49:01 millert Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -621,8 +621,11 @@ ifioctl(so, cmd, data, p) case SIOCADDMULTI: case SIOCDELMULTI: + case SIOCSIFMEDIA: if ((error = suser(p->p_ucred, &p->p_acflag)) != 0) return (error); + /* FALLTHROUGH */ + case SIOCGIFMEDIA: if (ifp->if_ioctl == 0) return (EOPNOTSUPP); return ((*ifp->if_ioctl)(ifp, cmd, data)); -- cgit v1.2.3