Ooops, this should have made it into the same commit, but didn't.

Introduce the SIOC[SG]IFGENERIC hooks that can be used to pass an
arbritrary ioctl subcommand into an interface driver.  Surprisingly
enough, there was no provision for this already present (except of the
option of abusing SIOC[SG]IFMEDIA for this).

The idea is that an interface driver can establish ioctl subcommands
of its own that can't be meaningfully interpreted by the upper layer
interface ioctl function.  Something like this is required to
implement a clean solution of passing down things like CHAP secrets or
PPP options to the /sys/net/if_sppp* files.  (Yes, my CHAP is now
finally working with it, but i gotta update my kernel to the new
callout interface before being able to commit _that_.)

Reviewed by:    peter   [long ago, actually]
This commit is contained in:
Joerg Wunsch 1997-10-07 07:40:35 +00:00
parent 90a09570d5
commit d7189ec67c

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if.c 8.3 (Berkeley) 1/4/94
* $Id: if.c,v 1.52 1997/09/02 01:18:34 bde Exp $
* $Id: if.c,v 1.53 1997/09/07 11:09:22 joerg Exp $
*/
#include <sys/param.h>
@ -639,6 +639,7 @@ ifioctl(so, cmd, data, p)
return error;
case SIOCSIFMEDIA:
case SIOCSIFGENERIC:
error = suser(p->p_ucred, &p->p_acflag);
if (error)
return (error);
@ -650,6 +651,7 @@ ifioctl(so, cmd, data, p)
return error;
case SIOCGIFMEDIA:
case SIOCGIFGENERIC:
if (ifp->if_ioctl == 0)
return (EOPNOTSUPP);
return ((*ifp->if_ioctl)(ifp, cmd, data));