[Linux-ha-dev] [PATCH] fixed bug in IPv6addr

Kazunori INOUE inouekazu at intellilink.co.jp
Thu Oct 15 04:22:43 MDT 2009


Hi Dejan,

Dejan Muhamedagic wrote:
> Hi Kazunori-san,
> 
> On Fri, Oct 09, 2009 at 07:17:15PM +0900, Kazunori INOUE wrote:
>> Hi,
>>
>> I found that IPv6addr failed to assign the address in the following
>> environments.
>> I attached patch for IPv6addr in Cluster Resource Agents
>> (changeset:de034cf1e9a1).
>>
>> 1) environments
>>    # ifconfig bond0
>>    bond0     Link encap:Ethernet  HWaddr 00:10:18:27:02:D3
>>              inet6 addr: 2001:db8:91:0:92::181/80 Scope:Global
>>    [snip]
>>
>>    # ifconfig eth0
>>    eth0      Link encap:Ethernet  HWaddr 00:1A:64:06:59:92
>>              inet6 addr: 2001:db8:91:0:91::182/64 Scope:Global
>>    [snip]
>>
>>    # grep ^2001 /proc/net/if_inet6
>>    20010db8009100000091000000000182 0e 40 00 80     eth0
>>    20010db8009100000092000000000181 0c 50 00 80    bond0
>>      (* POINT which fails is this order.)
> 
> You mean the order of interface list influences the processing?
> 
Yes. (and it is also important that prefix_len is different.)
IPv6addr will be successful if it is the following order.

    # grep ^2001 /proc/net/if_inet6
    20010db8009100000092000000000181 0c 50 00 80    bond0
    20010db8009100000091000000000182 0e 40 00 80     eth0
    #

>> 2) IPv6addr start op
>>    # env | grep OCF_RESKEY
>>    OCF_RESKEY_ipv6addr=2001:db8:91:0:92::189
>>    OCF_RESKEY_nic=bond0
>>     (* OCF_RESKEY_cidr_netmask is not specified intentionally.)
>>
>>    # /usr/lib/ocf/resource.d/heartbeat/IPv6addr start
>>    # echo $?
>>    1
>>    #
>>
>> I hope they are helpful to you.
>>
>> Regards,
>> Kazunori INOUE
> 
>> diff -urN agents.org/heartbeat/IPv6addr.c agents.mod/heartbeat/IPv6addr.c
>> --- agents.org/heartbeat/IPv6addr.c	2009-10-09 15:13:50.000000000 +0900
>> +++ agents.mod/heartbeat/IPv6addr.c	2009-10-09 15:19:36.000000000 +0900
>> @@ -294,6 +294,7 @@
>>  	/* release the pid file */
>>  	unlink(pid_file);
>>  
>> +	cl_log(LOG_DEBUG, "%s %s : %d", getenv("OCF_RESOURCE_INSTANCE"), argv[1], ret);
>>  	return ret;
>>  }
>>  int
>> @@ -513,7 +514,6 @@
>>  		if (*plen_target!=0 && plen != *plen_target) {
>>  			continue;
>>  		}
>> -		*plen_target = plen;
>>  
>>  		/* If interface name provided, only same devname entry
>>  		 * would be considered
>> @@ -554,6 +554,7 @@
>>  		/* We found it!	*/
>>  		if (same) {
>>  			fclose(f);
>> +			*plen_target = plen;
>>  			return devname;
>>  		}
>>  	}
> 
> I looked at the code twice, but can't see how this patch would
> make the difference. plen doesn't change in that code segment, so
> how can moving that assignment make plen_target different. Can
> you please explain in more detail.
> 
Since plen is the value read from if_inet6 file, I recognize it as
changing...
When the line of eth0 is read, it's set as 64 (=0x40),
and the line of bond0 is read, it's set as 80 (=0x50).

Please see the attached gdb.log for details.

Best Regards,
Kazunori INOUE

> Cheers,
> 
> Dejan
> 
>> _______________________________________________________
>> Linux-HA-Dev: Linux-HA-Dev at lists.linux-ha.org
>> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
>> Home Page: http://linux-ha.org/
> 
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gdb.log
Url: http://lists.linux-ha.org/pipermail/linux-ha-dev/attachments/20091015/1f2cac83/attachment.txt 


More information about the Linux-HA-Dev mailing list