netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: ping6 is sent out from wrong interface
@ 2008-06-25  7:02 Naohiro Ooiwa
  2008-06-25  7:51 ` (usagi-users 04057) " Fey Marcus
  2008-06-27 19:14 ` YOSHIFUJI Hideaki / 吉藤英明
  0 siblings, 2 replies; 7+ messages in thread
From: Naohiro Ooiwa @ 2008-06-25  7:02 UTC (permalink / raw)
  To: YOSHIFUJI Hideaki / 吉藤英明; +Cc: netdev, usagi-users

Hi YOSHIFUJI-san

Thank you for your reply.

> -I does not specify interface strictly but source address.
> Which means, if you just specify an address, interface is unspecified.
> You can give "-I eth1", too.

I'm not convinced yet.
I don't think it's correct that kernel or ping6 arbitrarily decides outgoing interface.

Is this really an expected behaviour?
Could you explain to me the reason of it, too?

I think the behavior should be similar to IPv4.

The following is my image. ipv6_dev_find() is an imaginary function, which
finds the interface with a given source address.

How do you think?



--- linux-2.6.25/net/ipv6/raw.c.orig    2008-04-17 11:49:44.000000000 +0900
+++ linux-2.6.25/net/ipv6/raw.c 2008-06-25 15:20:27.000000000 +0900
@@ -875,8 +875,13 @@ static int rawv6_sendmsg(struct kiocb *i
                final_p = &final;
        }

-       if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst))
-               fl.oif = np->mcast_oif;
+       if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst)) {
+               if (np->mcast_oif)
+                       fl.oif = np->mcast_oif;
+               else
+                       fl.oif = ipv6_dev_find(oldflp->fl6_src);
+       }
+
        security_sk_classify_flow(sk, &fl);

        err = ip6_dst_lookup(sk, &dst, &fl);





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-06-30 12:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-25  7:02 ping6 is sent out from wrong interface Naohiro Ooiwa
2008-06-25  7:51 ` (usagi-users 04057) " Fey Marcus
2008-06-25 10:18   ` (usagi-users 04056) " Naohiro Ooiwa
2008-06-25 11:26     ` Fey Marcus
2008-06-26  0:48       ` Naohiro Ooiwa
2008-06-27 19:14 ` YOSHIFUJI Hideaki / 吉藤英明
2008-06-30 12:57   ` Naohiro Ooiwa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).