summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_pbr.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2018-03-08 15:20:49 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2018-04-16 14:40:43 +0200
commit1907e4b80b03dbaea9cb13eb4b52b33d1b9d30d3 (patch)
treec9a89b39b37f2cd3e35936078375fc16b93024dd /zebra/zebra_pbr.c
parentzebra: handling notifications upon ipset creation/destruction done (diff)
downloadfrr-1907e4b80b03dbaea9cb13eb4b52b33d1b9d30d3.tar.xz
frr-1907e4b80b03dbaea9cb13eb4b52b33d1b9d30d3.zip
zebra: pbr rule structure is being added fwmark tag
PBR rule is being added a 32 bit value that can be used to record a rule in the kernel, by using a fwmark information. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
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 9cc7ce905..dd6e16bb7 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;