Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys sync with KAME/NetBSD 1.4, SNAP kit 19990705.
details: https://anonhg.NetBSD.org/src/rev/55554cf4fe28
branches: trunk
changeset: 474427:55554cf4fe28
user: itojun <itojun%NetBSD.org@localhost>
date: Tue Jul 06 12:23:19 1999 +0000
description:
sync with KAME/NetBSD 1.4, SNAP kit 19990705.
key changes are:
- icmp6 redirect fix (dst check)
- revised ip6 multicast check for loopback i/f
- several RCS ID cleanups
diffstat:
sys/net/pfkeyv2.h | 36 ++++++++++++++++++++++++++++++
sys/netinet/in_gif.c | 8 +++---
sys/netinet/in_gif.h | 4 +-
sys/netinet/ip_ecn.c | 4 +-
sys/netinet/ip_ecn.h | 4 +-
sys/netinet/ip_input.c | 10 ++++----
sys/netinet/ip_var.h | 4 +-
sys/netinet6/icmp6.c | 13 +++++++++-
sys/netinet6/in6.h | 4 +-
sys/netinet6/ip6.h | 9 ++++---
sys/netinet6/ip6_mroute.c | 16 +++++-------
sys/netinet6/nd6.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++-
sys/netinet6/nd6.h | 3 +-
sys/netinet6/pim6_var.h | 4 +-
sys/netkey/key.c | 10 +++++---
sys/netkey/key.h | 4 +-
sys/netkey/key_debug.c | 4 +-
sys/netkey/key_debug.h | 4 +-
sys/netkey/keysock.c | 4 +-
sys/netkey/keysock.h | 4 +-
sys/netkey/keyv2.h | 4 +-
21 files changed, 155 insertions(+), 54 deletions(-)
diffs (truncated from 544 to 300 lines):
diff -r c8bb2ae72be1 -r 55554cf4fe28 sys/net/pfkeyv2.h
--- a/sys/net/pfkeyv2.h Tue Jul 06 08:55:56 1999 +0000
+++ b/sys/net/pfkeyv2.h Tue Jul 06 12:23:19 1999 +0000
@@ -1,1 +1,37 @@
+/* $NetBSD: pfkeyv2.h,v 1.3 1999/07/06 12:23:19 itojun Exp $ */
+
+/*
+ * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _NET_PFKEYV2_H_
+#define _NET_PFKEYV2_H_
+
#include <netkey/keyv2.h>
+
+#endif /* _NET_PFKEYV2_H_ */
diff -r c8bb2ae72be1 -r 55554cf4fe28 sys/netinet/in_gif.c
--- a/sys/netinet/in_gif.c Tue Jul 06 08:55:56 1999 +0000
+++ b/sys/netinet/in_gif.c Tue Jul 06 12:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_gif.c,v 1.3 1999/07/03 21:24:45 thorpej Exp $ */
+/* $NetBSD: in_gif.c,v 1.4 1999/07/06 12:23:20 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -79,9 +79,9 @@
#endif
#if NGIF > 0
-int gif_ttl = GIF_TTL;
+int ip_gif_ttl = GIF_TTL;
#else
-int gif_ttl = 0;
+int ip_gif_ttl = 0;
#endif
int
@@ -171,7 +171,7 @@
}
iphdr.ip_p = proto;
/* version will be set in ip_output() */
- iphdr.ip_ttl = gif_ttl;
+ iphdr.ip_ttl = ip_gif_ttl;
iphdr.ip_len = m->m_pkthdr.len + sizeof(struct ip);
if (ifp->if_flags & IFF_LINK1)
ip_ecn_ingress(ECN_ALLOWED, &iphdr.ip_tos, &tos);
diff -r c8bb2ae72be1 -r 55554cf4fe28 sys/netinet/in_gif.h
--- a/sys/netinet/in_gif.h Tue Jul 06 08:55:56 1999 +0000
+++ b/sys/netinet/in_gif.h Tue Jul 06 12:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in_gif.h,v 1.3 1999/07/03 21:24:45 thorpej Exp $ */
+/* $NetBSD: in_gif.h,v 1.4 1999/07/06 12:23:20 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -34,7 +34,7 @@
#define GIF_TTL 30
-extern int gif_ttl;
+extern int ip_gif_ttl;
void in_gif_input __P((struct mbuf *, ...));
int in_gif_output __P((struct ifnet *, int, struct mbuf *, struct rtentry *));
diff -r c8bb2ae72be1 -r 55554cf4fe28 sys/netinet/ip_ecn.c
--- a/sys/netinet/ip_ecn.c Tue Jul 06 08:55:56 1999 +0000
+++ b/sys/netinet/ip_ecn.c Tue Jul 06 12:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_ecn.c,v 1.3 1999/07/03 21:24:45 thorpej Exp $ */
+/* $NetBSD: ip_ecn.c,v 1.4 1999/07/06 12:23:20 itojun Exp $ */
/*
* Copyright (C) 1999 WIDE Project.
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ip_ecn.c,v 1.3 1999/07/03 21:24:45 thorpej Exp $
+ * KAME Id: ip_ecn.c,v 1.1.4.1 1999/05/07 15:59:14 itojun Exp
*/
/*
* ECN consideration on tunnel ingress/egress operation.
diff -r c8bb2ae72be1 -r 55554cf4fe28 sys/netinet/ip_ecn.h
--- a/sys/netinet/ip_ecn.h Tue Jul 06 08:55:56 1999 +0000
+++ b/sys/netinet/ip_ecn.h Tue Jul 06 12:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_ecn.h,v 1.3 1999/07/03 21:24:45 thorpej Exp $ */
+/* $NetBSD: ip_ecn.h,v 1.4 1999/07/06 12:23:20 itojun Exp $ */
/*
* Copyright (C) 1999 WIDE Project.
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ip_ecn.h,v 1.3 1999/07/03 21:24:45 thorpej Exp $
+ * KAME Id: ip_ecn.h,v 1.1.4.1 1999/05/07 15:59:16 itojun Exp
*/
/*
* ECN consideration on tunnel ingress/egress operation.
diff -r c8bb2ae72be1 -r 55554cf4fe28 sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c Tue Jul 06 08:55:56 1999 +0000
+++ b/sys/netinet/ip_input.c Tue Jul 06 12:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_input.c,v 1.89 1999/07/01 08:12:50 itojun Exp $ */
+/* $NetBSD: ip_input.c,v 1.90 1999/07/06 12:23:20 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -1638,14 +1638,14 @@
return (error);
}
#endif
+ case IPCTL_HOSTZEROBROADCAST:
+ return (sysctl_int(oldp, oldlenp, newp, newlen,
+ &hostzeroisbroadcast));
#if NGIF > 0
case IPCTL_GIF_TTL:
return(sysctl_int(oldp, oldlenp, newp, newlen,
- &gif_ttl));
+ &ip_gif_ttl));
#endif
- case IPCTL_HOSTZEROBROADCAST:
- return (sysctl_int(oldp, oldlenp, newp, newlen,
- &hostzeroisbroadcast));
default:
return (EOPNOTSUPP);
diff -r c8bb2ae72be1 -r 55554cf4fe28 sys/netinet/ip_var.h
--- a/sys/netinet/ip_var.h Tue Jul 06 08:55:56 1999 +0000
+++ b/sys/netinet/ip_var.h Tue Jul 06 12:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_var.h,v 1.37 1999/07/01 08:12:51 itojun Exp $ */
+/* $NetBSD: ip_var.h,v 1.38 1999/07/06 12:23:21 itojun Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -184,7 +184,7 @@
extern u_int16_t ip_id; /* ip packet ctr, for ids */
extern int ip_defttl; /* default IP ttl */
extern int ipforwarding; /* ip forwarding */
-extern int gif_ttl; /* default TTL for gif encap packet */
+extern int ip_gif_ttl; /* default TTL for gif encap packet */
extern int ip_mtudisc; /* mtu discovery */
extern u_int ip_mtudisc_timeout; /* seconds to timeout mtu discovery */
extern int anonportmin; /* minimum ephemeral port */
diff -r c8bb2ae72be1 -r 55554cf4fe28 sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c Tue Jul 06 08:55:56 1999 +0000
+++ b/sys/netinet6/icmp6.c Tue Jul 06 12:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: icmp6.c,v 1.4 1999/07/06 08:55:56 itojun Exp $ */
+/* $NetBSD: icmp6.c,v 1.5 1999/07/06 12:23:21 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -345,7 +345,7 @@
#endif
#ifdef IPSEC
- /*drop it if it does not match the default policy */
+ /* drop it if it does not match the default policy */
if (ipsec6_in_reject(m, NULL)) {
ipsecstat.in_polvio++;
goto freeit;
@@ -1512,7 +1512,16 @@
/* sanity check */
if (!m0 || !rt || !(rt->rt_flags & RTF_UP) || !(ifp = rt->rt_ifp))
goto fail;
+
+ /*
+ * Address check:
+ * the source address must identify a neighbor, and
+ * the destination address must not be a multicast address
+ * [RFC 2461, sec 8.2]
+ */
sip6 = mtod(m0, struct ip6_hdr *);
+ if (nd6_is_addr_neighbor(&sip6->ip6_src, ifp) == 0)
+ goto fail;
if (IN6_IS_ADDR_MULTICAST(&sip6->ip6_dst))
goto fail; /* what should we do here? */
diff -r c8bb2ae72be1 -r 55554cf4fe28 sys/netinet6/in6.h
--- a/sys/netinet6/in6.h Tue Jul 06 08:55:56 1999 +0000
+++ b/sys/netinet6/in6.h Tue Jul 06 12:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6.h,v 1.5 1999/07/03 21:30:18 thorpej Exp $ */
+/* $NetBSD: in6.h,v 1.6 1999/07/06 12:23:22 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -75,7 +75,7 @@
* Identification of the network protocol stack
*/
#define __KAME__
-#define __KAME_VERSION "SNAP 19990628/NetBSD-current"
+#define __KAME_VERSION "SNAP 19990705/NetBSD-current"
/*
* Local port number conventions:
diff -r c8bb2ae72be1 -r 55554cf4fe28 sys/netinet6/ip6.h
--- a/sys/netinet6/ip6.h Tue Jul 06 08:55:56 1999 +0000
+++ b/sys/netinet6/ip6.h Tue Jul 06 12:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip6.h,v 1.3 1999/07/03 21:30:18 thorpej Exp $ */
+/* $NetBSD: ip6.h,v 1.4 1999/07/06 12:23:22 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -69,7 +69,7 @@
/*
* Definition for internet protocol version 6.
- * RFC 1883
+ * RFC 2460
*/
struct ip6_hdr {
@@ -142,8 +142,9 @@
#define IP6OPT_JUMBO_LEN 6
#define IP6OPT_RTALERT 0x05 /* 00 0 00101 */
#define IP6OPT_RTALERT_LEN 4
-#define IP6OPT_RTALERT_MLD 0 /* Datagram contains MLD message */
-#define IP6OPT_RTALERT_RSVP 1 /* Datagram contains RSVP message */
+#define IP6OPT_RTALERT_MLD 0 /* Datagram contains an MLD message */
+#define IP6OPT_RTALERT_RSVP 1 /* Datagram contains an RSVP message */
+#define IP6OPT_RTALERT_ACTNET 2 /* contains an Active Networks msg */
#define IP6OPT_MINLEN 2
#define IP6OPT_TYPE(o) ((o) & 0xC0)
diff -r c8bb2ae72be1 -r 55554cf4fe28 sys/netinet6/ip6_mroute.c
--- a/sys/netinet6/ip6_mroute.c Tue Jul 06 08:55:56 1999 +0000
+++ b/sys/netinet6/ip6_mroute.c Tue Jul 06 12:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip6_mroute.c,v 1.5 1999/07/06 08:55:56 itojun Exp $ */
+/* $NetBSD: ip6_mroute.c,v 1.6 1999/07/06 12:23:22 itojun Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@@ -922,13 +922,6 @@
ip6_sprintf(&ip6->ip6_src), ip6_sprintf(&ip6->ip6_dst),
ifp->if_index);
#endif
- /*
- * If the packet is loop-backed, it should be for local listeners
- * and need not to be forwarded any more.
- * XXX: M_LOOP is an ad-hoc hack...
- */
- if (m->m_flags & M_LOOP)
- return 0;
/*
* Don't forward a packet with Hop limit of zero or one,
@@ -1223,7 +1216,12 @@
if(mifi < nummifs) /* have to make sure this is a valid mif */
if(mif6table[mifi].m6_ifp)
- if (pim6) {
+ if (pim6 && (m->m_flags & M_LOOP) == 0) {
+ /*
+ * Check the M_LOOP flag to avoid an
+ * unnecessary PIM assert.
+ * XXX: M_LOOP is an ad-hoc hack...
+ */
static struct sockaddr_in6 sin6 =
{ sizeof(sin6), AF_INET6 };
diff -r c8bb2ae72be1 -r 55554cf4fe28 sys/netinet6/nd6.c
--- a/sys/netinet6/nd6.c Tue Jul 06 08:55:56 1999 +0000
+++ b/sys/netinet6/nd6.c Tue Jul 06 12:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nd6.c,v 1.5 1999/07/04 02:01:15 itojun Exp $ */
+/* $NetBSD: nd6.c,v 1.6 1999/07/06 12:23:22 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Home |
Main Index |
Thread Index |
Old Index