Robert Elz
2010-09-29 07:13:20 UTC
I think I understand the purpose of this ioctl. and if I
do understand it correctly, SIOCINITIFADDR is an in-kernel only
ioctl (that's reinforced by seeing it all over the -current
interface drivers, and nowhere outside the kernel), plus the EPERM.
Given that, wouldn't a comment in sockio.h indicating that the
number is taken, with the actual #define of the ioctl command
value in some kernel only header file be a more sensible choice?
I noticed this as I wanted to add some data to struct ifaddr, and
was checking to make sure (which I presumed, but wanted to verify)
that this struct is a 100% in kernel data structure, not visible
externally (so no API/ABI would be broken by changing the struct,
just kernel modules that I don't care about...)
Then I saw SIOCINITIFADDR in sys/sockio.h and paniced!
Then I saw its usage, and calmed a little, but that definition seems
wrong to me - even if it is the correct file, couldn't it be #ifdef KERNEL,
or at the very least, have some kind of comment?
kre
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
do understand it correctly, SIOCINITIFADDR is an in-kernel only
ioctl (that's reinforced by seeing it all over the -current
interface drivers, and nowhere outside the kernel), plus the EPERM.
Given that, wouldn't a comment in sockio.h indicating that the
number is taken, with the actual #define of the ioctl command
value in some kernel only header file be a more sensible choice?
I noticed this as I wanted to add some data to struct ifaddr, and
was checking to make sure (which I presumed, but wanted to verify)
that this struct is a 100% in kernel data structure, not visible
externally (so no API/ABI would be broken by changing the struct,
just kernel modules that I don't care about...)
Then I saw SIOCINITIFADDR in sys/sockio.h and paniced!
Then I saw its usage, and calmed a little, but that definition seems
wrong to me - even if it is the correct file, couldn't it be #ifdef KERNEL,
or at the very least, have some kind of comment?
kre
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de