From: "Nadav Har'El" <nyh@math.technion.ac.il>
To: Erik De Bonte <erikd@lithtech.com>
Cc: "'Philippe Troin'" <phil@fifi.org>,
"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: Re: Determining IP:port corresponding to an ICMP port unreachable
Date: Tue, 31 Jul 2001 22:20:10 +0300 [thread overview]
Message-ID: <20010731222010.A29535@leeor.math.technion.ac.il> (raw)
In-Reply-To: <AF020C5FC551DD43A4958A679EA16A1501349560@mailcluster.lith.com>
In-Reply-To: <AF020C5FC551DD43A4958A679EA16A1501349560@mailcluster.lith.com>; from erikd@lithtech.com on Tue, Jul 31, 2001 at 12:03:14PM -0700
On Tue, Jul 31, 2001, Erik De Bonte wrote about "RE: Determining IP:port corresponding to an ICMP port unreachable":
> Nadav Har'El said:
> > But for non-connected()ed sockets, you can only find out the host
> > sending the ICMP message.
>
> Why? The remote port is in the ICMP message (64-bits of the undeliverable
> message's header are in there), right? Why can't the kernel net code
> extract the port and give it to me? It's obviously possible, since Winsock
> does it.**
I outlined the problem with the standard socket API (note I said API, not
theoretical possibility to look at the packet content) in my previous message,
including a pointer to Stevens' book which explains the issue far better
than I can.
Anyway, since the IP_RECVERR is a "hack" to get more information which is
not available with the standard API, it's theoretically possible to add to it
anything, including the destination IP address and port on the original
packet. Read ip(7) carefully: it would appear that either the SOCK_EE_OFFENDER
macro or the actual data (not anciliary data) received from the error queue
can help you.
Too bad that this IP_RECVERR seems to be a completely non-standard Linux-only
feature...
--
Nadav Har'El | Tuesday, Jul 31 2001, 12 Av 5761
nyh@math.technion.ac.il |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |Jury: Twelve people who determine which
http://nadav.harel.org.il |client has the better lawyer.
next prev parent reply other threads:[~2001-07-31 19:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-31 19:03 Determining IP:port corresponding to an ICMP port unreachable Erik De Bonte
2001-07-31 19:20 ` Nadav Har'El [this message]
2001-08-01 22:53 ` Alexey Kuznetsov
-- strict thread matches above, loose matches on Subject: below --
2001-07-30 23:08 Erik De Bonte
2001-07-31 8:11 ` Nadav Har'El
2001-07-31 16:41 ` Philippe Troin
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=20010731222010.A29535@leeor.math.technion.ac.il \
--to=nyh@math.technion.ac.il \
--cc=erikd@lithtech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=phil@fifi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox