$KAME$ cleanup. address PR 11616 (CMSG_SPACE should be CMSG_LEN).

couple of stability/protocol conformance fixes.  sync with kame.
This commit is contained in:
itojun 2000-12-04 07:05:47 +00:00
parent a2ca80c86b
commit b1ba1c6a53
26 changed files with 71 additions and 82 deletions

View File

@ -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

View File

@ -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)
*
* KAME Id: config.c,v 1.6 2000/02/23 16:10:26 itojun Exp
*/
/*
* Part of this program has been derived from mrouted.

View File

@ -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)
*
* KAME Id: debug.c,v 1.8 2000/05/18 12:47:59 itojun Exp
*/
/*
* Part of this program has been derived from mrouted.

View File

@ -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)
*
* 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.

View File

@ -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)
*
* 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>

View File

@ -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.

View File

@ -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)
*
* 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.

View File

@ -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)
*
* 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.

View File

@ -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)
*
* 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 @@ init_mld6()
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 @@ int recvlen;
}
/* 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 @@ make_mld6_msg(type, code, src, dst, group, ifindex, delay, datalen, alert)
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 @@ make_mld6_msg(type, code, src, dst, group, ifindex, delay, datalen, alert)
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 @@ send_mld6(type, code, src, dst, group, index, delay, datalen, alert)
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 @@ send_mld6(type, code, src, dst, group, index, delay, datalen, alert)
src ? inet6_fmt(&src->sin6_addr) : "(unspec)",
ifindex2str(index));
if (setloop)
k_set_loop(mld6_socket, FALSE);
return;
}

View File

@ -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.

View File

@ -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)
*
* 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.

View File

@ -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)
*
* 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.

View File

@ -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)
*
* KAME Id: mrt.h,v 1.2 1999/08/24 10:04:56 jinmei Exp
*/
/*
* Part of this program has been derived from PIM sparse-mode pimd.

View File

@ -1,4 +1,5 @@
/* $NetBSD: pathnames.h,v 1.4 1999/12/16 05:55:53 itojun Exp $ */
/* $NetBSD: pathnames.h,v 1.5 2000/12/04 07:05:48 itojun Exp $ */
/* $KAME: pathnames.h,v 1.3 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)
*
* KAME Id: pathnames.h,v 1.2 1999/12/16 05:36:37 jinmei Exp
*/
/*
* Part of this program has been derived from mrouted.

View File

@ -1,4 +1,5 @@
/* $NetBSD: pim6.c,v 1.5 2000/05/19 10:43:43 itojun Exp $ */
/* $NetBSD: pim6.c,v 1.6 2000/12/04 07:05:48 itojun Exp $ */
/* $KAME: pim6.c,v 1.8 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
* Pavlin Ivanov Radoslavov (pavlin@catarina.usc.edu)
*
* KAME Id: pim6.c,v 1.6 2000/03/07 02:23:50 jinmei Exp
*/
#include "defs.h"
@ -132,7 +131,7 @@ init_pim6()
sndmh.msg_controllen = sndcmsglen;
/* initilization cmsg for specifing outgoing interfaces and source */
cmsgp=(struct cmsghdr *)sndcmsgbuf;
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;
sndpktinfo = (struct in6_pktinfo *)CMSG_DATA(cmsgp);

View File

