From: arno@natisbad.org (Arnaud Ebalard)
To: Joe Perches <joe@perches.com>
Cc: "David S. Miller" <davem@davemloft.net>,
"YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>,
netdev@vger.kernel.org
Subject: Re: [PATCHv2] Refactor update of IPv6 flow destination address for srcrt (RH) option
Date: Tue, 01 Jun 2010 23:58:11 +0200 [thread overview]
Message-ID: <87mxve8lfw.fsf@small.ssi.corp> (raw)
In-Reply-To: <1275422925.19372.114.camel@Joe-Laptop.home> (Joe Perches's message of "Tue, 01 Jun 2010 13:08:45 -0700")
Hi,
Joe Perches <joe@perches.com> writes:
>> +static inline struct in6_addr *srcrt_dst_flow_update(struct in6_addr *final,
>> + struct in6_addr *fl6dst,
>> + const struct ipv6_txoptions *opt)
>> +{
>> + if (opt && opt->srcrt) {
>> + const struct rt0_hdr *rt0 = (struct rt0_hdr *)opt->srcrt;
>> + ipv6_addr_copy(final, fl6dst);
>> + ipv6_addr_copy(fl6dst, rt0->addr);
>> + return final;
>> + }
>> + return NULL;
>> +}
>> +
>
> Should this be inline? Maybe it'd be better moved to exthdrs.c
I thought it was small enough to keep it inline in ipv6.h but removing
the inline and moving it to exthdrs.c makes sense.
> Perhaps this is clearer as something like:
>
> /**
> * fl6_update_dst - update flow destination address
> *
> * @fl: flowlabel fl_dst to update
> * @opt: struct ipv6_txoptions
> * @orig: original fl_dst if modified
> *
> * Returns NULL if no txoptions or no srcrt, otherwise
> * returns orig and initial value of fl->fl6_dst set in orig
> */
> struct in6_addr *fl6_update_dst(struct ip6_flowlabel *fl,
> const struct ipv6_txoptions *opt,
> struct in6_addr *orig)
> {
> if (!opt || !opt->srcrt)
> return NULL;
>
> ipv6_addr_copy(orig, &fl->fl6_dst);
> ipv6_addr_copy(&fl->fl6_dst, ((struct rt0_hdr *)opt->srcrt)->addr);
> return orig;
> }
I'll send an updated new version tomorrow, i.e. in a few hours (with
s/ip6_flowlabel/flowi/).
Thanks for your feedback.
Cheers,
a+
next prev parent reply other threads:[~2010-06-01 21:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-01 16:20 [PATCH] Refactor update of IPv6 flow destination address for srcrt (RH) option Arnaud Ebalard
2010-06-01 19:17 ` [PATCHv2] " Arnaud Ebalard
2010-06-01 20:08 ` Joe Perches
2010-06-01 21:58 ` Arnaud Ebalard [this message]
2010-06-02 7:35 ` [PATCHv3] Refactor update of IPv6 flowi " Arnaud Ebalard
2010-06-02 14:08 ` David Miller
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=87mxve8lfw.fsf@small.ssi.corp \
--to=arno@natisbad.org \
--cc=davem@davemloft.net \
--cc=joe@perches.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.