[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1349807275.2386.14.camel@joe-AO722>
Date: Tue, 09 Oct 2012 11:27:55 -0700
From: Joe Perches <joe@...ches.com>
To: Stephen Hemminger <shemminger@...tta.com>
Cc: David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH 1/6] vxlan: minor output refactoring
On Tue, 2012-10-09 at 10:56 -0700, Stephen Hemminger wrote:
> +static __be32 vxlan_find_dst(struct vxlan_dev *vxlan, struct sk_buff *skb)
> +{
> + const struct ethhdr *eth = (struct ethhdr *) skb->data;
> + struct vxlan_fdb *f;
> +
> + if (is_multicast_ether_addr(eth->h_dest) ||
> + (f = vxlan_find_mac(vxlan, eth->h_dest)) == NULL)
> + return vxlan->gaddr;
> + else
> + return f->remote_ip;
> +}
Bikeshedding:
This might be simpler to read with a few more lines like:
static __be32 vxlan_find_dst(struct vxlan_dev *vxlan, struct sk_buff *skb)
{
const struct ethhdr *eth = (const struct ethhdr *)skb->data;
struct vxlan_fdb *f;
if (is_multicast_ether_addr(eth->h_dest))
return vxlan->gaddr;
f = vxlan_find_mac(vxlan, eth->h_dest);
if (!f)
return vxlan->gaddr;
return f->remote_ip;
}
--
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