Source-Changes-HG archive

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

[src/trunk]: src/libexec/ftpd - ensure all uses of AF_INET6 are wrapped in #i...



details:   https://anonhg.NetBSD.org/src/rev/f6fd7e6a7ad4
branches:  trunk
changeset: 499747:f6fd7e6a7ad4
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue Nov 28 09:31:29 2000 +0000

description:
- ensure all uses of AF_INET6 are wrapped in #ifdef INET6
- don't define `ALL' as a token twice in the grammar

diffstat:

 libexec/ftpd/ftpcmd.y  |  9 ++++++---
 libexec/ftpd/ftpd.c    |  8 ++++++--
 libexec/ftpd/version.h |  4 ++--
 3 files changed, 14 insertions(+), 7 deletions(-)

diffs (98 lines):

diff -r 9d76d980e673 -r f6fd7e6a7ad4 libexec/ftpd/ftpcmd.y
--- a/libexec/ftpd/ftpcmd.y     Tue Nov 28 09:11:36 2000 +0000
+++ b/libexec/ftpd/ftpcmd.y     Tue Nov 28 09:31:29 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftpcmd.y,v 1.56 2000/11/16 13:15:14 lukem Exp $        */
+/*     $NetBSD: ftpcmd.y,v 1.57 2000/11/28 09:31:29 lukem Exp $        */
 
 /*-
  * Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
@@ -83,7 +83,7 @@
 #if 0
 static char sccsid[] = "@(#)ftpcmd.y   8.3 (Berkeley) 4/6/94";
 #else
-__RCSID("$NetBSD: ftpcmd.y,v 1.56 2000/11/16 13:15:14 lukem Exp $");
+__RCSID("$NetBSD: ftpcmd.y,v 1.57 2000/11/28 09:31:29 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -134,7 +134,6 @@
 %token
        A       B       C       E       F       I
        L       N       P       R       S       T
-       ALL
 
        SP      CRLF    COMMA
 
@@ -266,8 +265,12 @@
 
        | LPRT check_login SP host_long_port6 CRLF
                {
+#ifdef INET6
                        if ($2)
                                port_check("LPRT", AF_INET6);
+#else
+                       reply(500, "IPv6 support not available.");
+#endif
                }
 
        | EPRT check_login SP STRING CRLF
diff -r 9d76d980e673 -r f6fd7e6a7ad4 libexec/ftpd/ftpd.c
--- a/libexec/ftpd/ftpd.c       Tue Nov 28 09:11:36 2000 +0000
+++ b/libexec/ftpd/ftpd.c       Tue Nov 28 09:31:29 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftpd.c,v 1.112 2000/11/24 12:56:45 itojun Exp $        */
+/*     $NetBSD: ftpd.c,v 1.113 2000/11/28 09:31:29 lukem Exp $ */
 
 /*
  * Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
@@ -109,7 +109,7 @@
 #if 0
 static char sccsid[] = "@(#)ftpd.c     8.5 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: ftpd.c,v 1.112 2000/11/24 12:56:45 itojun Exp $");
+__RCSID("$NetBSD: ftpd.c,v 1.113 2000/11/28 09:31:29 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -1950,8 +1950,10 @@
                        struct sockinet tmp;
 
                        tmp = *su;
+#ifdef INET6
                        if (tmp.su_family == AF_INET6)
                                tmp.su_scope_id = 0;
+#endif
                        if (getnameinfo((struct sockaddr *)&tmp.si_su,
                            tmp.su_len, hbuf, sizeof(hbuf), sbuf, sizeof(sbuf),
                            NI_NUMERICHOST | NI_NUMERICSERV) == 0)
@@ -2467,11 +2469,13 @@
        if (sizeof(data_dest) < res->ai_addrlen)
                goto parsefail;
        memcpy(&data_dest, res->ai_addr, res->ai_addrlen);
+#ifdef INET6
        if (his_addr.su_family == AF_INET6 &&
            data_dest.su_family == AF_INET6) {
                        /* XXX: more sanity checks! */
                data_dest.su_scope_id = his_addr.su_scope_id;
        }
+#endif
 
        if (tmp != NULL)
                free(tmp);
diff -r 9d76d980e673 -r f6fd7e6a7ad4 libexec/ftpd/version.h
--- a/libexec/ftpd/version.h    Tue Nov 28 09:11:36 2000 +0000
+++ b/libexec/ftpd/version.h    Tue Nov 28 09:31:29 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.23 2000/11/24 12:56:45 itojun Exp $      */
+/*     $NetBSD: version.h,v 1.24 2000/11/28 09:32:20 lukem Exp $       */
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,5 +36,5 @@
  */
 
 #ifndef FTPD_VERSION
-#define        FTPD_VERSION    "NetBSD-ftpd 20001124"
+#define        FTPD_VERSION    "NetBSD-ftpd 20001128"
 #endif



Home | Main Index | Thread Index | Old Index