diff options
Diffstat (limited to 'util.c')
| -rw-r--r-- | util.c | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -47,16 +47,14 @@ * @sl: Length of @sa * @ifname: Interface for binding, NULL for any * @v6only: Set IPV6_V6ONLY socket option - * @data: epoll reference portion for protocol handlers * * Return: newly created socket, negative error code on failure */ int sock_l4_sa(const struct ctx *c, enum epoll_type type, const void *sa, socklen_t sl, - const char *ifname, bool v6only, uint32_t data) + const char *ifname, bool v6only) { sa_family_t af = ((const struct sockaddr *)sa)->sa_family; - union epoll_ref ref = { .type = type, .data = data }; bool freebind = false; int fd, y = 1, ret; uint8_t proto; @@ -99,8 +97,6 @@ int sock_l4_sa(const struct ctx *c, enum epoll_type type, return -EBADF; } - ref.fd = fd; - if (v6only) if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &y, sizeof(y))) debug("Failed to set IPV6_V6ONLY on socket %i", fd); @@ -171,10 +167,6 @@ int sock_l4_sa(const struct ctx *c, enum epoll_type type, return ret; } - ret = epoll_add(c->epollfd, EPOLLIN, ref); - if (ret < 0) - return ret; - return fd; } |
