summaryrefslogtreecommitdiff
path: root/zebra/zebra_pbr.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_pbr.c')
-rw-r--r--zebra/zebra_pbr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c
index 9cc7ce905c..dd6e16bb70 100644
--- a/zebra/zebra_pbr.c
+++ b/zebra/zebra_pbr.c
@@ -57,6 +57,10 @@ uint32_t zebra_pbr_rules_hash_key(void *arg)
else
key = jhash_1word(0, key);
+ if (rule->filter.fwmark)
+ key = jhash_1word(rule->filter.fwmark, key);
+ else
+ key = jhash_1word(0, key);
return jhash_3words(rule->filter.src_port, rule->filter.dst_port,
prefix_hash_key(&rule->filter.dst_ip),
jhash_1word(rule->unique, key));
@@ -87,6 +91,9 @@ int zebra_pbr_rules_hash_equal(const void *arg1, const void *arg2)
if (r1->filter.dst_port != r2->filter.dst_port)
return 0;
+ if (r1->filter.fwmark != r2->filter.fwmark)
+ return 0;
+
if (!prefix_same(&r1->filter.src_ip, &r2->filter.src_ip))
return 0;