Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/pim6dd $KAME$ cleanup. address PR 11616 (CMSG_SPAC...



details:   https://anonhg.NetBSD.org/src/rev/1837436a2596
branches:  trunk
changeset: 500041:1837436a2596
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Dec 04 07:05:47 2000 +0000

description:
$KAME$ cleanup.  address PR 11616 (CMSG_SPACE should be CMSG_LEN).
couple of stability/protocol conformance fixes.  sync with kame.

diffstat:

 usr.sbin/pim6dd/callout.c    |   3 ++-
 usr.sbin/pim6dd/config.c     |   5 ++---
 usr.sbin/pim6dd/debug.c      |   7 +++----
 usr.sbin/pim6dd/debug.h      |   5 ++---
 usr.sbin/pim6dd/defs.h       |   5 ++---
 usr.sbin/pim6dd/inet6.c      |   3 ++-
 usr.sbin/pim6dd/kern.c       |   5 ++---
 usr.sbin/pim6dd/main.c       |   5 ++---
 usr.sbin/pim6dd/mld6.c       |  25 ++++++++++++-------------
 usr.sbin/pim6dd/mld6.h       |   3 ++-
 usr.sbin/pim6dd/mld6_proto.c |   5 ++---
 usr.sbin/pim6dd/mrt.c        |   5 ++---
 usr.sbin/pim6dd/mrt.h        |   5 ++---
 usr.sbin/pim6dd/pathnames.h  |   5 ++---
 usr.sbin/pim6dd/pim6.c       |   7 +++----
 usr.sbin/pim6dd/pim6_proto.c |   5 ++---
 usr.sbin/pim6dd/pim6dd.8     |  12 +++++++++---
 usr.sbin/pim6dd/pimdd.h      |   5 ++---
 usr.sbin/pim6dd/route.c      |   5 ++---
 usr.sbin/pim6dd/routesock.c  |   5 ++---
 usr.sbin/pim6dd/timer.c      |   5 ++---
 usr.sbin/pim6dd/trace.c      |   5 ++---
 usr.sbin/pim6dd/trace.h      |   5 ++---
 usr.sbin/pim6dd/vers.c       |   3 ++-
 usr.sbin/pim6dd/vif.c        |   5 ++---
 usr.sbin/pim6dd/vif.h        |   5 ++---
 26 files changed, 71 insertions(+), 82 deletions(-)

diffs (truncated from 561 to 300 lines):

diff -r 3a3b9e739867 -r 1837436a2596 usr.sbin/pim6dd/callout.c
--- a/usr.sbin/pim6dd/callout.c Mon Dec 04 07:04:37 2000 +0000
+++ b/usr.sbin/pim6dd/callout.c Mon Dec 04 07:05:47 2000 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: callout.c,v 1.1 1999/07/17 14:06:24 itojun Exp $       */
+/*     $NetBSD: callout.c,v 1.2 2000/12/04 07:05:47 itojun Exp $       */
+/*     $KAME: callout.c,v 1.2 2000/12/04 06:33:09 itojun Exp $ */
 
 /*
  * The mrouted program is covered by the license in the accompanying file
diff -r 3a3b9e739867 -r 1837436a2596 usr.sbin/pim6dd/config.c
--- a/usr.sbin/pim6dd/config.c  Mon Dec 04 07:04:37 2000 +0000
+++ b/usr.sbin/pim6dd/config.c  Mon Dec 04 07:05:47 2000 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: config.c,v 1.3 2000/02/25 06:30:54 itojun Exp $        */
+/*     $NetBSD: config.c,v 1.4 2000/12/04 07:05:47 itojun Exp $        */
+/*     $KAME: config.c,v 1.7 2000/12/04 06:33:09 itojun Exp $  */
 
 /*
  *  Copyright (c) 1998 by the University of Southern California.
@@ -35,8 +36,6 @@
 /*
  *  Questions concerning this software should be directed to 
  *  Pavlin Ivanov Radoslavov (pavlin%catarina.usc.edu@localhost)
- *
- *  KAME Id: config.c,v 1.6 2000/02/23 16:10:26 itojun Exp
  */
 /*
  * Part of this program has been derived from mrouted.
diff -r 3a3b9e739867 -r 1837436a2596 usr.sbin/pim6dd/debug.c
--- a/usr.sbin/pim6dd/debug.c   Mon Dec 04 07:04:37 2000 +0000
+++ b/usr.sbin/pim6dd/debug.c   Mon Dec 04 07:05:47 2000 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: debug.c,v 1.8 2000/10/11 20:23:54 is Exp $     */
+/*     $NetBSD: debug.c,v 1.9 2000/12/04 07:05:47 itojun Exp $ */
+/*     $KAME: debug.c,v 1.11 2000/12/04 06:33:09 itojun Exp $  */
 
 /*
  *  Copyright (c) 1998 by the University of Southern California.
@@ -35,8 +36,6 @@
 /*
  *  Questions concerning this software should be directed to 
  *  Pavlin Ivanov Radoslavov (pavlin%catarina.usc.edu@localhost)
- *
- *  KAME Id: debug.c,v 1.8 2000/05/18 12:47:59 itojun Exp
  */
 /*
  * Part of this program has been derived from mrouted.
@@ -69,7 +68,7 @@
 static char cachefilename[] = _PATH_PIM6D_CACHE; /* TODO: notused */
 
 static char *sec2str __P((time_t));
-       
+
 static char *
 sec2str(total)
        time_t total;
diff -r 3a3b9e739867 -r 1837436a2596 usr.sbin/pim6dd/debug.h
--- a/usr.sbin/pim6dd/debug.h   Mon Dec 04 07:04:37 2000 +0000
+++ b/usr.sbin/pim6dd/debug.h   Mon Dec 04 07:05:47 2000 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: debug.h,v 1.2 1999/08/19 17:31:06 itojun Exp $ */
+/*     $NetBSD: debug.h,v 1.3 2000/12/04 07:05:47 itojun Exp $ */
+/*     $KAME: debug.h,v 1.2 2000/12/04 06:33:09 itojun Exp $   */
 
 /*
  *  Copyright (c) 1998 by the University of Southern California.
@@ -35,8 +36,6 @@
 /*
  *  Questions concerning this software should be directed to 
  *  Pavlin Ivanov Radoslavov (pavlin%catarina.usc.edu@localhost)
- *
- *  KAME Id: debug.h,v 1.1.1.1 1999/08/08 23:30:52 itojun Exp
  */
 /*
  * Part of this program has been derived from mrouted.
diff -r 3a3b9e739867 -r 1837436a2596 usr.sbin/pim6dd/defs.h
--- a/usr.sbin/pim6dd/defs.h    Mon Dec 04 07:04:37 2000 +0000
+++ b/usr.sbin/pim6dd/defs.h    Mon Dec 04 07:05:47 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: defs.h,v 1.6 2000/10/06 00:13:02 itojun Exp $  */
+/*     $KAME: defs.h,v 1.10 2000/12/04 06:33:09 itojun Exp $   */
 
 /*
  *  Copyright (c) 1998 by the University of Oregon.
@@ -34,8 +34,6 @@
 /*
  *  Questions concerning this software should be directed to 
  *  Kurt Windisch (kurtw%antc.uoregon.edu@localhost)
- *
- *  KAME Id: defs.h,v 1.7 2000/04/30 13:01:36 itojun Exp
  */
 /*
  * Part of this program has been derived from PIM sparse-mode pimd.
@@ -65,6 +63,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/ioctl.h>
+#include <sys/queue.h>
 #include <fcntl.h>
 #if ((defined(SYSV)) || (defined(__bsdi__)) || ((defined SunOS) && (SunOS < 50)))
 #include <sys/sockio.h>
diff -r 3a3b9e739867 -r 1837436a2596 usr.sbin/pim6dd/inet6.c
--- a/usr.sbin/pim6dd/inet6.c   Mon Dec 04 07:04:37 2000 +0000
+++ b/usr.sbin/pim6dd/inet6.c   Mon Dec 04 07:05:47 2000 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: inet6.c,v 1.2 1999/08/19 17:31:06 itojun Exp $ */
+/*     $NetBSD: inet6.c,v 1.3 2000/12/04 07:05:47 itojun Exp $ */
+/*     $KAME: inet6.c,v 1.3 2000/12/04 06:33:09 itojun Exp $   */
 
 /*
  * Copyright (C) 1998 WIDE Project.
diff -r 3a3b9e739867 -r 1837436a2596 usr.sbin/pim6dd/kern.c
--- a/usr.sbin/pim6dd/kern.c    Mon Dec 04 07:04:37 2000 +0000
+++ b/usr.sbin/pim6dd/kern.c    Mon Dec 04 07:05:47 2000 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: kern.c,v 1.2 1999/08/19 17:31:06 itojun Exp $  */
+/*     $NetBSD: kern.c,v 1.3 2000/12/04 07:05:48 itojun Exp $  */
+/*     $KAME: kern.c,v 1.2 2000/12/04 06:33:10 itojun Exp $    */
 
 /*
  *  Copyright (c) 1998 by the University of Southern California.
@@ -35,8 +36,6 @@
 /*
  *  Questions concerning this software should be directed to 
  *  Pavlin Ivanov Radoslavov (pavlin%catarina.usc.edu@localhost)
- *
- *  KAME Id: kern.c,v 1.1.1.1 1999/08/08 23:30:52 itojun Exp
  */
 /*
  * Part of this program has been derived from mrouted.
diff -r 3a3b9e739867 -r 1837436a2596 usr.sbin/pim6dd/main.c
--- a/usr.sbin/pim6dd/main.c    Mon Dec 04 07:04:37 2000 +0000
+++ b/usr.sbin/pim6dd/main.c    Mon Dec 04 07:05:47 2000 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: main.c,v 1.4 2000/10/06 00:13:02 itojun Exp $  */
+/*     $NetBSD: main.c,v 1.5 2000/12/04 07:05:48 itojun Exp $  */
+/*     $KAME: main.c,v 1.5 2000/12/04 06:33:10 itojun Exp $    */
 
 /*
  *  Copyright (c) 1998 by the University of Oregon.
@@ -34,8 +35,6 @@
 /*
  *  Questions concerning this software should be directed to 
  *  Kurt Windisch (kurtw%antc.uoregon.edu@localhost)
- *
- *  KAME Id: main.c,v 1.3 2000/03/26 19:11:41 sumikawa Exp
  */
 /*
  * Part of this program has been derived from PIM sparse-mode pimd.
diff -r 3a3b9e739867 -r 1837436a2596 usr.sbin/pim6dd/mld6.c
--- a/usr.sbin/pim6dd/mld6.c    Mon Dec 04 07:04:37 2000 +0000
+++ b/usr.sbin/pim6dd/mld6.c    Mon Dec 04 07:05:47 2000 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: mld6.c,v 1.8 2000/10/06 00:13:02 itojun Exp $  */
+/*     $NetBSD: mld6.c,v 1.9 2000/12/04 07:05:48 itojun Exp $  */
+/*     $KAME: mld6.c,v 1.17 2000/12/04 06:33:10 itojun Exp $   */
 
 /*
  * Copyright (C) 1998 WIDE Project.
@@ -64,8 +65,6 @@
 /*
  *  Questions concerning this software should be directed to 
  *  Pavlin Ivanov Radoslavov (pavlin%catarina.usc.edu@localhost)
- *
- *  KAME Id: mld6.c,v 1.13 2000/04/12 07:34:38 jinmei Exp
  */
 /*
  * Part of this program has been derived from mrouted.
@@ -151,7 +150,13 @@
     k_set_rcvbuf(mld6_socket, SO_RECV_BUF_SIZE_MAX,
                 SO_RECV_BUF_SIZE_MIN); /* lots of input buffering */
     k_set_hlim(mld6_socket, MINHLIM);  /* restrict multicasts to one hop */
+#if 0
+    /*
+     * Since we don't have to handle DMVRP messages via the MLD6 socket,
+     * we can just let outgoing multicast packets be loop-backed.
+     */
     k_set_loop(mld6_socket, FALSE);    /* disable multicast loopback     */
+#endif
 
     /* address initialization */
     allnodes_group.sin6_addr = in6addr_linklocal_allnodes;
@@ -307,7 +312,7 @@
        }
 
        /* TODO: too noisy. Remove it? */
