[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OFCDE8D1D8.B2E1BD73-ON87257CA0.007580F9-87257CA0.007580FE@us.ibm.com>
Date: Wed, 19 Mar 2014 15:23:27 -0600
From: David Stevens <dlstevens@...ibm.com>
To: David Miller <davem@...emloft.net>
Cc: amwang@...hat.com, netdev@...r.kernel.org, shemminger@...tta.com
Subject: Re: [PATCHv5 net-next] VXLAN: fix nonfunctional neigh_reduce
-----David Miller <davem@...emloft.net> wrote: -----
>
>> + if (dev == NULL)
>> + return NULL;
>> +
>> +
>> + len = LL_RESERVED_SPACE(dev) + sizeof(struct ipv6hdr) +
>> + sizeof(*na) + olen + dev->needed_tailroom;
>
>No need to have two empty lines here, one is sufficient.
>
>> + olen = request->len - skb_transport_offset(request) -
>sizeof(*ns);
>
>This overrides unconditionally, and in all cases, the assignment made
>in the declaration of the 'olen' variable. Therefore the variable
>declaration should not have an initializer. Please remove it.
...
>
>> + olen = 8; /* ND_OPT_TARGET_LL_ADDR */
>
>I guess this is what the variable declaration assignment was
>meant to be used for.
There are 2 packets, neighbor solicitation (received) and
neighbor advertisement (reply) and "olen" is initially the option length
of the NA, a constant, for allocating its buffer. After that, the temporary
variable "olen" is set to the variable length of the options in the
received packet (NS) and used for processing its options.
So, it's an option length in both cases, but not the same
value and not for the same packet, throughout.
I can use a constant for the reply packet case, or a different variable;
I overloaded "olen" for the allocation primarily because I had a naked "8"
before that, and a #define seemed like overkill here.
>This is also ndisc_opt_addr_space(dev).
>
>> + na->opt[1] = 1; /* 8 bytes */
>
>This is perhaps more clearly expressed as "opt >> 3".
>> @@ -1357,8 +1446,7 @@ static int neigh_reduce(struct net_device
>*dev, struct sk_buff *skb)
>> saddr = &iphdr->saddr;
>> daddr = &iphdr->daddr;
>>
>> - if (ipv6_addr_loopback(daddr) ||
>> - ipv6_addr_is_multicast(daddr))
>> + if (ipv6_addr_loopback(daddr))
>> goto out;
>>
>> msg = (struct nd_msg *)skb_transport_header(skb);
>
>Note that the ipv6 stack input path checks to make sure that the
>msg->target is not multicast. Just something I noticed.
I could; a multicast address won't be in the neighbor table, so it won't
respond either way, which is why I didn't bother with the check.
I'll incorporate these and repost.
+-DLS
--
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