From: Andy Lutomirski <luto@MIT.EDU>
To: Sreeram B S <sreeramb@netapp.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: UDP requires 2 reads to obtain vital information - Kindly comment
Date: Wed, 10 Aug 2011 13:49:41 -0400 [thread overview]
Message-ID: <4E42C4B5.7010201@mit.edu> (raw)
In-Reply-To: <4E42B886.4030607@netapp.com>
On 08/10/2011 12:57 PM, Sreeram B S wrote:
> Respected people,
> I am Sreeram. I work on TCP/IP network applications.
> This mail is regarding UDP.
> Whenever a UDP datagram arrives, the receiver may wish to know the
> sender's IP address and also the destination address of that datagram.
> The recvfrom() function will return the sender's IP address. If the
> destination address of the datagram is required, then the user has to
> set the IP_PKTINFO socket option for the UDP socket and get the
> address as ancillary data in recvmsg(). So, the point here is that the
> user has to issue 2 reads on the same datagram (with the flag MSG_PEEK
> in first read call enabled) in order to obtain the sender's IP and the
> destination IP of the datagram.
Does the msg_name field of struct msghdr not work?
--Andy
next prev parent reply other threads:[~2011-08-10 17:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-10 16:57 UDP requires 2 reads to obtain vital information - Kindly comment Sreeram B S
2011-08-10 17:49 ` Andy Lutomirski [this message]
2011-08-10 17:50 ` Eric Dumazet
2011-08-11 5:50 ` Sreeram B S
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=4E42C4B5.7010201@mit.edu \
--to=luto@mit.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=sreeramb@netapp.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