unsigned int timeout,
size_t maxlen,
size_t *p_len);
+int open_socket_in_protocol(
+ int type,
+ int protocol,
+ const struct sockaddr_storage *paddr,
+ uint16_t port,
+ bool rebind);
int open_socket_in(
int type,
const struct sockaddr_storage *paddr,
* Return sock or -errno
*/
-int open_socket_in(
+int open_socket_in_protocol(
int type,
+ int protocol,
const struct sockaddr_storage *paddr,
uint16_t port,
bool rebind)
goto fail;
}
- sock = socket(addr.u.ss.ss_family, type, 0 );
+ sock = socket(addr.u.ss.ss_family, type, protocol);
if (sock == -1) {
ret = -errno;
DBG_DEBUG("socket() failed: %s\n", strerror(errno));
return ret;
}
+int open_socket_in(
+ int type,
+ const struct sockaddr_storage *paddr,
+ uint16_t port,
+ bool rebind)
+{
+ return open_socket_in_protocol(type, 0, paddr, port, rebind);
+}
+
struct open_socket_out_state {
int fd;
struct tevent_context *ev;