summaryrefslogtreecommitdiffstats
path: root/usr.sbin/inetd
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2002-09-04 20:31:53 +0000
committerdwmalone <dwmalone@FreeBSD.org>2002-09-04 20:31:53 +0000
commita8ad3be6d583d69ffbaf65535072e91df5337a0f (patch)
treea1542bcd7194c966780efdd1ff3903f1943e055b /usr.sbin/inetd
parentd766507fcc9f46fa2396d3bd1c10f085d80da811 (diff)
downloadFreeBSD-src-a8ad3be6d583d69ffbaf65535072e91df5337a0f.zip
FreeBSD-src-a8ad3be6d583d69ffbaf65535072e91df5337a0f.tar.gz
Swap sense of no_v[46]bind variables and rename as v[46]bind_ok -
this avoids some double negatives which are a bit difficult to parse. Always tread v[46]bind{,_ok} as booleans.
Diffstat (limited to 'usr.sbin/inetd')
-rw-r--r--usr.sbin/inetd/inetd.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index 4e9b866..ad779a9 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -264,10 +264,10 @@ struct servent *sp;
struct rpcent *rpc;
char *hostname = NULL;
struct sockaddr_in *bind_sa4;
-int no_v4bind = 1;
+int v4bind_ok = 0;
#ifdef INET6
struct sockaddr_in6 *bind_sa6;
-int no_v6bind = 1;
+int v6bind_ok = 0;
#endif
int signalpipe[2];
#ifdef SANITY_CHECK
@@ -408,34 +408,34 @@ main(int argc, char **argv)
}
switch (res->ai_addr->sa_family) {
case AF_INET:
- if (no_v4bind == 0)
+ if (v4bind_ok)
continue;
bind_sa4 = (struct sockaddr_in *)res->ai_addr;
/* init port num in case servname is dummy */
bind_sa4->sin_port = 0;
- no_v4bind = 0;
+ v4bind_ok = 1;
continue;
#ifdef INET6
case AF_INET6:
- if (no_v6bind == 0)
+ if (v6bind_ok)
continue;
bind_sa6 = (struct sockaddr_in6 *)res->ai_addr;
/* init port num in case servname is dummy */
bind_sa6->sin6_port = 0;
- no_v6bind = 0;
+ v6bind_ok = 1;
continue;
#endif
}
- if (no_v4bind == 0
+ if (v4bind_ok
#ifdef INET6
- && no_v6bind == 0
+ && v6bind_ok
#endif
)
break;
} while ((res = res->ai_next) != NULL);
- if (no_v4bind != 0
+ if (!v4bind_ok
#ifdef INET6
- && no_v6bind != 0
+ && !v6bind_ok
#endif
) {
syslog(LOG_ERR, "-a %s: unknown address family", hostname);
@@ -481,7 +481,7 @@ main(int argc, char **argv)
for (i = 0; i < PERIPSIZE; ++i)
LIST_INIT(&proctable[i]);
- if (!no_v4bind) {
+ if (v4bind_ok) {
udpconf = getnetconfigent("udp");
tcpconf = getnetconfigent("tcp");
if (udpconf == NULL || tcpconf == NULL) {
@@ -490,7 +490,7 @@ main(int argc, char **argv)
}
}
#ifdef INET6
- if (!no_v6bind) {
+ if (v6bind_ok) {
udp6conf = getnetconfigent("udp6");
tcp6conf = getnetconfigent("tcp6");
if (udp6conf == NULL || tcp6conf == NULL) {
@@ -1053,14 +1053,14 @@ config(void)
}
switch (sep->se_family) {
case AF_INET:
- if (no_v4bind != 0) {
+ if (!v4bind_ok) {
sep->se_fd = -1;
continue;
}
break;
#ifdef INET6
case AF_INET6:
- if (no_v6bind != 0) {
+ if (!v6bind_ok) {
sep->se_fd = -1;
continue;
}
@@ -1770,24 +1770,24 @@ more:
goto more;
}
#ifdef INET6
- if (v6bind != 0 && no_v6bind != 0) {
+ if (v6bind && !v6bind_ok) {
syslog(LOG_INFO, "IPv6 bind is ignored for %s",
sep->se_service);
- if (v4bind && no_v4bind == 0)
+ if (v4bind && v4bind_ok)
v6bind = 0;
else {
freeconfig(sep);
goto more;
}
}
- if (v6bind != 0) {
+ if (v6bind) {
sep->se_family = AF_INET6;
- if (v4bind == 0 || no_v4bind != 0)
+ if (!v4bind || !v4bind_ok)
sep->se_nomapped = 1;
} else
#endif
{ /* default to v4 bind if not v6 bind */
- if (no_v4bind != 0) {
+ if (!v4bind_ok) {
syslog(LOG_NOTICE, "IPv4 bind is ignored for %s",
sep->se_service);
freeconfig(sep);
OpenPOWER on IntegriCloud