Source-Changes-HG archive

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

[src/trunk]: src/dist/ntp keep track of the scope id of link-local ipv6 addre...



details:   https://anonhg.NetBSD.org/src/rev/2007464ed051
branches:  trunk
changeset: 555925:2007464ed051
user:      drochner <drochner%NetBSD.org@localhost>
date:      Thu Dec 04 16:52:28 2003 +0000

description:
keep track of the scope id of link-local ipv6 addresses, and deal with
the KAME specific way to embed it into the address
(keeping the interface close to the last public bind-9.3 snapshot to
avoid conflicts in the future)

diffstat:

 dist/ntp/include/isc/netaddr.h  |   3 ++-
 dist/ntp/libisc/interfaceiter.c |  15 ++++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diffs (46 lines):

diff -r db3d9ffe7349 -r 2007464ed051 dist/ntp/include/isc/netaddr.h
--- a/dist/ntp/include/isc/netaddr.h    Thu Dec 04 16:41:56 2003 +0000
+++ b/dist/ntp/include/isc/netaddr.h    Thu Dec 04 16:52:28 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netaddr.h,v 1.2 2003/12/04 16:23:36 drochner Exp $     */
+/*     $NetBSD: netaddr.h,v 1.3 2003/12/04 16:52:28 drochner Exp $     */
 
 /*
  * Copyright (C) 1998-2002  Internet Software Consortium.
@@ -37,6 +37,7 @@
                struct in_addr in;
                struct in6_addr in6;
        } type;
+       isc_uint32_t zone;
 };
 
 isc_boolean_t
diff -r db3d9ffe7349 -r 2007464ed051 dist/ntp/libisc/interfaceiter.c
--- a/dist/ntp/libisc/interfaceiter.c   Thu Dec 04 16:41:56 2003 +0000
+++ b/dist/ntp/libisc/interfaceiter.c   Thu Dec 04 16:52:28 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: interfaceiter.c,v 1.2 2003/12/04 16:23:36 drochner Exp $       */
+/*     $NetBSD: interfaceiter.c,v 1.3 2003/12/04 16:52:28 drochner Exp $       */
 
 /*
  * Copyright (C) 1999-2001  Internet Software Consortium.
@@ -73,6 +73,19 @@
                memcpy(&dst->type.in6,
                       &((struct sockaddr_in6 *) src)->sin6_addr,
                       sizeof(struct in6_addr));
+#ifdef __KAME__
+               if (IN6_IS_ADDR_LINKLOCAL(
+                           &((struct sockaddr_in6 *)src)->sin6_addr)) {
+                       u_int8_t *p;
+                       p = &((struct sockaddr_in6 *)src)->sin6_addr.s6_addr[0];
+                       dst->zone = ((u_int16_t)p[2] << 8) | p[3];
+                       dst->type.in6.s6_addr[2] = 0;
+                       dst->type.in6.s6_addr[3] = 0;
+               } else
+                       dst->zone = 0;
+#else
+               dst->zone = ((struct sockaddr_in6 *)src)->sin6_scope_id;
+#endif
                break;
        default:
                INSIST(0);



Home | Main Index | Thread Index | Old Index