Re: [PATCH 2/5] AF_UNIX: enable/disable multicast withgetsockopt/setsockopt

From: Eric Dumazet
Date: Fri Sep 24 2010 - 13:46:52 EST


Le vendredi 24 septembre 2010 Ã 18:25 +0100, Alban Crequy a Ãcrit :
> Multicast can be enabled or disabled after a socket is allocated but this
> cannot be changed once the socket is bound or connected.
>
> Userspace applications can enable multicast on an Unix stream socket:
> sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
> #define UNIX_MULTICAST 1
> val = 1;
> len = sizeof(val);
> ret = setsockopt(sockfd, 0, UNIX_MULTICAST, &val, len);
>
> Signed-off-by: Alban Crequy <alban.crequy@xxxxxxxxxxxxxxx>


> + if (val != 0) {
> + u->multicast = 1;
> + } else {
> + u->multicast = 0;
> + }

u->multicast = !!val;



--
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/