@ -1,4 +1,5 @@
/* $NetBSD: pim6_proto.c,v 1.6 2000/10/06 00:13:02 itojun Exp $ */
/* $NetBSD: pim6_proto.c,v 1.7 2000/12/04 07:05:48 itojun Exp $ */
/* $KAME: pim6_proto.c,v 1.7 2000/12/04 06:33:10 itojun Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@ -62,8 +63,6 @@
/*
* Questions concerning this software should be directed to
* Kurt Windisch (kurtw@antc.uoregon.edu)
*
* KAME Id: pim6_proto.c,v 1.5 2000/04/30 10:50:31 jinmei Exp
*/
/*
* Part of this program has been derived from PIM sparse-mode pimd.

View File

@ -1,4 +1,5 @@
.\" $NetBSD: pim6dd.8,v 1.7 2000/11/07 06:43:37 lukem Exp $
.\" $NetBSD: pim6dd.8,v 1.8 2000/12/04 07:05:48 itojun Exp $
.\" $KAME: pim6dd.8,v 1.9 2000/12/04 06:36:04 itojun Exp $
.\"
.\" Copyright (C) 1998 WIDE Project.
.\" All rights reserved.
@ -27,8 +28,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" KAME Id: pim6dd.8,v 1.4 2000/05/05 14:43:18 sumikawa Exp
.\"
.Dd Nov 17, 1998
.Dt PIM6DD 8
.Os
@ -114,4 +113,11 @@ daemon needs to run on the system.
The kernel unicast routing table is periodically polled by
.Nm
in order to follow changes of existing unicast routes.
.Pp
.Nm
must be used on an IPv6 router.
Be sure to set
.Li net.inet6.ip6.forwarding
variable to 1 with
.Xr sysctl 8 .
.\"

View File

@ -1,4 +1,5 @@
/* $NetBSD: pimdd.h,v 1.2 1999/08/19 17:31:07 itojun Exp $ */
/* $NetBSD: pimdd.h,v 1.3 2000/12/04 07:05:49 itojun Exp $ */
/* $KAME: pimdd.h,v 1.2 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)
*
* KAME Id: pimdd.h,v 1.1.1.1 1999/08/08 23:30:53 itojun Exp
*/
/*
* Part of this program has been derived from PIM sparse-mode pimd.

View File

@ -1,4 +1,5 @@
/* $NetBSD: route.c,v 1.4 1999/12/10 06:13:32 itojun Exp $ */
/* $NetBSD: route.c,v 1.5 2000/12/04 07:05:49 itojun Exp $ */
/* $KAME: route.c,v 1.4 2000/12/04 06:33:11 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)
*
* KAME Id: route.c,v 1.3 1999/10/27 11:40:30 jinmei Exp
*/
/*
* Part of this program has been derived from PIM sparse-mode pimd.

View File

@ -1,4 +1,5 @@
/* $NetBSD: routesock.c,v 1.3 1999/12/10 06:13:32 itojun Exp $ */
/* $NetBSD: routesock.c,v 1.4 2000/12/04 07:05:49 itojun Exp $ */
/* $KAME: routesock.c,v 1.5 2000/12/04 06:33:11 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)
*
* KAME Id: routesock.c,v 1.4 1999/11/19 04:05:48 sumikawa Exp
*/
/*
* Part of this program has been derived from mrouted.

View File

@ -1,4 +1,5 @@
/* $NetBSD: timer.c,v 1.7 2000/10/06 00:13:02 itojun Exp $ */
/* $NetBSD: timer.c,v 1.8 2000/12/04 07:05:49 itojun Exp $ */
/* $KAME: timer.c,v 1.7 2000/12/04 06:33:11 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)
*
* KAME Id: timer.c,v 1.5 2000/05/18 16:09:39 itojun Exp
*/
/*
* Part of this program has been derived from PIM sparse-mode pimd.

View File

@ -1,4 +1,5 @@
/* $NetBSD: trace.c,v 1.4 1999/12/10 06:13:32 itojun Exp $ */
/* $NetBSD: trace.c,v 1.5 2000/12/04 07:05:49 itojun Exp $ */
/* $KAME: trace.c,v 1.6 2000/12/04 06:33:11 itojun Exp $ */
/*
* Copyright (C) 1999 WIDE Project.
@ -63,8 +64,6 @@
/*
* Questions concerning this software should be directed to
* Pavlin Ivanov Radoslavov (pavlin@catarina.usc.edu)
*
* KAME Id: trace.c,v 1.5 1999/09/16 08:46:00 jinmei Exp
*/
/*
* Part of this program has been derived from mrouted.

View File

@ -1,4 +1,5 @@
/* $NetBSD: trace.h,v 1.3 1999/12/10 06:13:32 itojun Exp $ */
/* $NetBSD: trace.h,v 1.4 2000/12/04 07:05:49 itojun Exp $ */
/* $KAME: trace.h,v 1.3 2000/12/04 06:33:11 itojun Exp $ */
/*
* Copyright (C) 1999 WIDE Project.
@ -63,8 +64,6 @@
/*
* Questions concerning this software should be directed to
* Pavlin Ivanov Radoslavov (pavlin@catarina.usc.edu)
*
* KAME Id: trace.h,v 1.2 1999/09/12 17:00:10 jinmei Exp
*/
/*
* Part of this program has been derived from mrouted.

View File

@ -1,3 +1,4 @@
/* $NetBSD: vers.c,v 1.1 1999/07/17 14:06:26 itojun Exp $ */
/* $NetBSD: vers.c,v 1.2 2000/12/04 07:05:49 itojun Exp $ */
/* $KAME: vers.c,v 1.2 2000/12/04 06:33:11 itojun Exp $ */
char todaysversion[]="0.2.1.0-alpha15";

View File

@ -1,4 +1,5 @@
/* $NetBSD: vif.c,v 1.4 2000/05/19 10:43:44 itojun Exp $ */
/* $NetBSD: vif.c,v 1.5 2000/12/04 07:05:49 itojun Exp $ */
/* $KAME: vif.c,v 1.6 2000/12/04 06:33:11 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)
*
* KAME Id: vif.c,v 1.5 2000/05/18 15:29:40 itojun Exp
*/
/*
* Part of this program has been derived from mrouted.

View File

@ -1,4 +1,5 @@
/* $NetBSD: vif.h,v 1.3 1999/09/03 04:49:24 itojun Exp $ */
/* $NetBSD: vif.h,v 1.4 2000/12/04 07:05:49 itojun Exp $ */
/* $KAME: vif.h,v 1.3 2000/12/04 06:33:11 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)
*
* KAME Id: vif.h,v 1.2 1999/08/24 16:45:23 jinmei Exp
*/
/*
* Part of this program has been derived from mrouted.