From: jiangtao.jit@gmail.com (jiangtao.jit)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Problem with a UDP server implements
Date: Sat, 15 Oct 2011 01:51:43 +0800 [thread overview]
Message-ID: <201110150151405785431@gmail.com> (raw)
Hi:
I'm writing a UDP server and meet a problem
the UDP server program is run on a box with single card but has multi ip:
like eth0 10.0.0.1
eth0:1 10.0.0.2
eth0:2 11.0.0.1
I bind the server socket with INADDR_ANY
when a client send a packet to 10.0.0.2(the eth0:1 's ip)
the server can recieve the packet and reply, but the client can't recieve the server's response
I use wireshark to capture the response packet
and found that the server use 10.0.0.1(the eth0 's ip) as saddr in the response packet
I expected it to be 10.0.0.2 but it's not
my question : is there any way to let the UDP server relpy just use the ip it receieved the request ?
It's :
when a client send a request to 10.0.0.1(eth0); the server use 10.0.0.1 to response
and another client send a request to 10.0.0.2(eth0:1); the server use 10.0.0.2 to response
Thanks.
2011-10-15
jiangtao.jit
next reply other threads:[~2011-10-14 17:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-14 17:51 jiangtao.jit [this message]
2011-10-15 6:04 ` Problem with a UDP server implements michi1 at michaelblizek.twilightparadox.com
2011-10-15 8:29 ` tao jiang
2011-10-15 9:01 ` michi1 at michaelblizek.twilightparadox.com
2011-10-15 9:50 ` tao jiang
2011-10-15 11:58 ` Bernd Petrovitsch
2011-10-17 23:26 ` tao jiang
2011-10-18 9:20 ` Bernd Petrovitsch
2011-10-18 14:48 ` tao jiang
2011-10-19 7:28 ` Bernd Petrovitsch
2011-10-21 13:07 ` tao jiang
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=201110150151405785431@gmail.com \
--to=jiangtao.jit@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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.