Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys pullup (approved by releng-1-5)
details: https://anonhg.NetBSD.org/src/rev/443b04a7c359
branches: netbsd-1-5
changeset: 488876:443b04a7c359
user: itojun <itojun%NetBSD.org@localhost>
date: Fri Aug 04 15:11:58 2000 +0000
description:
pullup (approved by releng-1-5)
sys/netinet6/icmp6.h 1.11 -> 1.13
sys/netinet6/icmp6.c 1.39 -> 1.41
cvs rdiff -r1.11 -r1.12 syssrc/sys/netinet/icmp6.h
cvs rdiff -r1.39 -r1.40 syssrc/sys/netinet6/icmp6.c
correct typo in #define. ICMP6_NI_SUCESS -> SUCCESS (notice missing C).
sync with kame.
cvs rdiff -r1.12 -r1.13 syssrc/sys/netinet/icmp6.h
cvs rdiff -r1.40 -r1.41 syssrc/sys/netinet6/icmp6.c
clearifications in icmp6 node query support.
XXX previous commit included "supported qtypes" icmp6 node query support.
sorry commit message was mistaken.
diffstat:
sys/netinet/icmp6.h | 12 ++++++----
sys/netinet6/icmp6.c | 60 +++++++++++++++++++++------------------------------
2 files changed, 32 insertions(+), 40 deletions(-)
diffs (183 lines):
diff -r 4fee0e314d9f -r 443b04a7c359 sys/netinet/icmp6.h
--- a/sys/netinet/icmp6.h Fri Aug 04 15:06:59 2000 +0000
+++ b/sys/netinet/icmp6.h Fri Aug 04 15:11:58 2000 +0000
@@ -1,5 +1,5 @@
-/* $NetBSD: icmp6.h,v 1.9.2.2 2000/07/20 00:28:20 itojun Exp $ */
-/* $KAME: icmp6.h,v 1.18 2000/07/03 02:51:08 itojun Exp $ */
+/* $NetBSD: icmp6.h,v 1.9.2.3 2000/08/04 15:11:58 itojun Exp $ */
+/* $KAME: icmp6.h,v 1.22 2000/08/03 15:25:16 jinmei Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -146,7 +146,7 @@
#define ICMP6_NI_SUBJ_FQDN 1 /* Query Subject is a Domain name */
#define ICMP6_NI_SUBJ_IPV4 2 /* Query Subject is an IPv4 address */
-#define ICMP6_NI_SUCESS 0 /* node information successful reply */
+#define ICMP6_NI_SUCCESS 0 /* node information successful reply */
#define ICMP6_NI_REFUSED 1 /* node information request is refused */
#define ICMP6_NI_UNKNOWN 2 /* unknown Qtype */
@@ -320,8 +320,10 @@
#define NI_QTYPE_NOOP 0 /* NOOP */
#define NI_QTYPE_SUPTYPES 1 /* Supported Qtypes */
-#define NI_QTYPE_FQDN 2 /* FQDN */
-#define NI_QTYPE_NODEADDR 3 /* Node Addresses. XXX: spec says 2, but it may be a typo... */
+#define NI_QTYPE_FQDN 2 /* FQDN (draft 04) */
+#define NI_QTYPE_DNSNAME 2 /* DNS Name */
+#define NI_QTYPE_NODEADDR 3 /* Node Addresses */
+#define NI_QTYPE_IPV4ADDR 4 /* IPv4 Addresses */
#if BYTE_ORDER == BIG_ENDIAN
#define NI_SUPTYPE_FLAG_COMPRESS 0x1
diff -r 4fee0e314d9f -r 443b04a7c359 sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c Fri Aug 04 15:06:59 2000 +0000
+++ b/sys/netinet6/icmp6.c Fri Aug 04 15:11:58 2000 +0000
@@ -1,5 +1,5 @@
-/* $NetBSD: icmp6.c,v 1.33.2.1 2000/07/20 00:07:05 itojun Exp $ */
-/* $KAME: icmp6.c,v 1.113 2000/06/12 09:24:41 itojun Exp $ */
+/* $NetBSD: icmp6.c,v 1.33.2.2 2000/08/04 15:11:59 itojun Exp $ */
+/* $KAME: icmp6.c,v 1.131 2000/08/03 15:24:34 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -979,14 +979,13 @@
}
/*
- * Process a Node Information Query packet, (roughly) based on
- * draft-ietf-ipngwg-icmp-name-lookups-05.
+ * Process a Node Information Query packet, based on
+ * draft-ietf-ipngwg-icmp-name-lookups-06.
*
* Spec incompatibilities:
* - IPv6 Subject address handling
* - IPv4 Subject address handling support missing
* - Proxy reply (answer even if it's not for me)
- * - "Supported Qtypes" support missing
* - joins NI group address at in6_ifattach() time only, does not cope
* with hostname changes by sethostname(3)
*/
@@ -1026,24 +1025,8 @@
* Validate IPv6 destination address.
*
* We accept packets with the following IPv6 destination address:
- * - Responder's unicast/anycast address,
- * - link-local multicast address
- * This is a violation to last paragraph in icmp-name-lookups-05
- * page 4, which restricts IPv6 destination address of a query to:
- * - Responder's unicast/anycast address,
- * - NI group address for a name belongs to the Responder, or
- * - NI group address for a name for which the Responder is providing
- * proxy service.
- * (note: NI group address is a link-local multicast address)
- *
- * We allow any link-local multicast address, since "ping6 -w ff02::1"
- * has been really useful for us debugging our network. Also this is
- * still questionable if the restriction in spec buy us security at all,
- * since RFC2463 permits echo packet to multicast destination.
- * Even if we forbid NI query to ff02::1, we can effectively get the
- * same result as "ping6 -w ff02::1" by the following steps:
- * - run "ping6 ff02::1", then
- * - run "ping6 -w" for all addresses replied.
+ * - Responder's unicast/anycast address, and
+ * - link-local multicast address (including NI group address)
*/
bzero(&sin6, sizeof(sin6));
sin6.sin6_family = AF_INET6;
@@ -1063,7 +1046,7 @@
case NI_QTYPE_NOOP:
break; /* no reply data */
case NI_QTYPE_SUPTYPES:
- goto bad; /* xxx: to be implemented */
+ replylen += sizeof(u_int32_t);
break;
case NI_QTYPE_FQDN:
/* XXX will append a mbuf */
@@ -1096,10 +1079,10 @@
switch (qtype) {
case NI_QTYPE_NOOP:
case NI_QTYPE_SUPTYPES:
- if (subjlen != 0)
- goto bad;
- break;
-
+ /* 06 draft */
+ if (ni6->ni_code == ICMP6_NI_SUBJ_FQDN && subjlen == 0)
+ break;
+ /*FALLTHROUGH*/
case NI_QTYPE_FQDN:
case NI_QTYPE_NODEADDR:
switch (ni6->ni_code) {
@@ -1111,10 +1094,15 @@
* backward compatibility - try to accept 03 draft
* format, where no Subject is present.
*/
- if (subjlen == 0) {
+ if (qtype == NI_QTYPE_FQDN && ni6->ni_code == 0 &&
+ subjlen == 0) {
oldfqdn++;
break;
}
+#if ICMP6_NI_SUBJ_IPV6 != 0
+ if (ni6->ni_code != ICMP6_NI_SUBJ_IPV6)
+ goto bad;
+#endif
if (subjlen != sizeof(sin6.sin6_addr))
goto bad;
@@ -1195,10 +1183,6 @@
goto bad;
}
break;
-
- default:
- /* should never be here due to "switch (qtype)" above */
- goto bad;
}
/* allocate a mbuf to reply. */
@@ -1231,12 +1215,17 @@
/* qtype dependent procedure */
switch (qtype) {
case NI_QTYPE_NOOP:
+ nni6->ni_code = ICMP6_NI_SUCCESS;
nni6->ni_flags = 0;
break;
case NI_QTYPE_SUPTYPES:
- goto bad; /* xxx: to be implemented */
+ nni6->ni_code = ICMP6_NI_SUCCESS;
+ nni6->ni_flags = htons(0x0000); /* raw bitmap */
+ /* supports NOOP, SUPTYPES, FQDN, and NODEADDR */
+ *(u_int32_t *)(nni6 + 1) = htonl(0x0000000f);
break;
case NI_QTYPE_FQDN:
+ nni6->ni_code = ICMP6_NI_SUCCESS;
fqdn = (struct ni_reply_fqdn *)(mtod(n, caddr_t) +
sizeof(struct ip6_hdr) +
sizeof(struct icmp6_nodeinfo));
@@ -1257,6 +1246,7 @@
{
int lenlim, copied;
+ nni6->ni_code = ICMP6_NI_SUCCESS;
if (n->m_flags & M_EXT)
lenlim = MCLBYTES - sizeof(struct ip6_hdr) -
sizeof(struct icmp6_nodeinfo);
@@ -1274,7 +1264,6 @@
}
nni6->ni_type = ICMP6_NI_REPLY;
- nni6->ni_code = ICMP6_NI_SUCESS;
m_freem(m);
return(n);
@@ -1386,6 +1375,7 @@
/*
* check if two DNS-encoded string matches. takes care of truncated
* form (with \0\0 at the end). no compression support.
+ * XXX upper/lowercase match (see RFC2065)
*/
static int
ni6_dnsmatch(a, alen, b, blen)
Home |
Main Index |
Thread Index |
Old Index