[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4CE1A710.9040603@hp.com>
Date: Mon, 15 Nov 2010 16:33:04 -0500
From: Brian Haley <brian.haley@...com>
To: Changli Gao <xiaosuo@...il.com>
CC: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH] net: use the macros defined for the members of flowi
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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists