mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-29 23:09:34 +00:00
lib, zebra: add ip_proto to the filter data structure
Add ip_proto to the filter data structure and also account for it in the hash when stored. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
8ccbc778cf
commit
b94683f0db
@ -68,6 +68,9 @@ struct pbr_filter {
|
|||||||
|
|
||||||
/* Filter with fwmark */
|
/* Filter with fwmark */
|
||||||
uint32_t fwmark;
|
uint32_t fwmark;
|
||||||
|
|
||||||
|
/* Filter with the ip protocol */
|
||||||
|
uint8_t ip_proto;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -166,10 +166,8 @@ uint32_t zebra_pbr_rules_hash_key(const void *arg)
|
|||||||
rule->rule.action.table,
|
rule->rule.action.table,
|
||||||
prefix_hash_key(&rule->rule.filter.src_ip));
|
prefix_hash_key(&rule->rule.filter.src_ip));
|
||||||
|
|
||||||
if (rule->rule.filter.fwmark)
|
key = jhash_3words(rule->rule.filter.fwmark, rule->vrf_id,
|
||||||
key = jhash_2words(rule->rule.filter.fwmark, rule->vrf_id, key);
|
rule->rule.filter.ip_proto, key);
|
||||||
else
|
|
||||||
key = jhash_1word(rule->vrf_id, key);
|
|
||||||
|
|
||||||
key = jhash(rule->ifname, strlen(rule->ifname), 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)
|
if (r1->rule.filter.fwmark != r2->rule.filter.fwmark)
|
||||||
return false;
|
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))
|
if (!prefix_same(&r1->rule.filter.src_ip, &r2->rule.filter.src_ip))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user