vxlan: properly handle LOOSE_COMPARISON in ->io_compare

This lets us match links only on the attributes that have actually been
set, instead of comparing all attributes.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Sabrina Dubroca 2016-06-07 13:57:22 +02:00 committed by Thomas Haller
parent 9702bb14ff
commit 89e7effa9a

View File

@ -451,7 +451,7 @@ static int vxlan_compare(struct rtnl_link *link_a, struct rtnl_link *link_b,
struct vxlan_info *a = link_a->l_info; struct vxlan_info *a = link_a->l_info;
struct vxlan_info *b = link_b->l_info; struct vxlan_info *b = link_b->l_info;
int diff = 0; int diff = 0;
uint32_t attrs = ~0; uint32_t attrs = flags & LOOSE_COMPARISON ? b->ce_mask : ~0;
#define VXLAN_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, VXLAN_ATTR_##ATTR, a, b, EXPR) #define VXLAN_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, VXLAN_ATTR_##ATTR, a, b, EXPR)