From: lepton <ytht.net@gmail.com>
To: David Stevens <dlstevens@us.ibm.com>
Cc: lepton <ytht.net@gmail.com>, lkm <linux-kernel@vger.kernel.org>,
netdev@vger.kernel.org, netdev-owner@vger.kernel.org
Subject: Re: [PATCH RESEND] 2.6.22.6 networking [ipv4]: fix wrong destination when reply packetes
Date: Fri, 21 Sep 2007 14:03:01 +0800 [thread overview]
Message-ID: <20070921060301.GA6019@router.lepton.home> (raw)
In-Reply-To: <OFC759A0A2.B923AD69-ON8825735D.0017012F-8825735D.00191D21@us.ibm.com>
Now icmp_reply is only called by icmp_echo and icmp_timestamp
ip_send_reply is only called by tcp_v4_send_reset and tcp_v4_send_ack
I think in all situations the ip_hdr(skb)->saddr is set and should
be the destination of reply packets.
If using rt->rt_src as destination is correct in some situation,
can anyone give me a example?
I think perhaps it is a copy and paste from code like
ip_build_and_send_pkt, but reply packets in these situations
(icmp_echo and icmp_timestamp and tcp_v4_send_ack and tcp_v4_send_reset)
is diffrent, I think we can just use ip_hdr(skb)->saddr as
destination address.
On Thu, Sep 20, 2007 at 09:35:09PM -0700, David Stevens wrote:
> I'm not sure why it's using rt_src here, but there are relevant cases that
> your description doesn't cover. For example, what happens if the source
> is not set in the original packet? Does NAT affect this?
>
> You quote RFC text for ICMP echo and the case where the receiving machine
> is the final destination, but you're modifying code that is used for all
> ICMP
> types and used for ICMP errors generated when acting as an intermediate
> router.
>
> In ordinary cases, and certainly with ICMP echo when the source is set in
> the original packet and no rewriting is going on (and the address is not
> spoofed),
> using the original source as the destination is fine. But have you tested
> or
> considered the other cases?
>
> +-DLS
>
prev parent reply other threads:[~2007-09-21 6:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-21 2:23 [PATCH RESEND] 2.6.22.6 networking [ipv4]: fix wrong destination when reply packetes lepton
2007-09-21 4:35 ` David Stevens
2007-09-21 6:03 ` lepton [this message]
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=20070921060301.GA6019@router.lepton.home \
--to=ytht.net@gmail.com \
--cc=dlstevens@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev-owner@vger.kernel.org \
--cc=netdev@vger.kernel.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