From 74f1fd1880177e9d58213e4ec44e9980434820d3 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 7 Mar 2018 12:00:58 +0100 Subject: [PATCH 1/1] net: Combine para_listen() and para_listen_simple(). The only caller of para_listen() is para_listen_simple(), since flowops are only used for active sockets. --- net.c | 5 ++--- net.h | 6 +----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/net.c b/net.c index b9176a66..1fece043 100644 --- a/net.c +++ b/net.c @@ -503,16 +503,15 @@ int makesock(unsigned l4type, bool passive, const char *host, uint16_t port_numb * * \param l4type The transport-layer type (\p IPPROTO_xxx). * \param port The decimal port number to listen on. - * \param fo Flowopts (if any) to set before starting to listen. * * \return Positive integer (socket descriptor) on success, negative value * otherwise. * * \sa \ref makesock(), ip(7), ipv6(7), bind(2), listen(2). */ -int para_listen(unsigned l4type, uint16_t port, struct flowopts *fo) +int para_listen_simple(unsigned l4type, uint16_t port) { - int ret, fd = makesock(l4type, 1, NULL, port, fo); + int ret, fd = makesock(l4type, 1, NULL, port, NULL); if (fd > 0) { ret = listen(fd, BACKLOG); diff --git a/net.h b/net.h index f172131e..c5157799 100644 --- a/net.h +++ b/net.h @@ -124,12 +124,8 @@ bool sockaddr_equal(const struct sockaddr *sa1, const struct sockaddr *sa2); */ /** How many pending connections queue of a listening server will hold. */ #define BACKLOG 10 -extern int para_listen(unsigned l4type, uint16_t port, struct flowopts *fo); -static inline int para_listen_simple(unsigned l4type, uint16_t port) -{ - return para_listen(l4type, port, NULL); -} +int para_listen_simple(unsigned l4type, uint16_t port); /** Pretty-printing of IPv4/6 socket addresses */ extern char *remote_name(int sockfd); -- 2.39.2