Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 06 Apr 2008 03:38:12 +0900
From:      Hajimu UMEMOTO <ume@freebsd.org>
To:        wahjava.ml@gmail.com (Ashish Shukla =?UTF-8?B?4KSG4KS24KWA4KS3IOCktg==?= =?UTF-8?B?4KWB4KSV4KWN4KSy?=)
Cc:        gnome@freebsd.org, freebsd-ports@freebsd.org
Subject:   Re: net/avahi-app-0.6.22 not returning correct IPv6 link-local address.
Message-ID:  <ygek5jcno4r.wl%ume@mahoroba.org>
In-Reply-To: <87sky2183w.fsf@chateau.d.lf>
References:  <87sky2183w.fsf@chateau.d.lf>

next in thread | previous in thread | raw e-mail | index | archive | help
--Multipart_Sun_Apr__6_03:38:11_2008-1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,

>>>>> On Fri, 04 Apr 2008 11:20:43 +0530
>>>>> Ashish Shukla =E0=A4=86=E0=A4=B6=E0=A5=80=E0=A4=B7 =E0=A4=B6=E0=A5=81=
=E0=A4=95=E0=A5=8D=E0=A4=B2 <wahjava.ml@gmail.com> said:

wahjava> I noticed that avahi-resolve is returning incorrect IPv6 link-local
wahjava> address for a local interface.

wahjava> I tried looking up for the issue myself, but I'm not familiar with=
 the
wahjava> interface, avahi is using to lookup interface's address.

wahjava> ---->8---->8----
wahjava> [abbe@monte-cristo ~/ports/avahi-app]$ ifconfig rl0
wahjava> rl0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0=
 mtu 1500
wahjava>         options=3D8<VLAN_MTU>
wahjava>         ether 00:1b:38:ea:5c:76
wahjava>         inet6 fe80::21b:38ff:feea:5c76%rl0 prefixlen 64 scopeid 0x=
1=20
wahjava>         inet 172.16.0.7 netmask 0xffffffe0 broadcast 172.16.0.31
wahjava>         inet6 fdxx:xxxx:xxxx::yyyy prefixlen 48=20
wahjava>         media: Ethernet autoselect (100baseTX <full-duplex>)
wahjava>         status: active
wahjava> [abbe@monte-cristo ~/ports/avahi-app]$ avahi-resolve -6 -n monte-c=
risto.local
wahjava> monte-cristo.local      fe80:1::21b:38ff:feea:5c76
wahjava> [abbe@monte-cristo ~/ports/avahi-app]$ uname -a
wahjava> FreeBSD monte-cristo.fr 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Ma=
r 30
wahjava> 12:05:36 IST 2008     root@monte-cristo.fr:/usr/obj/usr/src/sys/ULE
wahjava> amd64=20
wahjava> ----8<----8<----

wahjava> Can anyone else confirm this ? Or problem with my configuration, h=
mm...?

It seems a KAME specific embedded scope-id is exposed.  Pleased try
the attached patch.

Sincerely,

--Multipart_Sun_Apr__6_03:38:11_2008-1
Content-Type: text/x-patch; charset=US-ASCII
Content-Disposition: attachment; filename="patch-avahi-core_iface-pfroute.c"
Content-Transfer-Encoding: 7bit

Index: avahi-core/iface-pfroute.c
diff -u -p avahi-core/iface-pfroute.c.orig avahi-core/iface-pfroute.c
--- avahi-core/iface-pfroute.c.orig	2007-09-03 21:32:41.000000000 +0900
+++ avahi-core/iface-pfroute.c	2008-04-06 03:06:24.000000000 +0900
@@ -172,6 +172,12 @@ static void rtm_addr(struct rt_msghdr *r
 	  break;
 	case RTA_IFA:
 	  memcpy(raddr.data.data, &((struct sockaddr_in6 *)sa)->sin6_addr,  sizeof(struct in6_addr));
+#ifdef __KAME__
+	  if (IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)raddr.data.data)) {
+	    ((struct in6_addr *)raddr.data.data)->s6_addr[2] = 0;
+	    ((struct in6_addr *)raddr.data.data)->s6_addr[3] = 0;
+	  }
+#endif
 	  raddr_valid = 1;
 	default:
 	  break;

--Multipart_Sun_Apr__6_03:38:11_2008-1
Content-Type: text/plain; charset=US-ASCII


--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume@mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/

--Multipart_Sun_Apr__6_03:38:11_2008-1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ygek5jcno4r.wl%ume>