summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-02-28 14:06:00 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-02-28 14:06:00 +0000
commit1ea3d5ffc5f09680f16ba82e665a04ef15e56aa0 (patch)
treea995bf16c6db6133db5c3b3f301bf2e546c295d4
parent6eb14d269be8b8831c69e8324d390aeec69374d6 (diff)
upgrade node information query protocol support from 04 draft to
draft-ietf-ipngwg-icmp-name-lookups-05.txt. NOTE: 04 and 05 has no interoperability, in terms of "ping6 -a".
-rw-r--r--sys/netinet/icmp6.h31
-rw-r--r--sys/netinet6/icmp6.c14
2 files changed, 40 insertions, 5 deletions
diff --git a/sys/netinet/icmp6.h b/sys/netinet/icmp6.h
index fbd96f0107f..45fd6848d81 100644
--- a/sys/netinet/icmp6.h
+++ b/sys/netinet/icmp6.h
@@ -1,4 +1,5 @@
-/* $OpenBSD: icmp6.h,v 1.3 2000/02/28 11:55:20 itojun Exp $ */
+/* $OpenBSD: icmp6.h,v 1.4 2000/02/28 14:05:59 itojun Exp $ */
+/* $KAME: icmp6.h,v 1.8 2000/02/28 10:59:30 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -322,6 +323,13 @@ struct icmp6_nodeinfo {
#if BYTE_ORDER == BIG_ENDIAN
#define NI_SUPTYPE_FLAG_COMPRESS 0x1
#define NI_FQDN_FLAG_VALIDTTL 0x1
+#elif BYTE_ORDER == LITTLE_ENDIAN
+#define NI_SUPTYPE_FLAG_COMPRESS 0x0100
+#define NI_FQDN_FLAG_VALIDTTL 0x0100
+#endif
+
+#ifdef NAME_LOOKUPS_04
+#if BYTE_ORDER == BIG_ENDIAN
#define NI_NODEADDR_FLAG_LINKLOCAL 0x1
#define NI_NODEADDR_FLAG_SITELOCAL 0x2
#define NI_NODEADDR_FLAG_GLOBAL 0x4
@@ -329,8 +337,6 @@ struct icmp6_nodeinfo {
#define NI_NODEADDR_FLAG_TRUNCATE 0x10
#define NI_NODEADDR_FLAG_ANYCAST 0x20 /* just experimental. not in spec */
#elif BYTE_ORDER == LITTLE_ENDIAN
-#define NI_SUPTYPE_FLAG_COMPRESS 0x0100
-#define NI_FQDN_FLAG_VALIDTTL 0x0100
#define NI_NODEADDR_FLAG_LINKLOCAL 0x0100
#define NI_NODEADDR_FLAG_SITELOCAL 0x0200
#define NI_NODEADDR_FLAG_GLOBAL 0x0400
@@ -338,6 +344,25 @@ struct icmp6_nodeinfo {
#define NI_NODEADDR_FLAG_TRUNCATE 0x1000
#define NI_NODEADDR_FLAG_ANYCAST 0x2000 /* just experimental. not in spec */
#endif
+#else /* draft-ietf-ipngwg-icmp-name-lookups-05 (and later?) */
+#if BYTE_ORDER == BIG_ENDIAN
+#define NI_NODEADDR_FLAG_TRUNCATE 0x1
+#define NI_NODEADDR_FLAG_ALL 0x2
+#define NI_NODEADDR_FLAG_COMPAT 0x4
+#define NI_NODEADDR_FLAG_LINKLOCAL 0x8
+#define NI_NODEADDR_FLAG_SITELOCAL 0x10
+#define NI_NODEADDR_FLAG_GLOBAL 0x20
+#define NI_NODEADDR_FLAG_ANYCAST 0x40 /* just experimental. not in spec */
+#elif BYTE_ORDER == LITTLE_ENDIAN
+#define NI_NODEADDR_FLAG_TRUNCATE 0x0100
+#define NI_NODEADDR_FLAG_ALL 0x0200
+#define NI_NODEADDR_FLAG_COMPAT 0x0400
+#define NI_NODEADDR_FLAG_LINKLOCAL 0x0800
+#define NI_NODEADDR_FLAG_SITELOCAL 0x1000
+#define NI_NODEADDR_FLAG_GLOBAL 0x2000
+#define NI_NODEADDR_FLAG_ANYCAST 0x4000 /* just experimental. not in spec */
+#endif
+#endif
struct ni_reply_fqdn {
u_int32_t ni_fqdn_ttl; /* TTL */
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 7cf9f5db7fe..69a705e0a48 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: icmp6.c,v 1.7 2000/02/28 11:55:21 itojun Exp $ */
-/* $KAME: icmp6.c,v 1.70 2000/02/26 07:01:11 itojun Exp $ */
+/* $OpenBSD: icmp6.c,v 1.8 2000/02/28 14:05:59 itojun Exp $ */
+/* $KAME: icmp6.c,v 1.71 2000/02/28 09:25:42 jinmei Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -1179,6 +1179,16 @@ ni6_addrs(ni6, m, ifpp)
&ifa6->ia_addr.sin6_addr))
iffound = 1;
+ /*
+ * IPv4-mapped addresses can only be returned by a
+ * Node Information proxy, since they represent
+ * addresses of IPv4-only nodes, which perforce do
+ * not implement this protocol.
+ * [icmp-name-lookups-05]
+ * So we don't support NI_NODEADDR_FLAG_COMPAT in
+ * this function at this moment.
+ */
+
if (ifa6->ia6_flags & IN6_IFF_ANYCAST)
continue; /* we need only unicast addresses */