prefixlen of IPv6 over PPP

View: New views
11 Messages — Rating Filter:   Alert me  

prefixlen of IPv6 over PPP

by Nagae Hidetake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello, NetBSD users.
I have a question about prefixlen of IPv6 over PPP.

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.

Is the prefixlen of ppp1 (128 bit) right?


--
Nagae Hidetake nagae@...
                        http://www.eagan.jp/nagae/

Re: prefixlen of IPv6 over PPP

by Matthew Mondor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, 06 Nov 2009 08:08:11 +0900 (JST)
Nagae Hidetake <nagae@...> wrote:

> Next, I call rtsol command and the router returns rtadv.
> But my NetBSD box ignores it.

Is the net.inet6.ip6.accept_rtadv sysctl also set to 1?

Thanks,
--
Matt

Re: prefixlen of IPv6 over PPP

by Nagae Hidetake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: Matthew Mondor <mm_lists@...>
Subject: Re: prefixlen of IPv6 over PPP
Date: Thu, 5 Nov 2009 22:03:00 -0500

> On Fri, 06 Nov 2009 08:08:11 +0900 (JST)
> Nagae Hidetake <nagae@...> wrote:
>
>> Next, I call rtsol command and the router returns rtadv.
>> But my NetBSD box ignores it.
>
> Is the net.inet6.ip6.accept_rtadv sysctl also set to 1?

Yes.
I tried it again after setting ip6mode=autohost in /etc/rc.conf,
reboot, and got the same result.
(In fact, rtsol fails and prints 'kernel is configured not to accept RAs'
if net.inet6.ip6.accept_rtadv is 0)

The kernel with nd6_debug=1 prints the following message into
/var/log/messages.

Nov  6 20:39:11 dixie /netbsd: in6_ifadd: wrong prefixlen for ppp1 (prefix=64 ifid=0)

--
Nagae Hidetake nagae@...
                        http://www.eagan.jp/nagae/

Re: prefixlen of IPv6 over PPP

by Brian A. Seklecki (CFI NOC) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> The kernel with nd6_debug=1 prints the following message into
> /var/log/messages.
>

Very curious.  check some RFCs, or check an XP box.  What is RTADV
giving them and what are they accepting?

Assigning a /128 to an v6 PPP interface is like assiging a /32 to an
IPv4 (/31 is...maybe known to work in some exotic platforms, but..)


~BAS




Re: prefixlen of IPv6 over PPP

by Nagae Hidetake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: "Brian A. Seklecki" <seklecki@...>
Subject: Re: prefixlen of IPv6 over PPP
Date: Fri, 06 Nov 2009 11:43:41 -0500

> Very curious.  check some RFCs, or check an XP box.  What is RTADV
> giving them and what are they accepting?
>
> Assigning a /128 to an v6 PPP interface is like assiging a /32 to an
> IPv4 (/31 is...maybe known to work in some exotic platforms, but..)

In Section 4.1 (Interface Identifier) of RFC 5072 (IP Version 6 over PPP):

  This Configuration Option provides a way to negotiate a unique, 64-
  bit interface identifier to be used for the address autoconfiguration
  [3] at the local end of the link (see Section 5).

In Section 5.3 (Creation of Link-Local Addresses) of RFC 4862 (IPv6
Stateless Address Autoconfiguration):

  If the sum of the link-local prefix length and N is larger than 128,
  autoconfiguration fails and manual configuration is required.


So I think prefixlen should be 64, but I'm not sure...


RA is proposing 64-bit prefix.
Vista box accepts it.

--
Nagae Hidetake nagae@...
                        http://www.eagan.jp/nagae/

Re: prefixlen of IPv6 over PPP

by Steven Bellovin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Nov 6, 2009, at 12:46 PM, Nagae Hidetake wrote:

