Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin socklen_t audit. from deraadt, sync w/kame



details:   https://anonhg.NetBSD.org/src/rev/f18ea06720c0
branches:  trunk
changeset: 536117:f18ea06720c0
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sun Sep 08 01:41:12 2002 +0000

description:
socklen_t audit.  from deraadt, sync w/kame

diffstat:

 usr.sbin/faithd/faithd.c           |  10 ++++----
 usr.sbin/faithd/ftp.c              |  39 ++++++++++++++++++-------------------
 usr.sbin/faithd/prefix.c           |  28 ++++++++------------------
 usr.sbin/traceroute6/traceroute6.c |  11 +++++----
 4 files changed, 39 insertions(+), 49 deletions(-)

diffs (278 lines):

diff -r edcfad3ec8d1 -r f18ea06720c0 usr.sbin/faithd/faithd.c
--- a/usr.sbin/faithd/faithd.c  Sun Sep 08 01:40:08 2002 +0000
+++ b/usr.sbin/faithd/faithd.c  Sun Sep 08 01:41:12 2002 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: faithd.c,v 1.27 2002/08/20 23:02:44 itojun Exp $       */
-/*     $KAME: faithd.c,v 1.57 2002/08/20 23:01:00 itojun Exp $ */
+/*     $NetBSD: faithd.c,v 1.28 2002/09/08 01:41:12 itojun Exp $       */
+/*     $KAME: faithd.c,v 1.58 2002/09/08 01:12:30 itojun Exp $ */
 
 /*
  * Copyright (C) 1997 and 1998 WIDE Project.
@@ -139,7 +139,7 @@
        char path[MAXPATHLEN];
        struct sockaddr_storage me;
        struct sockaddr_storage from;
-       int melen, fromlen;
+       socklen_t melen, fromlen;
        int i;
        int error;
        const int on = 1;
@@ -348,7 +348,7 @@
 play_service(int s_wld)
 {
        struct sockaddr_storage srcaddr;
-       int len;
+       socklen_t len;
        int s_src;
        pid_t child_pid;
        fd_set rfds;
@@ -432,7 +432,7 @@
        char src[NI_MAXHOST];
        char dst6[NI_MAXHOST];
        char dst4[NI_MAXHOST];
-       int len = sizeof(dstaddr6);
+       socklen_t len = sizeof(dstaddr6);
        int s_dst, error, hport, nresvport, on = 1;
        struct timeval tv;
        struct sockaddr *sa4;
diff -r edcfad3ec8d1 -r f18ea06720c0 usr.sbin/faithd/ftp.c
--- a/usr.sbin/faithd/ftp.c     Sun Sep 08 01:40:08 2002 +0000
+++ b/usr.sbin/faithd/ftp.c     Sun Sep 08 01:41:12 2002 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: ftp.c,v 1.11 2002/08/20 23:02:44 itojun Exp $  */
-/*     $KAME: ftp.c,v 1.19 2002/08/20 23:01:01 itojun Exp $    */
+/*     $NetBSD: ftp.c,v 1.12 2002/09/08 01:41:12 itojun Exp $  */
+/*     $KAME: ftp.c,v 1.20 2002/09/08 01:12:30 itojun Exp $    */
 
 /*
  * Copyright (C) 1997 and 1998 WIDE Project.
@@ -227,7 +227,7 @@
 static int
 ftp_activeconn()
 {
-       int n;
+       socklen_t n;
        int error;
        fd_set set;
        struct timeval timeout;
@@ -276,7 +276,7 @@
 static int
 ftp_passiveconn()
 {
-       int n;
+       socklen_t len;
        int error;
        fd_set set;
        struct timeval timeout;
@@ -289,9 +289,9 @@
        FD_SET(wport6, &set);
        timeout.tv_sec = 120;
        timeout.tv_usec = 0;
-       n = sizeof(data6);
+       len = sizeof(data6);
        if (select(wport6 + 1, &set, NULL, NULL, &timeout) == 0
-        || (port6 = accept(wport6, (struct sockaddr *)&data6, &n)) < 0) {
+        || (port6 = accept(wport6, (struct sockaddr *)&data6, &len)) < 0) {
                close(wport6);
                wport6 = -1;
                syslog(LOG_INFO, "passive mode data connection failed");
@@ -325,8 +325,7 @@
 static int
 ftp_copy(int src, int dst)
 {
-       int error, atmark;
-       int n;
+       int error, atmark, n;
 
        /* OOB data handling */
        error = ioctl(src, SIOCATMARK, &atmark);
