From owner-freebsd-net@FreeBSD.ORG Wed Nov 25 12:15:04 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 73F1B10656CF for ; Wed, 25 Nov 2009 12:15:04 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from smtp1.dlr.de (smtp1.dlr.de [129.247.252.32]) by mx1.freebsd.org (Postfix) with ESMTP id 0B2BD8FC1B for ; Wed, 25 Nov 2009 12:15:03 +0000 (UTC) Received: from exbe5.intra.dlr.de ([172.21.106.15]) by smtp1.dlr.de with Microsoft SMTPSVC(6.0.3790.3959); Wed, 25 Nov 2009 13:15:01 +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 13:15:01 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Need help on IPv6 prefixes and interface addresses Thread-Index: AcptyOnR5h88lhyVTBSa5Vs3v+DjGA== From: To: X-OriginalArrivalTime: 25 Nov 2009 12:15:01.0816 (UTC) FILETIME=[E9E05380:01CA6DC8] Subject: 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 12:15:04 -0000 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