net: Add compat ioctl support for the ipv4 multicast ioctl SIOCGETSGCNT
commit709b46e8d90badda1898caea50483c12af178e96
authorEric W. Biederman <ebiederm@xmission.com>
Sat, 29 Jan 2011 16:15:56 +0000 (29 16:15 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 30 Jan 2011 09:14:38 +0000 (30 01:14 -0800)
tree799b57704dda3684777fb57a6e413dabac78858c
parent13ad17745c2cbd437d9e24b2d97393e0be11c439
net: Add compat ioctl support for the ipv4 multicast ioctl SIOCGETSGCNT

SIOCGETSGCNT is not a unique ioctl value as it it maps tio SIOCPROTOPRIVATE +1,
which unfortunately means the existing infrastructure for compat networking
ioctls is insufficient.  A trivial compact ioctl implementation would conflict
with:

SIOCAX25ADDUID
SIOCAIPXPRISLT
SIOCGETSGCNT_IN6
SIOCGETSGCNT
SIOCRSSCAUSE
SIOCX25SSUBSCRIP
SIOCX25SDTEFACILITIES

To make this work I have updated the compat_ioctl decode path to mirror the
the normal ioctl decode path.  I have added an ipv4 inet_compat_ioctl function
so that I can have ipv4 specific compat ioctls.   I have added a compat_ioctl
function into struct proto so I can break out ioctls by which kind of ip socket
I am using.  I have added a compat_raw_ioctl function because SIOCGETSGCNT only
works on raw sockets.  I have added a ipmr_compat_ioctl that mirrors the normal
ipmr_ioctl.

This was necessary because unfortunately the struct layout for the SIOCGETSGCNT
has unsigned longs in it so changes between 32bit and 64bit kernels.

This change was sufficient to run a 32bit ip multicast routing daemon on a
64bit kernel.

Reported-by: Bill Fenner <fenner@aristanetworks.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/mroute.h
include/net/sock.h
net/ipv4/af_inet.c
net/ipv4/ipmr.c
net/ipv4/raw.c