*/
int lttcomm_create_inet6_sock(struct lttcomm_sock *sock, int type, int proto)
{
- int val, ret;
+ int val = 1, ret;
/* Create server socket */
- if ((sock->fd = socket(PF_INET, type, proto)) < 0) {
+ if ((sock->fd = socket(PF_INET6, type, proto)) < 0) {
PERROR("socket inet6");
goto error;
}
goto end;
}
- new_sock = lttcomm_alloc_sock(LTTCOMM_INET, sock->proto);
+ new_sock = lttcomm_alloc_sock(sock->proto);
if (new_sock == NULL) {
goto error;
}
}
new_sock->fd = new_fd;
+ new_sock->ops = &inet6_ops;
end:
return new_sock;
*/
int lttcomm_close_inet6_sock(struct lttcomm_sock *sock)
{
- int ret, closeret;
+ int ret;
- /* Don't try to close an invalid mark socket */
+ /* Don't try to close an invalid marked socket */
if (sock->fd == -1) {
return 0;
}
- closeret = close(sock->fd);
- if (closeret) {
+ ret = close(sock->fd);
+ if (ret) {
PERROR("close inet6");
}