-#undef NOSUCHDEF
+//#define NOSUCHDEF
 #ifdef NOSUCHDEF
        IF_DEBUG(DEBUG_PKT | debug_kind(IPPROTO_ICMPV6, mldh->mld6_type,
                                        mldh->mld6_code))
@@ -457,7 +462,7 @@
            if (ifindex != -1 || src) {
                    struct in6_pktinfo *pktinfo;
 
-                   cmsgp->cmsg_len = CMSG_SPACE(sizeof(struct in6_pktinfo));
+                   cmsgp->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
                    cmsgp->cmsg_level = IPPROTO_IPV6;
                    cmsgp->cmsg_type = IPV6_PKTINFO;
                    pktinfo = (struct in6_pktinfo *)CMSG_DATA(cmsgp);
@@ -473,7 +478,7 @@
                    int currentlen;
                    void *hbhbuf, *optp = NULL;
 
-                   cmsgp->cmsg_len = CMSG_SPACE(hbhlen);
+                   cmsgp->cmsg_len = CMSG_LEN(hbhlen);
                    cmsgp->cmsg_level = IPPROTO_IPV6;
                    cmsgp->cmsg_type = IPV6_HOPOPTS;
                    hbhbuf = CMSG_DATA(cmsgp);
@@ -517,15 +522,11 @@
     int index, delay, alert;
     int datalen;               /* for trace packets only */
 {
-    int setloop = 0;
     struct sockaddr_in6 *dstp;
        
     make_mld6_msg(type, code, src, dst, group, index, delay, datalen, alert);
     dstp = (struct sockaddr_in6 *)sndmh.msg_name;
-    if (IN6_ARE_ADDR_EQUAL(&dstp->sin6_addr, &allnodes_group.sin6_addr)) {
-       setloop = 1;
-       k_set_loop(mld6_socket, TRUE);
-    }
+
     if (sendmsg(mld6_socket, &sndmh, 0) < 0) {
        if (errno == ENETDOWN)
            check_vif_state();
@@ -536,8 +537,6 @@
                src ? inet6_fmt(&src->sin6_addr) : "(unspec)",
                ifindex2str(index));
 
-       if (setloop)
-           k_set_loop(mld6_socket, FALSE);
        return;
     }
     
diff -r 3a3b9e739867 -r 1837436a2596 usr.sbin/pim6dd/mld6.h
--- a/usr.sbin/pim6dd/mld6.h    Mon Dec 04 07:04:37 2000 +0000
+++ b/usr.sbin/pim6dd/mld6.h    Mon Dec 04 07:05:47 2000 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: mld6.h,v 1.2 2000/05/19 10:43:42 itojun Exp $  */
+/*     $NetBSD: mld6.h,v 1.3 2000/12/04 07:05:48 itojun Exp $  */
+/*     $KAME: mld6.h,v 1.3 2000/12/04 06:33:10 itojun Exp $    */
 
 /*
  * Copyright (C) 1998 WIDE Project.
diff -r 3a3b9e739867 -r 1837436a2596 usr.sbin/pim6dd/mld6_proto.c
--- a/usr.sbin/pim6dd/mld6_proto.c      Mon Dec 04 07:04:37 2000 +0000
+++ b/usr.sbin/pim6dd/mld6_proto.c      Mon Dec 04 07:05:47 2000 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: mld6_proto.c,v 1.5 2000/10/06 00:13:02 itojun Exp $    */
+/*     $NetBSD: mld6_proto.c,v 1.6 2000/12/04 07:05:48 itojun Exp $    */
+/*     $KAME: mld6_proto.c,v 1.6 2000/12/04 06:33:10 itojun Exp $      */
 
 /*
  * Copyright (C) 1998 WIDE Project.
@@ -63,8 +64,6 @@
 /*
  *  Questions concerning this software should be directed to 
  *  Kurt Windisch (kurtw%antc.uoregon.edu@localhost)
- *
- *  KAME Id: mld6_proto.c,v 1.4 2000/05/05 12:38:30 jinmei Exp
  */
 /*
  * Part of this program has been derived from PIM sparse-mode pimd.
diff -r 3a3b9e739867 -r 1837436a2596 usr.sbin/pim6dd/mrt.c
--- a/usr.sbin/pim6dd/mrt.c     Mon Dec 04 07:04:37 2000 +0000
+++ b/usr.sbin/pim6dd/mrt.c     Mon Dec 04 07:05:47 2000 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: mrt.c,v 1.5 2000/05/19 10:43:42 itojun Exp $   */
+/*     $NetBSD: mrt.c,v 1.6 2000/12/04 07:05:48 itojun Exp $   */
+/*     $KAME: mrt.c,v 1.4 2000/12/04 06:33:10 itojun Exp $     */
 
 /*
  *  Copyright (c) 1998 by the University of Oregon.
@@ -34,8 +35,6 @@
 /*
  *  Questions concerning this software should be directed to 
  *  Kurt Windisch (kurtw%antc.uoregon.edu@localhost)
- *
- *  KAME Id: mrt.c,v 1.3 2000/05/18 16:09:39 itojun Exp
  */
 /*
  * Part of this program has been derived from PIM sparse-mode pimd.
diff -r 3a3b9e739867 -r 1837436a2596 usr.sbin/pim6dd/mrt.h
--- a/usr.sbin/pim6dd/mrt.h     Mon Dec 04 07:04:37 2000 +0000
+++ b/usr.sbin/pim6dd/mrt.h     Mon Dec 04 07:05:47 2000 +0000
@@ -1,4 +1,5 @@
-/*     $NetBSD: mrt.h,v 1.3 1999/09/03 04:49:24 itojun Exp $   */
+/*     $NetBSD: mrt.h,v 1.4 2000/12/04 07:05:48 itojun Exp $   */
+/*     $KAME: mrt.h,v 1.3 2000/12/04 06:33:10 itojun Exp $     */
 
 /*
  *  Copyright (c) 1998 by the University of Oregon.
@@ -34,8 +35,6 @@
 /*
  *  Questions concerning this software should be directed to 
  *  Kurt Windisch (kurtw%antc.uoregon.edu@localhost)
- *
- *  KAME Id: mrt.h,v 1.2 1999/08/24 10:04:56 jinmei Exp



Home | Main Index | Thread Index | Old Index