Date: Thu, 17 May 2012 15:13:08 -0700 From: prabhakar lakhera <prabhakar.lakhera@gmail.com> To: freebsd-net@freebsd.org Subject: Re: How to set the IPv6 linklocal scope id for an interface? Message-ID: <CALg%2BrhVNXmor3JSAYmOVG%2BnSEdbJBU15N6AnGxmNUFn81vXx8g@mail.gmail.com> In-Reply-To: <CALg%2BrhVakDqBQdnvwYOsHFNKOo-6dsM2-nk5fGztt7E004hAMA@mail.gmail.com> References: <CALg%2BrhVakDqBQdnvwYOsHFNKOo-6dsM2-nk5fGztt7E004hAMA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Removing the hyperlinks (these seem to get appended by gmail: Hi, Is there any way for the administrator to set an interface's scope if for link local scope? I see that in6_domifattach calls=A0scope6_ifattach which sets the interface local scope and link local scope for the interface equal to the ifp index. scope6_ifattach(struct ifnet *ifp) { =A0 =A0 =A0 ..... =A0 =A0 =A0 ..... =A0 =A0 =A0 =A0 /* =A0 =A0 =A0 =A0 =A0* XXX: IPV6_ADDR_SCOPE_xxx macros are not standard. =A0 =A0 =A0 =A0 =A0* Should we rather hardcode here? =A0 =A0 =A0 =A0 =A0*/ =A0 =A0 =A0 =A0 sid->s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL] =3D ifp->if_in= dex; =A0 =A0 =A0 =A0 sid->s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL] =3D ifp->if_index= ; =A0 =A0 =A0 ..... =A0 =A0 =A0 ..... } I am trying to avoid the following: Here's the problem. I have two interfaces A and B on same link. Both learn RA for the link. One of these is used to add a default route entry in the routing table. Lets say default router entry for A is picked, we have the following default route entry: destination: ::/0 gw: =A0 =A0 =A0 =A0 =A0 =A0 fe80:<A's link local scope id embedded>::<ident= ifier> route_ifp: =A0 =A0 A I used IPv6 address hosted on interface B to send a packet to destination X and I got back a neighbor redirect from gw destined for B for X. However the redirect is dropped. Below is the code from icmp6_redirect_input that fails a check: 2346 2347 gw6 =3D &(((struct sockaddr_in6 *)rt->rt_gateway)->sin6_addr); 2348 if (bcmp(&src6, gw6, sizeof(struct in6_addr)) !=3D 0)= { 2349 nd6log((LOG_ERR, 2350 "ICMP6 redirect rejected; " 2351 "not equal to gw-for-src=3D%s (must be sa= me): " 2352 "%s\n", 2353 ip6_sprintf(ip6buf, gw6), 2354 icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); 2355 RTFREE_LOCKED(rt); 2356 goto bad; 2357 } src6 is the router's LLA but since it's received on B, it's embedded with B's link scope embedded id. So we end up comparing: =A0 fe80:<A's link local scope id embedded>::<identifier> with =A0 fe80:<B's link local scope id embedded>::<identifier> Since ids are different the comparison fails and the redirect is dropped.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALg%2BrhVNXmor3JSAYmOVG%2BnSEdbJBU15N6AnGxmNUFn81vXx8g>