summaryrefslogtreecommitdiff
path: root/lib/gibber/gibber-multicast-transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gibber/gibber-multicast-transport.c')
-rw-r--r--lib/gibber/gibber-multicast-transport.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/gibber/gibber-multicast-transport.c b/lib/gibber/gibber-multicast-transport.c
index 5151f43b..fd146d40 100644
--- a/lib/gibber/gibber-multicast-transport.c
+++ b/lib/gibber/gibber-multicast-transport.c
@@ -150,7 +150,7 @@ _channel_io_in (GIOChannel *source, GIOCondition condition, gpointer data)
int ret;
socklen_t len = sizeof (struct sockaddr_storage);
- ret = recvfrom (priv->fd, (char *)buf, BUFSIZE, 0, (struct sockaddr *)&from, &len);
+ ret = recvfrom (priv->fd, (char *) buf, BUFSIZE, 0, (struct sockaddr *) &from, &len);
if (ret < 0)
{
@@ -214,25 +214,25 @@ _open_multicast (GibberMulticastTransport *self, GError **error)
goto err;
}
- SETSOCKOPT (fd, SOL_SOCKET, SO_REUSEADDR, (char *)&yes, sizeof (yes));
+ SETSOCKOPT (fd, SOL_SOCKET, SO_REUSEADDR, (char *) &yes, sizeof (yes));
#ifdef SO_REUSEPORT
SETSOCKOPT (fd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof (yes));
#endif
- SETSOCKOPT (fd, IPPROTO_IP, IP_MULTICAST_LOOP, (char *)&yes, sizeof (yes));
- SETSOCKOPT (fd, IPPROTO_IP, IP_MULTICAST_TTL, (char *)&one, sizeof (one));
+ SETSOCKOPT (fd, IPPROTO_IP, IP_MULTICAST_LOOP, (char *) &yes, sizeof (yes));
+ SETSOCKOPT (fd, IPPROTO_IP, IP_MULTICAST_TTL, (char *) &one, sizeof (one));
mreq.imr_multiaddr =
((struct sockaddr_in *) &(priv->address))->sin_addr;
mreq.imr_interface.s_addr = htonl (INADDR_ANY);
- SETSOCKOPT (fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *)&mreq, sizeof (mreq));
+ SETSOCKOPT (fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char *) &mreq, sizeof (mreq));
memset (&baddr, 0, sizeof (baddr));
baddr.sin_family = AF_INET;
baddr.sin_addr.s_addr = htonl (INADDR_ANY);
- baddr.sin_port = ((struct sockaddr_in *)&(priv->address))->sin_port;
+ baddr.sin_port = ((struct sockaddr_in *) &(priv->address))->sin_port;
- if (bind (fd, (struct sockaddr *)&baddr, sizeof (baddr)) != 0)
+ if (bind (fd, (struct sockaddr *) &baddr, sizeof (baddr)) != 0)
{
DEBUG("Failed to bind to socket: %s", strerror (errno));
g_set_error (error, GIBBER_MULTICAST_TRANSPORT_ERROR,
@@ -256,13 +256,13 @@ _open_multicast (GibberMulticastTransport *self, GError **error)
}
mreq6.ipv6mr_multiaddr =
- ((struct sockaddr_in6 *)&priv->address)->sin6_addr;
+ ((struct sockaddr_in6 *) &priv->address)->sin6_addr;
mreq6.ipv6mr_interface = 0;
- SETSOCKOPT (fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, (char *)&mreq6,
+ SETSOCKOPT (fd, IPPROTO_IPV6, IPV6_JOIN_GROUP, (char *) &mreq6,
sizeof (mreq6));
- if (bind (fd, (struct sockaddr *)&(priv->address), priv->addrlen)
+ if (bind (fd, (struct sockaddr *) &(priv->address), priv->addrlen)
!= 0)
{
DEBUG("Failed to bind to socket: %s", strerror(errno));
@@ -466,8 +466,8 @@ gibber_multicast_transport_send (GibberTransport *transport,
return FALSE;
}
- if (sendto (priv->fd, (const char *)data, size, 0,
- (struct sockaddr *)&(priv->address),
+ if (sendto (priv->fd, (const char *) data, size, 0,
+ (struct sockaddr *) &(priv->address),
sizeof (struct sockaddr_storage)) < 0)
{
DEBUG("send failed: %s", strerror (errno));