platform: compare routing rules according to kernel support for FRA_L3MDEV

Also, in nm_platform_routing_rule_cmp() always compare the routing
table field, also if l3mdev is set. For kernel, we cannot set table and
l3mdev together, hence such rules don't really exist (or if we try to
configure it, it will be rejected by kernel). But as far as
nm_platform_routing_rule_cmp() is concerned, if the table is set,
always compare it.
This commit is contained in:
Thomas Haller
2019-04-17 11:04:10 +02:00
parent b843c1eab8
commit b6ff02e76f

View File

@@ -7463,9 +7463,12 @@ nm_platform_routing_rule_hash_update (const NMPlatformRoutingRule *obj,
: FALSE)), : FALSE)),
obj->suppress_prefixlen_inverse, obj->suppress_prefixlen_inverse,
obj->suppress_ifgroup_inverse, obj->suppress_ifgroup_inverse,
( cmp_full ( _routing_rule_compare (cmp_type,
? obj->l3mdev NM_PLATFORM_KERNEL_SUPPORT_TYPE_FRA_L3MDEV)
: (guint8) !!obj->l3mdev), ? ( cmp_full
? (guint16) obj->l3mdev
: (guint16) !!obj->l3mdev)
: G_MAXUINT16),
obj->action, obj->action,
obj->tos, obj->tos,
obj->src_len, obj->src_len,
@@ -7540,13 +7543,15 @@ nm_platform_routing_rule_cmp (const NMPlatformRoutingRule *a,
NM_CMP_FIELD (a, b, priority); NM_CMP_FIELD (a, b, priority);
NM_CMP_FIELD (a, b, tun_id); NM_CMP_FIELD (a, b, tun_id);
if (cmp_full) if (_routing_rule_compare (cmp_type,
NM_CMP_FIELD (a, b, l3mdev); NM_PLATFORM_KERNEL_SUPPORT_TYPE_FRA_L3MDEV)) {
else if (cmp_full)
NM_CMP_FIELD_BOOL (a, b, l3mdev); NM_CMP_FIELD (a, b, l3mdev);
else
NM_CMP_FIELD_BOOL (a, b, l3mdev);
}
if (cmp_full || !a->l3mdev) NM_CMP_FIELD (a, b, table);
NM_CMP_FIELD (a, b, table);
NM_CMP_DIRECT (a->flags & flags_mask, b->flags & flags_mask); NM_CMP_DIRECT (a->flags & flags_mask, b->flags & flags_mask);