lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 25 Feb 2022 09:50:53 -0800
From:   Roopa Prabhu <roopa@...dia.com>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     davem@...emloft.net, netdev@...r.kernel.org,
        stephen@...workplumber.org, nikolay@...ulusnetworks.com,
        idosch@...dia.com, dsahern@...il.com, bpoirier@...dia.com
Subject: Re: [PATCH net-next v2 09/12] vxlan: vni filtering support on collect
 metadata device


On 2/23/22 20:04, Jakub Kicinski wrote:
> On Tue, 22 Feb 2022 02:52:27 +0000 Roopa Prabhu wrote:
>> diff --git a/drivers/net/vxlan/vxlan_private.h b/drivers/net/vxlan/vxlan_private.h
>> index 7a946010a204..d697d6c51cb5 100644
>> --- a/drivers/net/vxlan/vxlan_private.h
>> +++ b/drivers/net/vxlan/vxlan_private.h
>> @@ -7,6 +7,8 @@
>>   #ifndef _VXLAN_PRIVATE_H
>>   #define _VXLAN_PRIVATE_H
>>   
>> +#include <linux/rhashtable.h>
>> +
>>   extern unsigned int vxlan_net_id;
>>   extern const u8 all_zeros_mac[ETH_ALEN + 2];
>>   
>> @@ -92,6 +94,38 @@ bool vxlan_addr_equal(const union vxlan_addr *a, const union vxlan_addr *b)
>>   
>>   #endif
>>   
>> +static inline int vxlan_vni_cmp(struct rhashtable_compare_arg *arg,
>> +				const void *ptr)
>> +{
>> +	const struct vxlan_vni_node *vnode = ptr;
>> +	__be32 vni = *(__be32 *)arg->key;
>> +
>> +	return vnode->vni != vni;
>> +}
> This one is called thru a pointer so can as well move to a C source
> with the struct, see below.
>
>> +static const struct rhashtable_params vxlan_vni_rht_params = {
>> +	.head_offset = offsetof(struct vxlan_vni_node, vnode),
>> +	.key_offset = offsetof(struct vxlan_vni_node, vni),
>> +	.key_len = sizeof(__be32),
>> +	.nelem_hint = 3,
>> +	.max_size = VXLAN_N_VID,
>> +	.obj_cmpfn = vxlan_vni_cmp,
>> +	.automatic_shrinking = true,
>> +};
> struct definition in the header? Shouldn't it be an extern and
> definition in a C file?

dont remember why i accidentally moved it to the header file a few 
internal revisions back.

you are correct. Will fix. thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