lkml.org 
[lkml]   [2010]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/5] AF_UNIX: enable/disable multicast with getsockopt/setsockopt
From
Date
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@collabora.co.uk>


> + 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-09-27 20:09    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site