* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <assert.h>
#include <limits.h>
#include <stdio.h>
int lttcomm_create_inet6_sock(struct lttcomm_sock *sock, int type, int proto)
{
int val = 1, ret;
+ unsigned long timeout;
/* Create server socket */
if ((sock->fd = socket(PF_INET6, type, proto)) < 0) {
PERROR("setsockopt inet6");
goto error;
}
+ timeout = lttcomm_get_network_timeout();
+ if (timeout) {
+ ret = lttcomm_setsockopt_rcv_timeout(sock->fd, timeout);
+ if (ret) {
+ goto error;
+ }
+ ret = lttcomm_setsockopt_snd_timeout(sock->fd, timeout);
+ if (ret) {
+ goto error;
+ }
+ }
return 0;
{
int ret;
- ret = bind(sock->fd, &sock->sockaddr.addr.sin6,
+ ret = bind(sock->fd, (const struct sockaddr *) &sock->sockaddr.addr.sin6,
sizeof(sock->sockaddr.addr.sin6));
if (ret < 0) {
PERROR("bind inet6");