From: Brian Haley <brian.haley@hp.com>
To: David L Stevens <dlstevens@us.ibm.com>,
David Miller <davem@davemloft.net>,
Stephen Hemminger <shemminger@vyatta.com>,
Cong Wang <amwang@redhat.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCHv3 net-next] VXLAN: fix nonfunctional neigh_reduce
Date: Tue, 18 Mar 2014 13:44:07 -0400 [thread overview]
Message-ID: <532885E7.9090602@hp.com> (raw)
In-Reply-To: <201403181620.s2IGKHcW028664@lab1.dls>
On 03/18/2014 12:20 PM, David L Stevens wrote:
>
> The VXLAN neigh_reduce() code is completely non-functional since
> check-in. Specific errors:
<snip>
>
> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
> index eb59b14..f6ddde9 100644
> --- a/drivers/net/vxlan.c
> +++ b/drivers/net/vxlan.c
> @@ -1336,14 +1336,102 @@ out:
> }
>
> #if IS_ENABLED(CONFIG_IPV6)
> +
> +static struct sk_buff *vxlan_na_create(struct sk_buff *request,
> + struct neighbour *n, bool isrouter)
> +{
> + struct net_device *dev = request->dev;
> + struct sk_buff *reply = NULL;
Don't need this initialization as it's assigned below before using.
> + struct nd_msg *ns, *na;
> + struct ipv6hdr *pip6;
> + u8 *daddr;
> + int olen = 8; /* opt hdr + ETH_ALEN for target */
> + int i, len;
> +
> + if (dev == NULL)
> + return NULL;
> +
> + ns = (struct nd_msg *)skb_transport_header(request);
Nit: don't use this until below, can move initialization.
> + len = LL_RESERVED_SPACE(dev) + sizeof(struct ipv6hdr) +
> + sizeof(*na) + olen + dev->needed_tailroom;
> + reply = alloc_skb(len, GFP_ATOMIC);
> + if (reply == NULL)
> + return NULL;
> +
> + reply->protocol = htons(ETH_P_IPV6);
> + reply->dev = dev;
> + skb_reserve(reply, LL_RESERVED_SPACE(request->dev));
> + skb_push(reply, sizeof(struct ethhdr));
> + skb_set_mac_header(reply, 0);
> +
> + daddr = eth_hdr(request)->h_source;
> + olen = request->len - skb_transport_offset(request) - sizeof(*ns);
> + for (i = 0; i < olen-1; i += (ns->opt[i+1]<<3)) {
> + if (ns->opt[i] == ND_OPT_SOURCE_LL_ADDR) {
> + daddr = ns->opt + i + sizeof(struct nd_opt_hdr);
> + break;
> + }
> + }
> +
> + /* Ethernet header */
> + memcpy(eth_hdr(reply)->h_dest, daddr, ETH_ALEN);
> + memcpy(eth_hdr(reply)->h_source, n->ha, ETH_ALEN);
Can use ether_addr_copy() here.
-Brian
prev parent reply other threads:[~2014-03-18 17:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 16:20 [PATCHv3 net-next] VXLAN: fix nonfunctional neigh_reduce David L Stevens
2014-03-18 17:36 ` Cong Wang
2014-03-18 17:44 ` Brian Haley [this message]
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=532885E7.9090602@hp.com \
--to=brian.haley@hp.com \
--cc=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=dlstevens@us.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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.