tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sysctl to disable protocol stack

>> You can get most of the way there by writing it the enabled way and
>> then just inverting the bit when you go to actually check the domain
>> struct.
> That would work if sysctl() has some magic "invert the value when
> setting and fetching" flag (maybe it does, I admit I didn't look that
> closely).

I doubt it does, but I sure thought it had set and get handlers,
allowing the interposition of arbitrary code between the value as seen
by sysctl(3) and the variable in the kernel backing it, if any.  It
certainly does on get, or at least did as of 4.0.1; consider, for
example, vfs.generic.fstypes, backed by sysctl_vfs_generic_fstypes() in
kern/vfs_subr.c.  If it doesn't have set handlers, well, I actually
think the best thing to do would be to change that.  But if that's
considered undesirable for some reason, then sticking with "disabled"
for the sysctl interface is probably right.

Even in that case, though, I think it might be worth thinking about
making the other interfaces (other than the domain struct and the
sysctl interface, that is) be "enabled" style.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML      
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index