From: Eric Dumazet <eric.dumazet@gmail.com>
To: Harvey Yang <harvey.huawei.yang@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
James Morris <jmorris@namei.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] net: ipv4: refine the logic for determining daddr in ip_queue_xmit.
Date: Mon, 14 Jan 2013 20:57:09 -0800 [thread overview]
Message-ID: <1358225829.8744.4508.camel@edumazet-glaptop> (raw)
In-Reply-To: <1358225255-30973-1-git-send-email-harvey.huawei.yang@gmail.com>
On Tue, 2013-01-15 at 12:47 +0800, Harvey Yang wrote:
> The destination address daddr is faddr if source route option is set, otherwise it is inet_daddr. So use if-else to assign the value.
>
> Signed-off-by: Harvey Yang <harvey.huawei.yang@gmail.com>
> ---
> net/ipv4/ip_output.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
> index 3e98ed2..22b738c 100644
> --- a/net/ipv4/ip_output.c
> +++ b/net/ipv4/ip_output.c
> @@ -349,10 +349,10 @@ int ip_queue_xmit(struct sk_buff *skb, struct flowi *fl)
> __be32 daddr;
>
> /* Use correct destination address if we have options. */
> - daddr = inet->inet_daddr;
> if (inet_opt && inet_opt->opt.srr)
> daddr = inet_opt->opt.faddr;
> -
> + else
> + daddr = inet->inet_daddr;
> /* If this fails, retransmit mechanism of transport layer will
> * keep trying until route appears or the connection times
> * itself out.
Current code is faster, srr is not often used.
next prev parent reply other threads:[~2013-01-15 4:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-15 4:47 Harvey Yang
2013-01-15 4:48 ` David Miller
2013-01-15 4:57 ` Eric Dumazet [this message]
2013-01-15 10:12 ` Cong Ding
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=1358225829.8744.4508.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=harvey.huawei.yang@gmail.com \
--cc=jmorris@namei.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.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
all inboxes | Powered by JetHome®