@@ -363,8 +362,8 @@
 static int
 ftp_copyresult(int src, int dst, enum state state)
 {
-       int error, atmark;
-       int n;
+       int error, atmark, n;
+       socklen_t len;
        char *param;
        int code;
        char *a, *p;
@@ -533,8 +532,8 @@
                /*
                 * addr from dst, port from wport6
                 */
-               n = sizeof(data6);
-               error = getsockname(wport6, (struct sockaddr *)&data6, &n);
+               len = sizeof(data6);
+               error = getsockname(wport6, (struct sockaddr *)&data6, &len);
                if (error == -1) {
                        close(wport6);
                        wport6 = -1;
@@ -543,8 +542,8 @@
                sin6 = (struct sockaddr_in6 *)&data6;
                port = sin6->sin6_port;
 
-               n = sizeof(data6);
-               error = getsockname(dst, (struct sockaddr *)&data6, &n);
+               len = sizeof(data6);
+               error = getsockname(dst, (struct sockaddr *)&data6, &len);
                if (error == -1) {
                        close(wport6);
                        wport6 = -1;
@@ -592,8 +591,8 @@
 static int
 ftp_copycommand(int src, int dst, enum state *state)
 {
-       int error, atmark;
-       int n;
+       int error, atmark, n;
+       socklen_t len;
        unsigned int af, hal, ho[16], pal, po[2];
        char *a, *p, *q;
        char cmd[5], *param;
@@ -708,8 +707,8 @@
 
 sendport:
                /* get ready for active data connection */
-               n = sizeof(data4);
-               error = getsockname(dst, (struct sockaddr *)&data4, &n);
+               len = sizeof(data4);
+               error = getsockname(dst, (struct sockaddr *)&data4, &len);
                if (error == -1) {
 lprtfail:
                        n = snprintf(sbuf, sizeof(sbuf),
@@ -741,8 +740,8 @@
                }
 
                /* transmit PORT */
-               n = sizeof(data4);
-               error = getsockname(wport4, (struct sockaddr *)&data4, &n);
+               len = sizeof(data4);
+               error = getsockname(wport4, (struct sockaddr *)&data4, &len);
                if (error == -1) {
                        close(wport4);
                        wport4 = -1;
diff -r edcfad3ec8d1 -r f18ea06720c0 usr.sbin/faithd/prefix.c
--- a/usr.sbin/faithd/prefix.c  Sun Sep 08 01:40:08 2002 +0000
+++ b/usr.sbin/faithd/prefix.c  Sun Sep 08 01:41:12 2002 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: prefix.c,v 1.4 2002/06/07 00:20:45 itojun Exp $        */
-/*     $KAME: prefix.c,v 1.11 2001/11/13 12:38:45 jinmei Exp $ */
+/*     $NetBSD: prefix.c,v 1.5 2002/09/08 01:41:13 itojun Exp $        */
+/*     $KAME: prefix.c,v 1.12 2002/09/08 01:14:46 itojun Exp $ */
 
 /*
  * Copyright (C) 2000 WIDE Project.
@@ -58,10 +58,7 @@
 const int niflags = NI_NUMERICHOST;
 
 static int
-prefix_set(s, prefix, slash)
-       const char *s;
-       struct prefix *prefix;
-       int slash;
+prefix_set(const char *s, struct prefix *prefix, int slash)
 {
        char *p = NULL, *q, *r;
        struct addrinfo hints, *res = NULL;
@@ -128,8 +125,7 @@
 }
 
 const char *
-prefix_string(prefix)
-       const struct prefix *prefix;
+prefix_string(const struct prefix *prefix)
 {
        static char buf[NI_MAXHOST + 20];
        char hbuf[NI_MAXHOST];
@@ -142,9 +138,7 @@
 }
 
 int
-prefix_match(prefix, sa)
-       const struct prefix *prefix;
-       const struct sockaddr *sa;
+prefix_match(const struct prefix *prefix, const struct sockaddr *sa)
 {
        struct sockaddr_storage a, b;
        char *pa, *pb;
@@ -196,8 +190,7 @@
  * 3ffe::/16 permit 10.0.0.0/8 10.1.1.1
  */
 static struct config *
-config_load1(line)
-       const char *line;
+config_load1(const char *line)
 {
        struct config *conf;
        char buf[BUFSIZ];
@@ -270,8 +263,7 @@
 }
 
 int
-config_load(configfile)
-       const char *configfile;
+config_load(const char *configfile)
 {
        FILE *fp;
        char buf[BUFSIZ];
@@ -302,8 +294,7 @@
 
 #if 0
 static void
-config_show1(conf)
-       const struct config *conf;
+config_show1(const struct config *conf)
 {
        const char *p;
 
@@ -332,8 +323,7 @@
 #endif
 
 const struct config *
-config_match(sa1, sa2)
-       struct sockaddr *sa1, *sa2;
+config_match(struct sockaddr *sa1, struct sockaddr *sa2)
 {
        static struct config conf;
        const struct config *p;
diff -r edcfad3ec8d1 -r f18ea06720c0 usr.sbin/traceroute6/traceroute6.c
--- a/usr.sbin/traceroute6/traceroute6.c        Sun Sep 08 01:40:08 2002 +0000
+++ b/usr.sbin/traceroute6/traceroute6.c        Sun Sep 08 01:41:12 2002 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: traceroute6.c,v 1.27 2002/08/30 04:02:44 onoe Exp $    */
-/*     $KAME: traceroute6.c,v 1.58 2002/08/27 00:33:39 itojun Exp $    */
+/*     $NetBSD: traceroute6.c,v 1.28 2002/09/08 01:41:13 itojun Exp $  */
+/*     $KAME: traceroute6.c,v 1.61 2002/09/08 01:28:05 itojun Exp $    */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -79,7 +79,7 @@
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: traceroute6.c,v 1.27 2002/08/30 04:02:44 onoe Exp $");
+__RCSID("$NetBSD: traceroute6.c,v 1.28 2002/09/08 01:41:13 itojun Exp $");
 #endif
 #endif
 
@@ -790,7 +790,8 @@
                freeaddrinfo(res);
        } else {
                struct sockaddr_in6 Nxt;
-               int dummy, len;
+               int dummy;
+               socklen_t len;
 
                Nxt = Dst;
                Nxt.sin6_port = htons(DUMMY_PORT);
@@ -826,7 +827,7 @@
        }
 
        {
-               int len;
+               socklen_t len;
 
                len = sizeof(Src);
                if (getsockname(sndsock, (struct sockaddr *)&Src, &len) < 0) {



Home | Main Index | Thread Index | Old Index