Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/inetd permit square-bracket notation (as in RFC2732...



details:   https://anonhg.NetBSD.org/src/rev/da5cdd9deeec
branches:  trunk
changeset: 494549:da5cdd9deeec
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sat Jul 08 01:55:24 2000 +0000

description:
permit square-bracket notation (as in RFC2732) for the first element
in inetd.conf.  otherwise, we'll have (minor) problem putting IPv6 address in.
sync with kame.

[::1]:ftp stream tcp6 nowait root /usr/libexec/ftpd ftpd -ll

diffstat:

 usr.sbin/inetd/inetd.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r d0f1854081fd -r da5cdd9deeec usr.sbin/inetd/inetd.c
--- a/usr.sbin/inetd/inetd.c    Sat Jul 08 01:24:35 2000 +0000
+++ b/usr.sbin/inetd/inetd.c    Sat Jul 08 01:55:24 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inetd.c,v 1.68 2000/07/07 14:56:45 itojun Exp $        */
+/*     $NetBSD: inetd.c,v 1.69 2000/07/08 01:55:24 itojun Exp $        */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
 #if 0
 static char sccsid[] = "@(#)inetd.c    8.4 (Berkeley) 4/13/94";
 #else
-__RCSID("$NetBSD: inetd.c,v 1.68 2000/07/07 14:56:45 itojun Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.69 2000/07/08 01:55:24 itojun Exp $");
 #endif
 #endif /* not lint */
 
@@ -1350,7 +1350,11 @@
        hostdelim = strrchr(arg, ':');
        if (hostdelim) {
                *hostdelim = '\0';
-               sep->se_hostaddr = newstr(arg);
+               if (arg[0] == '[' && hostdelim > arg && hostdelim[-1] == ']') {
+                       hostdelim[-1] = '\0';
+                       sep->se_hostaddr = newstr(arg + 1);
+               } else
+                       sep->se_hostaddr = newstr(arg);
                arg = hostdelim + 1;
                /*
                 * If the line is of the form `host:', then just change the



Home | Main Index | Thread Index | Old Index