(usagi-users 03391) Re: MLDv2 linux implementation questions
Hoerdt Mickael <[email protected]>
| Newsgroups | gmane.linux.ipv6.usagi.users |
|---|---|
| Message-ID | <[email protected]> |
in test_msf, you can check this behavior by launching it with :
test_msf ff3e::1234
>r 2001:6::2 0
=>OK
>r 2001:6::3 0
=> EADDRINUSE, where it should be ok.
Hoerdt Mickaël
Hoerdt Mickael wrote:
>Hi David,
>
>This patch doesn't fix the problem. Taking my test program, not it returns
>EADDRINUSE after the second call when it should say OK, because I am
>using the same channel number for every group, but I join different
>sources: I join (S,G), then (S1,G), then (S2,G).
>
>This patch works for ASM groups, because I am not supposed to join the
>same group twice on a socket, but not for SSM where I can join several
>channels on the same sockets with the same channel identifier.
>
>Also, the EADDRINUSE is not documented in RFC3678.
>
>Thanks,
>
>Hoerdt Mickaël
>
>David Stevens wrote:
>
>
>
>>Hoerdt,
>> Here's a fix. I'm going to see if I can do the further
>>optimization of leaving the group when the filter is (INCLUDE,empty)
>>for this case, since that would use less socket buffer space, but
>>this alone corrects the problem.
>>
>> +-DLS
>>
>>(in-line for viewing, attached for applying)
>>--- linux-2.6.11.12/net/ipv6/mcast.c 2005-03-01 23:38:25.000000000
>>-0800
>>+++ linux-2.6.11.12MCT/net/ipv6/mcast.c 2005-06-14 10:31:24.000000000
>>-0700
>>@@ -188,6 +188,16 @@ int ipv6_sock_mc_join(struct sock *sk, i
>> if (!ipv6_addr_is_multicast(addr))
>> return -EINVAL;
>>
>>+ read_lock_bh(&ipv6_sk_mc_lock);
>>+ for (mc_lst=np->ipv6_mc_list; mc_lst; mc_lst=mc_lst->next) {
>>+ if ((ifindex == 0 || mc_lst->ifindex == ifindex) &&
>>+ ipv6_addr_equal(&mc_lst->addr, addr)) {
>>+ read_unlock_bh(&ipv6_sk_mc_lock);
>>+ return -EADDRINUSE;
>>+ }
>>+ }
>>+ read_unlock_bh(&ipv6_sk_mc_lock);
>>+
>> mc_lst = sock_kmalloc(sk, sizeof(struct ipv6_mc_socklist),
>>GFP_KERNEL);
>>
>> if (mc_lst == NULL)
>>
>>
>>
>>
>>
>>
>
>
>
>