Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jul 1996 15:07:52 -0700
From:      Jim Binkley <jrb@cs.pdx.edu>
To:        hackers@freebsd.org
Subject:   puzzled about if ioctls
Message-ID:  <199607232207.PAA13263@sirius.cs.pdx.edu>

next in thread | raw e-mail | index | archive | help

Greetings,

I have a coding problem and am hoping someone might
have a half-way decent solution or workaround OR ... <something>

The problem is basically that I need to check for su privilege
in an if_something.c network driver and there is no proc parameter
passed into it from above.  Other more ordinary ioctl drivers
have such a mechanism, e.g., sio.c.  if*.c something drivers DON'T.
Why not?  I have a totally device specific parameter that I want
to set so the code shouldn't live in /net/if.c to check it.  
I can add an ioctl ok for a if*.c driver but I didn't want to
have to change every instance of a call to lower level ioctl
routines in the network code in order to pass on the proc parameter.
Foo.

(I want to set something called the Network ID on a wavelan card. 
That's pretty device specific.  It isn't going to show up elsewhere
except maybe on garage door openers).

More details:
------------------------------------------------------
Try this:
# cd /sys/i386/isa
# grep suser *.c

You will see lines like:

sio.c:		error = suser(p->p_ucred, &p->p_acflag);

The above is most likely in an ioctl routine with params like

sioctl(dev, cmd, data, flag, p)

where the last param is

struct proc *p;
------------------------------------------------------

Note that there were no such lines in if*.c  Now take a look
in /sys/net/if.c at ifioctl  or in /sys/netinet/in.c at 
the in_control function.  Look at the default: clause
in in_control.  No p parameter is passed down.
  
Whatever happened to good old suser() with no parameters?

					regards,

					Jim Binkley
					jrb@cs.pdx.edu



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607232207.PAA13263>