Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: prefixlen of IPv6 over PPP

From: (Christos Zoulas)
Subject: Re: prefixlen of IPv6 over PPP
Date: Tue, 10 Nov 2009 22:15:04 +0000 (UTC)

> In article <>,
> Nagae Hidetake  <> 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

Home | Main Index | Thread Index | Old Index