return 0;
}
-static int listen_loopback_reuseport(int family, int sotype, int progfd)
+static int socket_loopback_reuseport(int family, int sotype, int progfd)
{
struct sockaddr_storage addr;
socklen_t len;
if (err)
goto close;
+ if (sotype == SOCK_DGRAM)
+ return s;
+
err = xlisten(s, SOMAXCONN);
if (err)
goto close;
return -1;
}
-static int listen_loopback(int family, int sotype)
+static int socket_loopback(int family, int sotype)
{
- return listen_loopback_reuseport(family, sotype, -1);
+ return socket_loopback_reuseport(family, sotype, -1);
}
static void test_insert_invalid(int family, int sotype, int mapfd)
u32 key;
int s;
- s = listen_loopback(family, sotype);
+ s = socket_loopback(family, sotype);
if (s < 0)
return;
u32 key;
int s;
- s = listen_loopback(family, sotype);
+ s = socket_loopback(family, sotype);
if (s < 0)
return;
u64 value;
u32 key;
- s = listen_loopback(family, sotype);
+ s = socket_loopback(family, sotype);
if (s < 0)
return;
u32 key;
int s;
- s = listen_loopback(family, sotype);
+ s = socket_loopback(family, sotype);
if (s < 0)
return;
u64 value;
u32 key;
- s = listen_loopback(family, sotype);
+ s = socket_loopback(family, sotype);
if (s < 0)
return;
u32 key, value32;
int err, s;
- s = listen_loopback(family, sotype);
+ s = socket_loopback(family, sotype);
if (s < 0)
return;
u64 value;
u32 key;
- s1 = listen_loopback(family, sotype);
+ s1 = socket_loopback(family, sotype);
if (s1 < 0)
return;
- s2 = listen_loopback(family, sotype);
+ s2 = socket_loopback(family, sotype);
if (s2 < 0)
goto close_s1;
u64 value;
u32 key;
- s = listen_loopback(family, sotype);
+ s = socket_loopback(family, sotype);
if (s < 0)
return;
u64 value;
u32 key;
- s = listen_loopback(family, sotype);
+ s = socket_loopback(family, sotype);
if (s < 0)
return;
socklen_t len;
u64 value;
- s = listen_loopback(family, sotype);
+ s = socket_loopback(family, sotype);
if (s == -1)
return;
socklen_t len;
u64 value;
- s = listen_loopback(family, sotype);
+ s = socket_loopback(family, sotype);
if (s == -1)
return;
int err, s;
u64 value;
- s = listen_loopback(family, sotype | SOCK_NONBLOCK);
+ s = socket_loopback(family, sotype | SOCK_NONBLOCK);
if (s < 0)
return;
zero_verdict_count(verd_mapfd);
- s = listen_loopback(family, sotype | SOCK_NONBLOCK);
+ s = socket_loopback(family, sotype | SOCK_NONBLOCK);
if (s < 0)
return;
zero_verdict_count(verd_mapfd);
- s = listen_loopback(family, sotype | SOCK_NONBLOCK);
+ s = socket_loopback(family, sotype | SOCK_NONBLOCK);
if (s < 0)
return;
zero_verdict_count(verd_map);
- s = listen_loopback_reuseport(family, sotype, reuseport_prog);
+ s = socket_loopback_reuseport(family, sotype, reuseport_prog);
if (s < 0)
return;
zero_verdict_count(verd_map);
- s = listen_loopback_reuseport(family, sotype, reuseport_prog);
+ s = socket_loopback_reuseport(family, sotype, reuseport_prog);
if (s < 0)
return;
zero_verdict_count(verd_map);
/* Create two listeners, each in its own reuseport group */
- s1 = listen_loopback_reuseport(family, sotype, reuseport_prog);
+ s1 = socket_loopback_reuseport(family, sotype, reuseport_prog);
if (s1 < 0)
return;
- s2 = listen_loopback_reuseport(family, sotype, reuseport_prog);
+ s2 = socket_loopback_reuseport(family, sotype, reuseport_prog);
if (s2 < 0)
goto close_srv1;