lkml.org 
[lkml]   [2013]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 1/1] net: ipv4: refine the logic for determining daddr in ip_queue_xmit.
    From
    Date
    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.





    \
     
     \ /
      Last update: 2013-01-15 06:42    [W:5.112 / U:0.080 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site