Re: v2.6 IGMPv3 implementation

From: Charles R. Anderson
Date: Mon Jul 12 2004 - 20:23:01 EST


On Tue, Jul 13, 2004 at 06:22:26AM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote:
> These ioctls are "historic" and deprecated API.
> So, just kill them to avoid confusion.
> We use socket options.

Thank you. I have now read RFC3678 carefully and I have more
questions. The kernel still declares the structs used for these
obsolete ioctls, but instead defines sockoptions for them:

#define IP_MSFILTER 41
...
#define MCAST_MSFILTER 48
...
struct ip_msfilter {
__u32 imsf_multiaddr;
__u32 imsf_interface;
__u32 imsf_fmode;
__u32 imsf_numsrc;
__u32 imsf_slist[1];
};

#define IP_MSFILTER_SIZE(numsrc) \
(sizeof(struct ip_msfilter) - sizeof(__u32) \
+ (numsrc) * sizeof(__u32))
...
struct group_filter
{
__u32 gf_interface; /* interface index */
struct __kernel_sockaddr_storage gf_group; /* multicast address */
__u32 gf_fmode; /* filter mode */
__u32 gf_numsrc; /* number of sources */
struct __kernel_sockaddr_storage gf_slist[1]; /* interface index */
};

#define GROUP_FILTER_SIZE(numsrc) \
(sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \
+ (numsrc) * sizeof(struct __kernel_sockaddr_storage))

Is it intended that glibc use these sockoptions internally for its
implementation of the approved Advanced API functions, which are then
exported to user programs:

setipv4sourcefilter()
getipv4sourcefilter()
setsourcefilter()
getsourcefilter()

Does the following limitation from RFC3678 Appendix A (rationale for
the ioctl interface) apply to the Linux kernel getsockopt(), or can
getsockopt() be used to retrieve the source filter for a given group?

Retrieving the source filter for a given group cannot be done with
getsockopt() on some existing platforms, since the group and
interface must be passed down in order to retrieve the correct
filter, and getsockopt only supports an output buffer. This can,
however, be done with an ioctl(), and hence for symmetry, both gets
and sets are done with an ioctl.

Thank you for putting up with all my questions.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/