tech-net archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: prefixlen of IPv6 over PPP
I think it's time to move to tech-net.
From: Nagae Hidetake <nagae%eagan.jp@localhost>
Subject: prefixlen of IPv6 over PPP
Date: Fri, 06 Nov 2009 08:08:11 +0900 (JST)
> My ISP provides IPv6 tunneling service over PPTP
> (Point to Point Tunneling Protocol).
> Supported platform of clients is Windows Vista.
> IPv6 address is assigned with Router Advertisement.
>
> I'm trying to use this service with NetBSD/i386 5.0.1.
> PPTP tunnel is successfully opened with pkgsrc/net/pptp as below.
> (ppp1 is a PPTP tunnel)
>
> ppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
> inet aaa.aaa.aaa.aaa -> bbb.bbb.bbb.bbb netmask 0xffffff00
> inet6 fe80::xxxxx:xxxx:xxxx:xxxx%ppp0 -> prefixlen 64 scopeid 0x5
> ppp1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
> inet6 fe80::yyyy:yyyy:yyyy:yyyy%ppp1 -> fe80::zzzz:zzzz:zzzz:zzzz
> prefixlen 128 scopeid 0x6
>
> Next, I call rtsol command and the router returns rtadv.
> But my NetBSD box ignores it.
> It seems going into the path 'in6_ifadd: wrong prefixlen for %s'
> of src/sys/netinet6/nd6_rtr.c.
>
> I guess that the problem is prefixlen of ppp1.
> All 128 bits of link-local address are prefix.
> On the other hand, prefixlen of IPv6 over PPP looks like set always
> 128 in 'sif6addr' of src/usr.sbin/pppd/pppd/sys-bsd.c.
I attached a patch to src/usr.sbin/pppd/pppd/sys-bsd.c.
It makes pppd not to set destination address and set prefixlen 64.
Setting destination address with prefix 64 is rejected by
in6_update_ifa1 defined in src/sys/netinet6/in6.c.
PPTP connection with this patch accepts prefix advertised through RA.
I think this is the way pppoe handles IPv6 Link-Local address.
Is this a correct solution?
--
Nagae Hidetake nagae%eagan.jp@localhost
http://www.eagan.jp/nagae/
*** src/usr.sbin/pppd/pppd/sys-bsd.c_orig 2009-06-20 20:07:55.000000000
+0900
--- src/usr.sbin/pppd/pppd/sys-bsd.c 2009-11-08 11:24:56.000000000 +0900
***************
*** 758,763 ****
--- 758,764 ----
*(u_int16_t *)&addreq6.ifra_addr.sin6_addr.s6_addr[2] = htons(ifindex);
/* his addr */
+ #if 0
addreq6.ifra_dstaddr.sin6_family = AF_INET6;
addreq6.ifra_dstaddr.sin6_len = sizeof(struct sockaddr_in6);
addreq6.ifra_dstaddr.sin6_addr.s6_addr[0] = 0xfe;
***************
*** 766,777 ****
sizeof(our_eui64));
/* KAME ifindex hack */
*(u_int16_t *)&addreq6.ifra_dstaddr.sin6_addr.s6_addr[2] = htons(ifindex);
/* prefix mask: 128bit */
addreq6.ifra_prefixmask.sin6_family = AF_INET6;
addreq6.ifra_prefixmask.sin6_len = sizeof(struct sockaddr_in6);
memset(&addreq6.ifra_prefixmask.sin6_addr, 0xff,
! sizeof(addreq6.ifra_prefixmask.sin6_addr));
/* address lifetime (infty) */
addreq6.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;
--- 767,781 ----
sizeof(our_eui64));
/* KAME ifindex hack */
*(u_int16_t *)&addreq6.ifra_dstaddr.sin6_addr.s6_addr[2] = htons(ifindex);
+ #endif
/* prefix mask: 128bit */
addreq6.ifra_prefixmask.sin6_family = AF_INET6;
addreq6.ifra_prefixmask.sin6_len = sizeof(struct sockaddr_in6);
memset(&addreq6.ifra_prefixmask.sin6_addr, 0xff,
! sizeof(addreq6.ifra_prefixmask.sin6_addr)-sizeof(our_eui64));
! memset(&addreq6.ifra_prefixmask.sin6_addr+sizeof(our_eui64), 0x00,
! sizeof(our_eui64));
/* address lifetime (infty) */
addreq6.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;
Home |
Main Index |
Thread Index |
Old Index