summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2002-09-04 20:15:20 +0000
committerdwmalone <dwmalone@FreeBSD.org>2002-09-04 20:15:20 +0000
commitd766507fcc9f46fa2396d3bd1c10f085d80da811 (patch)
tree2b0800680e962b8230f3268b363be14e428f04ba /usr.sbin
parentb1f33fc74e2b3b76887c175f8c8465fdf0df469b (diff)
downloadFreeBSD-src-d766507fcc9f46fa2396d3bd1c10f085d80da811.zip
FreeBSD-src-d766507fcc9f46fa2396d3bd1c10f085d80da811.tar.gz
Fix parsing of unix domain entries after addition of IPv6 RPC support.
PR: 40771 Submitted by: Jean-Luc Richier <Jean-Luc.Richier@imag.fr>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/inetd/inetd.c77
1 files changed, 39 insertions, 38 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index b8f4fc4..4e9b866 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -1748,52 +1748,53 @@ more:
}
}
sep->se_nomapped = 0;
- while (isdigit(sep->se_proto[strlen(sep->se_proto) - 1])) {
-#ifdef INET6
- if (sep->se_proto[strlen(sep->se_proto) - 1] == '6') {
- sep->se_proto[strlen(sep->se_proto) - 1] = '\0';
- v6bind = 1;
- continue;
- }
-#endif
- if (sep->se_proto[strlen(sep->se_proto) - 1] == '4') {
- sep->se_proto[strlen(sep->se_proto) - 1] = '\0';
- v4bind = 1;
- continue;
- }
- /* illegal version num */
- syslog(LOG_ERR, "bad IP version for %s", sep->se_proto);
- freeconfig(sep);
- goto more;
- }
if (strcmp(sep->se_proto, "unix") == 0) {
sep->se_family = AF_UNIX;
- } else
+ } else {
+ while (isdigit(sep->se_proto[strlen(sep->se_proto) - 1])) {
#ifdef INET6
- if (v6bind != 0 && no_v6bind != 0) {
- syslog(LOG_INFO, "IPv6 bind is ignored for %s",
- sep->se_service);
- if (v4bind && no_v4bind == 0)
- v6bind = 0;
- else {
+ if (sep->se_proto[strlen(sep->se_proto) - 1] == '6') {
+ sep->se_proto[strlen(sep->se_proto) - 1] = '\0';
+ v6bind = 1;
+ continue;
+ }
+#endif
+ if (sep->se_proto[strlen(sep->se_proto) - 1] == '4') {
+ sep->se_proto[strlen(sep->se_proto) - 1] = '\0';
+ v4bind = 1;
+ continue;
+ }
+ /* illegal version num */
+ syslog(LOG_ERR, "bad IP version for %s", sep->se_proto);
freeconfig(sep);
goto more;
}
- }
- if (v6bind != 0) {
- sep->se_family = AF_INET6;
- if (v4bind == 0 || no_v4bind != 0)
- sep->se_nomapped = 1;
- } else
-#endif
- { /* default to v4 bind if not v6 bind */
- if (no_v4bind != 0) {
- syslog(LOG_NOTICE, "IPv4 bind is ignored for %s",
+#ifdef INET6
+ if (v6bind != 0 && no_v6bind != 0) {
+ syslog(LOG_INFO, "IPv6 bind is ignored for %s",
sep->se_service);
- freeconfig(sep);
- goto more;
+ if (v4bind && no_v4bind == 0)
+ v6bind = 0;
+ else {
+ freeconfig(sep);
+ goto more;
+ }
+ }
+ if (v6bind != 0) {
+ sep->se_family = AF_INET6;
+ if (v4bind == 0 || no_v4bind != 0)
+ sep->se_nomapped = 1;
+ } else
+#endif
+ { /* default to v4 bind if not v6 bind */
+ if (no_v4bind != 0) {
+ syslog(LOG_NOTICE, "IPv4 bind is ignored for %s",
+ sep->se_service);
+ freeconfig(sep);
+ goto more;
+ }
+ sep->se_family = AF_INET;
}
- sep->se_family = AF_INET;
}
/* init ctladdr */
switch(sep->se_family) {
OpenPOWER on IntegriCloud