diff --git a/CHANGES b/CHANGES index 813feff..d059101 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,8 @@ Features: Coding: Introduced groups_t instead of uint32_t, for more flexibility + Rearranged option group bits to only require 32 bits on older systems. + ####################### V 1.7.4.5 (not released): Corrections: diff --git a/xio-socket.c b/xio-socket.c index 6aa0a5e..78ff176 100644 --- a/xio-socket.c +++ b/xio-socket.c @@ -51,7 +51,7 @@ int xioopen_socket_recvfrom(int argc, const char *argv[], struct opt *opts, int dummy1, int socktype, int dummy3); static int xioopen_socket_recv(int argc, const char *argv[], struct opt *opts, - int xioflags, xiofile_t *xfd, groups_t groups, + int xioflags, xiofile_t *xfd, groups_t groups, int dummy1, int dummy2, int dummy3); static diff --git a/xio-unix.c b/xio-unix.c index 4c36de4..6315a66 100644 --- a/xio-unix.c +++ b/xio-unix.c @@ -586,7 +586,7 @@ static int xioopen_unix_client(int argc, const char *argv[], struct opt *opts, i OPT_PROTOCOL_FAMILY, OPT_UNIX_TIGHTSOCKLEN, OPT_UNLINK_CLOSE, OPT_BIND, OPT_SO_TYPE, OPT_SO_PROTOTYPE, OPT_CLOEXEC, OPT_USER, OPT_GROUP, ?OPT_FORK, */ -int +int _xioopen_unix_client(xiosingle_t *xfd, int xioflags, groups_t groups, int abstract, struct opt *opts, const char *name) { const struct opt *namedopt; diff --git a/xio.h b/xio.h index 63e8b7d..e10daf3 100644 --- a/xio.h +++ b/xio.h @@ -89,8 +89,14 @@ enum xiotag { streams */ } ; +/* Keep condition consistent with xioopts.h:GROUP_*! */ +#if WITH_SCTP +typedef uint64_t groups_t; +#define F_groups_t F_uint64_x +#else typedef uint32_t groups_t; #define F_groups_t F_uint32_x +#endif /* global XIO options/parameters */ typedef struct { diff --git a/xiohelp.c b/xiohelp.c index 26f3343..71256de 100644 --- a/xiohelp.c +++ b/xiohelp.c @@ -48,10 +48,10 @@ static const char *addressgroupnames[] = { "TERMIOS", "RANGE", "PTY", "PARENT", "UNIX", "IP4", "IP6", "INTERFACE", "UDP", "TCP", "SOCKS4", "OPENSSL", - "PROCESS", "APPL", "HTTP", "SCTP" + "PROCESS", "APPL", "HTTP", "undef", + "SCTP" } ; - /* keep consistent with xioopts.h:enum ephase ! */ static char *optionphasenames[] = { "ALL", "INIT", "EARLY", diff --git a/xioopts.c b/xioopts.c index 1731cd5..485fa46 100644 --- a/xioopts.c +++ b/xioopts.c @@ -2780,7 +2780,7 @@ groups_t _groupbits(mode_t mode) { result = GROUP_SOCKET|GROUP_SOCK_UNIX; break; #endif } - Debug2("_groupbits(%d) -> %d", mode, result); + Debug2("_groupbits("F_mode") -> "F_groups_t, mode, result); return result; } diff --git a/xioopts.h b/xioopts.h index ac36e95..2e2f808 100644 --- a/xioopts.h +++ b/xioopts.h @@ -176,10 +176,19 @@ enum e_func { #define GROUP_PROCESS 0x10000000 /* a process related option */ #define GROUP_APPL 0x20000000 /* option handled by data loop */ #define GROUP_HTTP 0x40000000 /* any HTTP client */ -#define GROUP_IP_SCTP 0x80000000U -#define GROUP_ANY (GROUP_PROCESS|GROUP_APPL) +/* Keep condition consistent with xio.h:groups_t! */ +#if WITH_SCTP +/* The following groups are not expected on systems without uint64_t */ +#define GROUP_IP_SCTP 0x0100000000U +#define GROUP_ALL 0x03ffffffffU +#else +#define GROUP_IP_SCTP 0 #define GROUP_ALL 0xffffffffU +#endif + +#define GROUP_IPAPP (GROUP_IP_UDP|GROUP_IP_TCP|GROUP_IP_SCTP) /* true: indicates one of UDP, TCP, SCTP */ +#define GROUP_ANY (GROUP_PROCESS|GROUP_APPL) /* no IP multicasts, no error queue yet */