> From: "Brian A. Seklecki" <seklecki@...>
> Subject: Re: prefixlen of IPv6 over PPP
> Date: Fri, 06 Nov 2009 11:43:41 -0500
>
>> Very curious.  check some RFCs, or check an XP box.  What is RTADV
>> giving them and what are they accepting?
>>
>> Assigning a /128 to an v6 PPP interface is like assiging a /32 to an
>> IPv4 (/31 is...maybe known to work in some exotic platforms, but..)
>
> In Section 4.1 (Interface Identifier) of RFC 5072 (IP Version 6 over  
> PPP):
>
>  This Configuration Option provides a way to negotiate a unique, 64-
>  bit interface identifier to be used for the address autoconfiguration
>  [3] at the local end of the link (see Section 5).
>
> In Section 5.3 (Creation of Link-Local Addresses) of RFC 4862 (IPv6
> Stateless Address Autoconfiguration):
>
>  If the sum of the link-local prefix length and N is larger than 128,
>  autoconfiguration fails and manual configuration is required.
>
>
> So I think prefixlen should be 64, but I'm not sure...


I wonder if the problem is that it's a ppp interface.  Stateless  
autoconfig is defined for Ethernet-like devices with 6-byte MAC  
addresses that are expanded to 8 bytes per an algorithm.  Maybe the  
NetBSD code doesn't handle the ppp interface type properly with a 64-
bit prefix.

                --Steve Bellovin, http://www.cs.columbia.edu/~smb






Re: prefixlen of IPv6 over PPP

by David Young :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Nov 06, 2009 at 08:08:11AM +0900, Nagae Hidetake wrote:
> Next, I call rtsol command and the router returns rtadv.
> But my NetBSD box ignores it.
*snip snip*
> Is the prefixlen of ppp1 (128 bit) right?

I recommend a prefixlen of 64.

What does 'ndp -i ppp1' say?  There has been a bug in the kernel for a
few months that affects acceptance of router advertisements.  You may
have to run 'ndp -i ppp1 accept_rtadv' to make the interface accept
advertisements.

Dave

--
David Young             OJC Technologies
dyoung@...      Urbana, IL * (217) 278-3933

Re: prefixlen of IPv6 over PPP

by Nagae Hidetake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: David Young <dyoung@...>
Subject: Re: prefixlen of IPv6 over PPP
Date: Fri, 6 Nov 2009 13:25:41 -0600

> What does 'ndp -i ppp1' say?  There has been a bug in the kernel for a
> few months that affects acceptance of router advertisements.  You may
> have to run 'ndp -i ppp1 accept_rtadv' to make the interface accept
> advertisements.

# uname -a
NetBSD dixie.eagan.jp 5.0.1_PATCH NetBSD 5.0.1_PATCH (DIXIE) #2: Thu Aug 20 22:41:20 JST 2009  nagae@...:/usr/src/sys/arch/i386/compile/DIXIE i386
# ifconfig ppp1
ppp1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
        inet6 fe80::f8b4:51da:37d5:d2f3%ppp1 -> fe80::21c:eff:fe67:701b prefixlen 128 scopeid 0x7
# ndp -i ppp1
linkmtu=1500, maxmtu=1500, curhlim=64, basereachable=30s0ms, reachable=14s, retrans=1s0ms
Flags: nud accept_rtadv
# ndp -i ppp1 accept_rtadv
linkmtu=1500, maxmtu=1500, curhlim=64, basereachable=30s0ms, reachable=14s, retrans=1s0ms
Flags: nud accept_rtadv
# rtsol ppp1
# ifconfig ppp1
ppp1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
        inet6 fe80::f8b4:51da:37d5:d2f3%ppp1 -> fe80::21c:eff:fe67:701b prefixlen 128 scopeid 0x7
# tail /var/log/messages
Nov  7 05:50:51 dixie pppd[806]: CHAP authentication succeeded
Nov  7 05:50:51 dixie pppd[806]: local  LL address fe80::f8b4:51da:37d5:d2f3
Nov  7 05:50:51 dixie pppd[806]: remote LL address fe80::021c:0eff:fe67:701b
Nov  7 05:50:51 dixie /netbsd: nd6_ns_input: ND packet from non-neighbor
Nov  7 05:50:54 dixie pppd[806]: CCP terminated by peer
Nov  7 05:50:54 dixie pppd[806]: Compression disabled by peer.
Nov  7 05:50:55 dixie /netbsd: in6_ifadd: wrong prefixlen for ppp1 (prefix=64 ifid=0)
Nov  7 05:51:50 dixie pptp[723]: anon log[pptp_handle_timer:pptp_ctrl.c:1126]: sending echo request: 1
Nov  7 05:51:51 dixie pptp[723]: anon log[logecho:pptp_ctrl.c:679]: Echo Reply received.
Nov  7 05:52:24 dixie /netbsd: in6_ifadd: wrong prefixlen for ppp1 (prefix=64 ifid=0)


