Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/ftp from itojun: better fix for previous (doesn't ne...



details:   https://anonhg.NetBSD.org/src/rev/1f05b565df4f
branches:  trunk
changeset: 487694:1f05b565df4f
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sun Jun 11 15:15:52 2000 +0000

description:
from itojun: better fix for previous (doesn't need in_addr_t or u_int32_t)

diffstat:

 usr.bin/ftp/ftp.c     |  18 ++++++++----------
 usr.bin/ftp/version.h |   4 ++--
 2 files changed, 10 insertions(+), 12 deletions(-)

diffs (69 lines):

diff -r 591d6f8a844e -r 1f05b565df4f usr.bin/ftp/ftp.c
--- a/usr.bin/ftp/ftp.c Sun Jun 11 14:31:11 2000 +0000
+++ b/usr.bin/ftp/ftp.c Sun Jun 11 15:15:52 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftp.c,v 1.99 2000/06/11 02:12:05 lukem Exp $   */
+/*     $NetBSD: ftp.c,v 1.100 2000/06/11 15:15:52 lukem Exp $  */
 
 /*-
  * Copyright (c) 1996-2000 The NetBSD Foundation, Inc.
@@ -103,7 +103,7 @@
 #if 0
 static char sccsid[] = "@(#)ftp.c      8.6 (Berkeley) 10/27/94";
 #else
-__RCSID("$NetBSD: ftp.c,v 1.99 2000/06/11 02:12:05 lukem Exp $");
+__RCSID("$NetBSD: ftp.c,v 1.100 2000/06/11 15:15:52 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -1498,6 +1498,7 @@
 #define        pack4(var, off) \
        (((var[(off) + 0] & 0xff) << 24) | ((var[(off) + 1] & 0xff) << 16) | \
         ((var[(off) + 2] & 0xff) << 8) | ((var[(off) + 3] & 0xff) << 0))
+#define        UC(b)   (((int)b)&0xff)
 
                /*
                 * What we've got at this point is a string of comma separated
@@ -1596,12 +1597,11 @@
                                data_addr.su_family = AF_INET6;
                                data_addr.su_len = sizeof(struct sockaddr_in6);
                            {
-                               in_addr_t *p32;
-                               p32 = (in_addr_t *)&data_addr.su_sin6.sin6_addr;
-                               p32[0] = htonl(pack4(addr, 0));
-                               p32[1] = htonl(pack4(addr, 4));
-                               p32[2] = htonl(pack4(addr, 8));
-                               p32[3] = htonl(pack4(addr, 12));
+                               int i;
+                               for (i = 0; i < sizeof(struct in6_addr); i++) {
+                                       data_addr.su_sin6.sin6_addr.s6_addr[i] =
+                                           UC(addr[i]);
+                               }
                            }
                                data_addr.su_port = htons(pack2(port, 0));
                                break;
@@ -1699,8 +1699,6 @@
        if (xlisten(data, 1) < 0)
                warn("listen");
 
-#define        UC(b)   (((int)b)&0xff)
-
        if (sendport) {
 #ifdef INET6
                char hname[INET6_ADDRSTRLEN];
diff -r 591d6f8a844e -r 1f05b565df4f usr.bin/ftp/version.h
--- a/usr.bin/ftp/version.h     Sun Jun 11 14:31:11 2000 +0000
+++ b/usr.bin/ftp/version.h     Sun Jun 11 15:15:52 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.12 2000/06/11 02:12:06 lukem Exp $       */
+/*     $NetBSD: version.h,v 1.13 2000/06/11 15:17:11 lukem Exp $       */
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -40,5 +40,5 @@
 #endif
 
 #ifndef FTP_VERSION
-#define        FTP_VERSION     "20000611"
+#define        FTP_VERSION     "20000612"
 #endif



Home | Main Index | Thread Index | Old Index