[ipv6calc] [PATCH] 6rd local prefix calculation

Peter Bieringer pb at bieringer.de
Thu Sep 15 19:17:39 CEST 2011


Hi Raphael,

patch applied, working.

But I have a question regarding the main input argument:

Your implementation:

./ipv6calc --action 6rd_local_prefix --in ipv6addr --out ipv6addr
--6rd_relay_prefix 6.230.0.0/15 --6rd_local_ip 6.231.32.33
2607:fedc:ff40::/43
2607:fedc:ff52:210::/60

But I assume, the IPv6 prefix is a more static one that the local IP.

Because ipv6calc also supports bulk calculations by taking the variable
argument from stdin, this would be currently the prefix, while I assume,
the local IP is better.

echo "2607:fedc:ff40::/43" | ./ipv6calc --action 6rd_local_prefix --in
ipv6addr --out ipv6addr --6rd_relay_prefix 6.230.0.0/15 --6rd_local_ip
6.231.32.33

vs. (implementation must be changed):

echo "6.231.32.33" | ./ipv6calc --action 6rd_local_prefix --in ipv4addr
--out ipv6addr --6rd_prefix 2607:fedc:ff40::/43 --6rd_relay_prefix
6.230.0.0/15 --6rd_local_ip

Opinion?

	Peter

At 15.09.2011 05:00, Raphael Assenat wrote:
> Hello Peter,
> 
> Here's the patch I omitted in my previous message...
> 
> Best regards,
> Raphaël Assénat
> 
> On Wed, Sep 14, 2011 at 08:39:57PM +0200, Peter Bieringer wrote:
>> Hi Raphael,
>>
>> I can apply your patch but it did not compile:
>>
>> librfc5569.c: In function 'librfc5569_calc_6rd_local_prefix':
>> librfc5569.c:32:26: error: 'struct in6_addr' has no member named 'in6_u'
>>
>> Problem is here:
>>
>>  sixrd_prefix->in6_addr.in6_u.u6_addr8[i>>3] |= 0x80 >> (i&0x7);
>>
>> Looks like on Fedora 15, the header files are different than on your system.
>>
>> Can you rewrite this section using my independend wrapper functions
>>
>> ipv6addr_getoctett and ipv6addr_setoctett (looks I have to fix the "tt"
>> on next release...) instead of deep structure manipulations?
>>
>> Please send a patch on top of your previous one.
>>
>> Thank you!
>> 	Peter
>>
>>
>> At 13.09.2011 19:07, Raphael Assenat wrote:
>>> Hello,
>>>
>>> I recently began playing with the IPv6 service my ISP provides with 6rd. Calculating
>>> the local prefix manually was tedious so I wrote the attached patch for ipv6calc.
>>>
>>> The local prefix is obtained by specifying the 6rd prefix, 6rd relay prefix 
>>> and local IPv4 address to ipv6calc.
>>>
>>> The operation is in fact a simple concatenation of the 6rd prefix with part of the 
>>> local IPv4 address (according to the relay prefix length).
>>>
>>> Consider the following (fictive) parameters:
>>>
>>> 6rd prefix: 2607:fedc:ff40::/43
>>> 6rd_relay_prefix: 6.230.0.0/15
>>> local ip: 6.231.32.33
>>>
>>> ./ipv6calc --action 6rd_local_prefix --in ipv6addr 2607:fedc:ff40::/43 --out ipv6addr --6rd_relay_prefix 6.230.0.0/15 --6rd_local_ip 6.231.32.33
>>> 2607:fedc:ff52:210::/60
>>>
>>> Please review and consider applying. In any case, I think equivalent functionality
>>> would be a very useful feature to have in ipv6calc.
>>>
>>> Best regards,
>>> Raphaël Assénat
>>>
>>


-- 
Dr. Peter Bieringer                  mailto:pb at bieringer.de
Heideckstr.                          phone:  +49-89-36109687
D-80637 Muenchen                     fax:    +49-89-36109689
Germany                              mobile: +49-174-9015046



More information about the ipv6calc mailing list