From: Brian Haley <brian.haley@hp.com>
To: Changli Gao <xiaosuo@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH] net: use the macros defined for the members of flowi
Date: Mon, 15 Nov 2010 16:33:04 -0500 [thread overview]
Message-ID: <4CE1A710.9040603@hp.com> (raw)
In-Reply-To: <1289623435-22713-1-git-send-email-xiaosuo@gmail.com>
On 11/12/2010 11:43 PM, Changli Gao wrote:
> Use the macros defined for the members of flowi to clean the code up.
>
> diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
> index 865fd76..36cd0b7 100644
> --- a/net/bridge/br_netfilter.c
> +++ b/net/bridge/br_netfilter.c
> @@ -412,13 +412,8 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb)
> if (dnat_took_place(skb)) {
> if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) {
> struct flowi fl = {
> - .nl_u = {
> - .ip4_u = {
> - .daddr = iph->daddr,
> - .saddr = 0,
> - .tos = RT_TOS(iph->tos) },
> - },
> - .proto = 0,
> + .fl4_dst = iph->daddr,
> + .fl4_tos = RT_TOS(iph->tos),
> };
Are these actually equivalent? You dropped two assignments to zero.
I always thought things on the stack weren't.
Thanks,
-Brian
next prev parent reply other threads:[~2010-11-15 21:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-13 4:43 [PATCH] net: use the macros defined for the members of flowi Changli Gao
2010-11-15 21:33 ` Brian Haley [this message]
2010-11-15 21:38 ` Eric Dumazet
2010-11-15 21:57 ` Eric Dumazet
2010-11-16 1:56 ` David Miller
2010-11-17 20:29 ` 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=4CE1A710.9040603@hp.com \
--to=brian.haley@hp.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=xiaosuo@gmail.com \
/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.