From: Wichert Akkerman <wichert@wiggy.net>
To: netdev@oss.sgi.com
Subject: sendmsg ignoring bind?
Date: Fri, 20 May 2005 10:18:05 +0200 [thread overview]
Message-ID: <20050520081805.GR25658@wiggy.net> (raw)
After moving a RADIUS server from a machine running 2.6.8.1 to
to another host running 2.6.11.9 yesterday things suddenly
broke: proxy requests were send from the wrong IP address.
Here is the network configuration:
1: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:13:21:b3:ba:ef brd ff:ff:ff:ff:ff:ff
inet 212.123.202.85/26 brd 212.123.202.127 scope global eth0
inet 212.123.202.78/26 scope global secondary eth0
inet 212.123.202.70/26 scope global secondary eth0
inet 212.123.202.73/26 scope global secondary eth0
inet 212.123.202.76/26 scope global secondary eth0
inet 212.123.202.74/26 scope global secondary eth0
inet6 2001:960:6a6:2:213:21ff:feb3:baef/64 scope global dynamic
valid_lft 2591728sec preferred_lft 604528sec
inet6 fe80::213:21ff:feb3:baef/64 scope link
valid_lft forever preferred_lft forever
This is an strace of the relevant code:
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 7
setsockopt(7, SOL_IP, IP_PKTINFO, [1], 4) = 0
bind(7, {sa_family=AF_INET, sin_port=htons(1814),
sin_addr=inet_addr("212.123.202.74")}, 16) = 0
sendmsg(7, {msg_name(16)={sa_family=AF_INET, sin_port=htons(1812),
sin_addr=inet_addr("212.100.254.89")},
msg_iov(1)=[{"....", 249}], msg_controllen=24, {cmsg_len=24,
cmsg_level=SOL_IP, cmsg_type=, ...}, msg_flags=0}, 0) = 249
One would expect that packet to be send from 212.123.202.74, but instead
it is send using the machine's primary IP address 212.123.202.85. As a
temporary workaround I added routes for the relevant targets that
explicitly set the src to 212.123.202.74.
Wichert.
--
Wichert Akkerman <wichert@wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
next reply other threads:[~2005-05-20 8:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-20 8:18 Wichert Akkerman [this message]
2005-05-20 10:17 ` sendmsg ignoring bind? Herbert Xu
2005-05-20 13:20 ` Wichert Akkerman
2005-05-20 13:24 ` Herbert Xu
2005-05-20 13:31 ` Wichert Akkerman
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=20050520081805.GR25658@wiggy.net \
--to=wichert@wiggy.net \
--cc=netdev@oss.sgi.com \
/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 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).