.B broadcast \fIADDRESS\fR \fIPORT\fR
Transmit sound data to \fIADDRESS\fR using UDP port \fIPORT\fR. This implies
\fBspeaker_backend network\fR.
+.IP
+See also \fBmulticast_loop\fR and \fBmulticast_ttl\fR.
.TP
.B broadcast_from \fIADDRESS\fR \fIPORT\fR
Sets the (local) source address used by \fBbroadcast\fR.
The path to the mixer device, if you want access to the volume control,
e.g. \fB/dev/mixer\fR.
.TP
+.B multicast_loop yes\fR|\fBno
+Determines whether multicast packets are loop backed to the sending host. The
+default is \fByes\fR. This only applies if
+\fBspeaker_backend\fR is set to \fBnetwork\fR and \fBbroadcast\fR is actually a
+multicast address.
+.TP
.B multicast_ttl \fIHOPS\fR
-Set the maximum number of hops to send multicast packets. This only applies is
+Set the maximum number of hops to send multicast packets. This only applies if
\fBspeaker_backend\fR is set to \fBnetwork\fR and \fBbroadcast\fR is actually a
multicast address.
.TP
{ C(listen), &type_stringlist, validate_port },
{ C(lock), &type_boolean, validate_any },
{ C(mixer), &type_string, validate_ischr },
+ { C(multicast_loop), &type_boolean, validate_any },
{ C(multicast_ttl), &type_integer, validate_non_negative },
{ C(namepart), &type_namepart, validate_any },
{ C2(nice, nice_rescan), &type_integer, validate_non_negative },
c->queue_pad = 10;
c->speaker_backend = -1;
c->multicast_ttl = 1;
+ c->multicast_loop = 1;
c->authorization_algorithm = xstrdup("sha1");
c->noticed_history = 31;
c->short_display = 32;
/** @brief TTL for multicast packets */
long multicast_ttl;
+ /** @brief Whether to loop back multicast packets */
+ int multicast_loop;
+
/* derived values: */
int nparts; /* number of distinct name parts */
char **parts; /* name part list */
const int mttl = config->multicast_ttl;
if(setsockopt(bfd, IPPROTO_IP, IP_MULTICAST_TTL, &mttl, sizeof mttl) < 0)
fatal(errno, "error setting IP_MULTICAST_TTL on multicast socket");
+ if(setsockopt(bfd, IPPROTO_IP, IP_MULTICAST_LOOP,
+ &config->multicast_loop, sizeof one) < 0)
+ fatal(errno, "error setting IP_MULTICAST_LOOP on multicast socket");
break;
}
case PF_INET6: {
if(setsockopt(bfd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS,
&mttl, sizeof mttl) < 0)
fatal(errno, "error setting IPV6_MULTICAST_HOPS on multicast socket");
+ if(setsockopt(bfd, IPPROTO_IP, IPV6_MULTICAST_LOOP,
+ &config->multicast_loop, sizeof (int)) < 0)
+ fatal(errno, "error setting IPV6_MULTICAST_LOOP on multicast socket");
break;
}
default: