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.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c
index 73c2c3dda3..3607110aa2 100644
--- a/zebra/zebra_pbr.c
+++ b/zebra/zebra_pbr.c
@@ -166,10 +166,8 @@ uint32_t zebra_pbr_rules_hash_key(const void *arg)
rule->rule.action.table,
prefix_hash_key(&rule->rule.filter.src_ip));
- if (rule->rule.filter.fwmark)
- key = jhash_2words(rule->rule.filter.fwmark, rule->vrf_id, key);
- else
- key = jhash_1word(rule->vrf_id, key);
+ key = jhash_3words(rule->rule.filter.fwmark, rule->vrf_id,
+ rule->rule.filter.ip_proto, key);
key = jhash(rule->ifname, strlen(rule->ifname), key);
@@ -207,6 +205,9 @@ bool zebra_pbr_rules_hash_equal(const void *arg1, const void *arg2)
if (r1->rule.filter.fwmark != r2->rule.filter.fwmark)
return false;
+ if (r1->rule.filter.ip_proto != r2->rule.filter.ip_proto)
+ return false;
+
if (!prefix_same(&r1->rule.filter.src_ip, &r2->rule.filter.src_ip))
return false;
@@ -925,8 +926,8 @@ static const char *zebra_pbr_prefix2str(union prefixconstptr pu,
const struct prefix *p = pu.p;
char buf[PREFIX2STR_BUFFER];
- if ((p->family == AF_INET && p->prefixlen == IPV4_MAX_PREFIXLEN) ||
- (p->family == AF_INET6 && p->prefixlen == IPV6_MAX_PREFIXLEN)) {
+ if ((p->family == AF_INET && p->prefixlen == IPV4_MAX_BITLEN)
+ || (p->family == AF_INET6 && p->prefixlen == IPV6_MAX_BITLEN)) {
snprintf(str, size, "%s", inet_ntop(p->family, &p->u.prefix,
buf, PREFIX2STR_BUFFER));
return str;