Herbert Xu wrote:
Xia Wei-Zhong-W20079 <xia@motorola.com> wrote:
In the previous message, I have asked "it is said to use SO_BINDTODEVICE, you still need to have a route pointing to the device. SO_BINDTODEVICE only allow you to choose device among the different routing priorities.". So if I send a packet to 127.0.0.1, will it be routed to lo, even if I have previously binded the socket to eth0?
The answer is no, it will go out of eth0 as you directed.
It shouldn't according to RFC 1122, Section 3.2.1.3:
(g) { 127, <any> }
Internal host loopback address. Addresses of this form MUST NOT appear outside a host.
So what? all it means that if we're RFC compliant we should drop these packets - I don't know if we do, didn't check. You're still not going to get them on lo if you SO_BINDTODEVICE to some other device. In fact, I would call it a bug if you do.
Gilad
-- Gilad Ben-Yossef <gilad@codefidence.com> Codefidence. A name you can trust(tm) Web: http://codefidence.com | SIP: gilad@pbx.codefidence.com Tel: +972.9.8650475 ext. 201 | Fax: +972.9.8850643
"I am Jack's Overwritten Stack Pointer" -- Hackers Club, the movie
- : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html