Should I switch to tech-net or somewhere?

--
Nagae Hidetake nagae@...
                        http://www.eagan.jp/nagae/

Re: prefixlen of IPv6 over PPP

by Nagae Hidetake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think it's time to move to tech-net.

From: Nagae Hidetake <nagae@...>
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@...
                        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;

Re: prefixlen of IPv6 over PPP

by Christos Zoulas-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In article <20091108.114051.241895082.nagae@...>,
Nagae Hidetake  <nagae@...> wrote:

>-=-=-=-=-=-
>
>I think it's time to move to tech-net.
>
>From: Nagae Hidetake <nagae@...>
>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?
>
>--

Does this patch work for you? Linux uses a 10 bit prefixlen...

Index: sys-bsd.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/pppd/pppd/sys-bsd.c,v
retrieving revision 1.56
diff -u -u -r1.56 sys-bsd.c
--- sys-bsd.c 27 May 2007 18:11:38 -0000 1.56
+++ sys-bsd.c 10 Nov 2009 22:13:53 -0000
@@ -121,6 +121,27 @@
 #endif
 #include <ifaddrs.h>
 
+#ifndef IN6_LLADDR_FROM_EUI64
+#ifdef __KAME__
+#define IN6_LLADDR_FROM_EUI64(sin6, eui64) do { \
+ sin6.sin6_family = AF_INET6; \
+ sin6.sin6_len = sizeof(struct sockaddr_in6); \
+ sin6.sin6_addr.s6_addr[0] = 0xfe; \
+ sin6.sin6_addr.s6_addr[1] = 0x80; \
+ eui64_copy(eui64, sin6.sin6_addr.s6_addr[8]); \
+} while (/*CONSTCOND*/0)
+#define IN6_IFINDEX(sin6, ifindex) \
+    /* KAME ifindex hack */ \
+    *(u_int16_t *)&sin6.sin6_addr.s6_addr[2] = htons(ifindex)
+#else
+#define IN6_LLADDR_FROM_EUI64(sin6, eui64) do { \
+ memset(&sin6.s6_addr, 0, sizeof(struct in6_addr)); \
+ sin6.s6_addr16[0] = htons(0xfe80); \
+ eui64_copy(eui64, sin6.s6_addr32[2]); \
+} while (/*CONSTCOND*/0)
+#endif
+#endif
+
 #if RTM_VERSION >= 3
 #include <sys/param.h>
 #if defined(NetBSD) && (NetBSD >= 199703)
@@ -748,30 +769,22 @@
     strlcpy(addreq6.ifra_name, ifname, sizeof(addreq6.ifra_name));
 
     /* my addr */
-    addreq6.ifra_addr.sin6_family = AF_INET6;
-    addreq6.ifra_addr.sin6_len = sizeof(struct sockaddr_in6);
-    addreq6.ifra_addr.sin6_addr.s6_addr[0] = 0xfe;
-    addreq6.ifra_addr.sin6_addr.s6_addr[1] = 0x80;
-    memcpy(&addreq6.ifra_addr.sin6_addr.s6_addr[8], &our_eui64,
- sizeof(our_eui64));
-    /* KAME ifindex hack */
-    *(u_int16_t *)&addreq6.ifra_addr.sin6_addr.s6_addr[2] = htons(ifindex);
+    IN6_LLADDR_FROM_EUI64(addreq6.ifra_addr, our_eui64);
+    IN6_IFINDEX(addreq6.ifra_addr, ifindex);
 
+#ifdef notdef
     /* his addr */
