From: Naohiro Ooiwa <nooiwa@miraclelinux.com>
To: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
Cc: netdev@vger.kernel.org, usagi-users@linux-ipv6.org
Subject: Re: ping6 is sent out from wrong interface
Date: Wed, 25 Jun 2008 16:02:10 +0900 [thread overview]
Message-ID: <4861ED72.6080100@miraclelinux.com> (raw)
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);
next reply other threads:[~2008-06-25 7:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-25 7:02 Naohiro Ooiwa [this message]
2008-06-25 7:51 ` (usagi-users 04057) Re: ping6 is sent out from wrong interface 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
-- strict thread matches above, loose matches on Subject: below --
2008-06-20 1:42 Naohiro Ooiwa
2008-06-24 20:04 ` YOSHIFUJI Hideaki / 吉藤英明
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4861ED72.6080100@miraclelinux.com \
--to=nooiwa@miraclelinux.com \
--cc=netdev@vger.kernel.org \
--cc=usagi-users@linux-ipv6.org \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.