tech-kern archive

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

Re: compat linux SIOCGIFCONF fix for 64bit archs



In article <20080630172052.GA300913%medusa.sis.pasteur.fr@localhost>,
Nicolas Joly  <njoly%pasteur.fr@localhost> wrote:
>-=-=-=-=-=-
>
>
>Hi,
>
>Here follow a patch that fix SIOCGIFCONF ioctl under compat linux for
>64bits archs.
>
>The main problem, here, is that Linux `struct ifreq' is not MI, but
>our is ... By example, on Linux/x86_64 use a 40 bytes structure but
>our corresponding structure has only 32 bytes (this works on i386,
>because the Linux structure size is 32 bytes). This difference will
>lead to an alignment problem when reporting the interfaces list with
>SIOCGIFCONF ioctl.
>
>To fix it, i added a new `struct linux_ifreq' which has the expected
>size, and a new linux_getifconf() function that use it (a cleaned up
>version of compat_ifconf()).
>
>While here, the new linux_getifconf() function will only report
>interfaces of AF_INET family, like the Linux kernel does.
>
>I tested it on -current NetBSD/amd64 and NetBSD/i386 that i have
>access to.
>
>Thanks.
>
>NB: If this is ok, i'll plan to modify compat linux32 too; at least
>for consistency with AF_INET restriction.

Looks good to me, go for it.

christoa



Home | Main Index | Thread Index | Old Index