-    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;
-    addreq6.ifra_dstaddr.sin6_addr.s6_addr[1] = 0x80;
-    memcpy(&addreq6.ifra_dstaddr.sin6_addr.s6_addr[8], &his_eui64,
- sizeof(our_eui64));
-    /* KAME ifindex hack */
-    *(u_int16_t *)&addreq6.ifra_dstaddr.sin6_addr.s6_addr[2] = htons(ifindex);
+    IN6_LLADDR_FROM_EUI64(addreq6.ifra_dstaddr, his_eui64);
+    IN6_IFINDEX(addreq6.ifra_dstaddr, ifindex);
+#endif
 
-    /* prefix mask: 128bit */
+    /* prefix mask: 112bit */
     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(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;
@@ -814,8 +827,8 @@
     /* Route to remote host */
     memset(&rt6, 0, sizeof(rt6));
     IN6_LLADDR_FROM_EUI64(rt6.rtmsg_dst, his_eui64);
-    rt6.rtmsg_flags = RTF_UP | RTF_HOST;
-    rt6.rtmsg_dst_len = 128;
+    rt6.rtmsg_flags = RTF_UP;
+    rt6.rtmsg_dst_len = 10;
     rt6.rtmsg_ifindex = ifr.ifr_ifindex;
     rt6.rtmsg_metric = 1;
     
@@ -855,15 +868,8 @@
     strlcpy(delreq6.ifr_name, ifname, sizeof(delreq6.ifr_name));
 
     /* my addr */
-    delreq6.ifr_ifru.ifru_addr.sin6_family = AF_INET6;
-    delreq6.ifr_ifru.ifru_addr.sin6_len = sizeof(struct sockaddr_in6);
-    delreq6.ifr_ifru.ifru_addr.sin6_addr.s6_addr[0] = 0xfe;
-    delreq6.ifr_ifru.ifru_addr.sin6_addr.s6_addr[1] = 0x80;
-    memcpy(&delreq6.ifr_ifru.ifru_addr.sin6_addr.s6_addr[8], &our_eui64,
- sizeof(our_eui64));
-    /* KAME ifindex hack */
-    *(u_int16_t *)&delreq6.ifr_ifru.ifru_addr.sin6_addr.s6_addr[2] =
- htons(ifindex);
+    IN6_LLADDR_FROM_EUI64(delreq6.ifr_ifru.ifru_addr, our_eui64);
+    IN6_IFINDEX(delreq6.ifr_ifru.ifru_addr, ifindex);
 
     if (ioctl(sock6_fd, SIOCDIFADDR_IN6, &delreq6) < 0) {
  error("cif6addr: ioctl(SIOCDIFADDR_IN6): %m");


Re: prefixlen of IPv6 over PPP

by Nagae Hidetake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

From: christos@... (Christos Zoulas)
Subject: Re: prefixlen of IPv6 over PPP
Date: Tue, 10 Nov 2009 22:15:04 +0000 (UTC)
http://mail-index.netbsd.org/current-users/2009/11/10/msg011139.html

> In article <20091108.114051.241895082.nagae@...>,
> Nagae Hidetake  <nagae@...> wrote:

>>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?

> Does this patch work for you? Linux uses a 10 bit prefixlen...

Thank you. Your patch also works fine in my environment.
Here is the output of ifconfig.

ppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
        inet XXX.XXX.XXX.XXX -> YYY.YYY.YYY.YYY netmask 0xffffff00
        inet6 fe80::216:d3ff:fe38:ba9d%ppp0 ->  prefixlen 64 scopeid 0x5
ppp1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1280
        inet6 fe80::ccfb:86b3:7b75:9470%ppp1 ->  prefixlen 64 scopeid 0x6
        inet6 2001:240:bb8a:d9:ccfb:86b3:7b75:9470 ->  prefixlen 64

> - sizeof(addreq6.ifra_prefixmask.sin6_addr));
> + sizeof(addreq6.ifra_prefixmask.sin6_addr) - sizeof(our_eui64));
> +    memset(&addreq6.ifra_prefixmask.sin6_addr+sizeof(our_eui64), 0x00,
> + sizeof(our_eui64));

More strictly, start address of the second memset shoud be
&addreq6.ifra_prefixmask.sin6_addr+sizeof(struct sockaddr_in6)-sizeof(our_euc64)


# 10 bit prefixlen!?  It's interesting...

--
Nagae Hidetake nagae@...
                        http://www.eagan.jp/nagae/