Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

adding new address families (AF_xxx)

41 views
Skip to first unread message

Mark

unread,
Nov 7, 2012, 5:48:29 PM11/7/12
to
Hello,

I came across the kernel driver code implementing some sort of IGMP snooping
backend and as part of its functionalilty it creates a new socket address
family, AF_IGMPSNOOP, but actually implements just a few operations for this
type of socket:

static struct proto_ops igmp_snoop_ops = {
family: AF_IGMP_SNOOP,
release: _igmp_snoop_sock_release,
bind: sock_no_bind,
connect: sock_no_connect,
socketpair: sock_no_socketpair,
accept: sock_no_accept,
getname: sock_no_getname,
poll: datagram_poll,
ioctl: sock_no_ioctl,
listen: sock_no_listen,
shutdown: sock_no_shutdown,
setsockopt: _igmp_snoop_setsockopt,
getsockopt: sock_no_getsockopt,
sendmsg: _igmp_snoop_sock_sendmsg,
recvmsg: _igmp_snoop_sock_recvmsg,
mmap: sock_no_mmap,
sendpage: sock_no_sendpage,
}

However from a user space perspective a socket is created as:

fd = socket (AF_IGMPSNOOP, SOCK_RAW, IPPROTO_IGMP)

I'm wondering what is the rationale for adding a new family, while in fact a
raw socket is being used to access the stack for IGMP packets? Would not it
be the same to just create AF_INET raw socket and do the things?

Looking forward to hearing form you !
Thanks.

Mark


Les Cargill

unread,
Nov 7, 2012, 11:49:59 PM11/7/12
to
Possibly.

I'm pretty sure IGMP snooping is really a "bridge" thing.

http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge#Snooping

I don't know why you'd need a socket for bridge-based IGMP snooping
at all. Bridges don't need no steenking sockets. This being said, this
is another one of those things...

( text from RFC 4541 ):
" In recent years, a number of commercial vendors have introduced
products described as "IGMP snooping switches" to the market. These
devices do not adhere to the conceptual model that provides the
strict separation of functionality between different communications
layers in the ISO model, and instead utilize information in the upper
level protocol headers as factors to be considered in processing at
the lower levels. This is analogous to the manner in which a router
can act as a firewall by looking into the transport protocol's header
before allowing a packet to be forwarded to its destination address."

http://tools.ietf.org/html/rfc4541

So *sigh*.



> Looking forward to hearing form you !
> Thanks.
>
> Mark
>
>

--
Les Cargill

Mark

unread,
Nov 8, 2012, 8:11:28 AM11/8/12
to

"Les Cargill" <lcarg...@comcast.com> wrote in message
news:k7fdln$248$1...@dont-email.me...
Thanks for the response.
Another thing that comes to my mind is that perhaps the implementor of
AF_IGMPSNOOP family wanted to have just a small subset of socket operations,
not a full-blown socket, basically only the 'release', 'poll', setsockopt,
sendmsg and recvmsg are implemented for this new family. May be they wanted
to have a light-weight mechanism.

Mark


Les Cargill

unread,
Nov 8, 2012, 10:03:36 PM11/8/12
to
Dunno - find the appropriate mailing list and ask them. But yes - it
looks like only those callbacks are allowed.

--
Les Cargill
0 new messages