From owner-freebsd-net@FreeBSD.ORG Wed Nov 25 15:10:50 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B33A8106568F for ; Wed, 25 Nov 2009 15:10:50 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from smtp2.dlr.de (smtp1.dlr.de [129.247.252.32]) by mx1.freebsd.org (Postfix) with ESMTP id 46D988FC1E for ; Wed, 25 Nov 2009 15:10:49 +0000 (UTC) Received: from exbe5.intra.dlr.de ([172.21.106.15]) by smtp2.dlr.de with Microsoft SMTPSVC(6.0.3790.3959); Wed, 25 Nov 2009 16:10:48 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Wed, 25 Nov 2009 16:07:45 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Need help on IPv6 prefixes and interface addresses Thread-Index: AcptyOnR5h88lhyVTBSa5Vs3v+DjGAAGCEtq References: From: To: , X-OriginalArrivalTime: 25 Nov 2009 15:10:48.0593 (UTC) FILETIME=[783EC810:01CA6DE1] Cc: Subject: RE: Need help on IPv6 prefixes and interface addresses X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 15:10:50 -0000 To answer my own question :-) These strange link local addresses are = explained in the developers handbook section 8.1.1.3 and are called = embedded link local addresses. These are not standard IPv6 addresses, but a way = to encode the interface index (aka zone index) into the IPv6 address. = This must be undone by the user program before using these addresses. harti=20 -----Original Message----- From: owner-freebsd-net@freebsd.org on behalf of Hartmut.Brandt@dlr.de Sent: Wed 11/25/2009 1:15 PM To: freebsd-net@freebsd.org Subject: Need help on IPv6 prefixes and interface addresses =20 Hi all, I try to make bsnmpd IPv6 aware and need some help here. I've set up a = small IPv6 network for testing between a couple of VMs. For IPv6 interface addresses there are two tables: ipAddressPrefix table = and ipAddressTable (containing pointers to the prefix table). Now I see = something on my system I cannot grasp. ndp -pn gives me: 2001:638:101:ff::/64 if=3Dle0 flags=3DLO vltime=3Dinfinity, pltime=3Dinfinity, expire=3DNever, ref=3D1 No advertising router fe80::%le0/64 if=3Dle0 flags=3DLAO vltime=3Dinfinity, pltime=3Dinfinity, expire=3DNever, = ref=3D0 No advertising router fe80::%lo0/64 if=3Dlo0 flags=3DLAO vltime=3Dinfinity, pltime=3Dinfinity, expire=3DNever, = ref=3D0 No advertising router ifconfig -a inet6 gives: le0: flags=3D8843 metric 0 mtu = 1500 options=3D8 inet6 fe80::20c:29ff:fe90:dd1b%le0 prefixlen 64 scopeid 0x1=20 inet6 2001:638:101:ff::8:ffff prefixlen 64=20 lo0: flags=3D8049 metric 0 mtu 16384 options=3D3 inet6 ::1 prefixlen 128=20 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2=20 So far, so nice. When I ask for the interface addresses via sysctl([0, NET_RT_IFLIST, 0], = ...) I get strange RTM_NEWADDR messages: msglen=3D76 version=3D5 type=3DRTM_NEWADDR flags=3D0 index=3D1 metric=3D0 netmask=3DINET6,28,{0,0,ffff:ffff:ffff:ffff::,0} ifa=3DINET6,28,{0,0,fe80:1::20c:29ff:fe90:dd1b,0} Which means a prefix of fe80:1::/64 instead of fe80::%le0/64. Note, the = :1: there and note the zero missing scope_id (the last 0 inside the {}). Same for lo0: msglen=3D80 version=3D5 type=3DRTM_NEWADDR flags=3D0 index=3D2 metric=3D0 netmask=3DINET6,28,{0,0,ffff:ffff:ffff:ffff::,0} ifa=3DINET6,28,{0,0,fe80:2::1,0} brd=3DUNSPEC,0,{} So my questions: - are the routing message really that inconsistent and broken? Or do I = read them somehow incorrect? - is it possible to rely on the prefix table? In other words: Does = *each* prefix used in a INET6 interface address appear in the prefix list? harti _______________________________________________ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"