When inet is the default protocol, broadcasts are not used (because they
are not reliable). Previously, if inet was the default, we didn't bind the
socket to multicast address and thus we were not able to receive the
broadcasts. This situation was confusing and therefore it is better omit
the implementation of inet_broadcast entirely to make this clear that it
is not used.
return 0;
}
+#ifndef CONFIG_FORB_PROTO_INET_DEFAULT
static ssize_t
inet_broadcast(forb_port_t *port, const void *buf, size_t len)
{
(struct sockaddr*)&addr, sizeof(addr));
return ret;
}
+#endif
static void
inet_peer_destroy(forb_peer_t *peer)
.peer_destroy = inet_peer_destroy,
.send = inet_send,
.recv = inet_recv,
+#ifndef CONFIG_FORB_PROTO_INET_DEFAULT
.broadcast = inet_broadcast,
+#endif
.serialize_addr = inet_serialize_addr,
.deserialize_addr = inet_deserialize_addr,
.addr2str = inet_addr2str,