summaryrefslogtreecommitdiffstats
path: root/zebra/rule_netlink.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-10-15 20:50:10 +0200
committerStephen Worley <sworley@cumulusnetworks.com>2019-10-15 21:03:46 +0200
commitb77a69bdc601133612d89cb5e389f014d3e68970 (patch)
tree1c1cfa729bf82db50d88c5836c778f3428f7e7d7 /zebra/rule_netlink.c
parentlib: Use ifindex_t for struct pbr_rule (diff)
downloadfrr-b77a69bdc601133612d89cb5e389f014d3e68970.tar.xz
frr-b77a69bdc601133612d89cb5e389f014d3e68970.zip
zebra: Use the rule ifindex as a hash key, not ifp
Use the ifindex value as a primary hash key/identifier, not the ifp pointer. It is possible for that data to be freed and then we would not be able to hash and find the rule entry anymore. Using the ifindex, we can still find the rule even if the interface is removed. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Diffstat (limited to 'zebra/rule_netlink.c')
-rw-r--r--zebra/rule_netlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/zebra/rule_netlink.c b/zebra/rule_netlink.c
index 711c4e087..1b465b033 100644
--- a/zebra/rule_netlink.c
+++ b/zebra/rule_netlink.c
@@ -123,7 +123,7 @@ static int netlink_rule_update(int cmd, struct zebra_pbr_rule *rule)
"Tx %s family %s IF %s(%u) Pref %u Fwmark %u Src %s Dst %s Table %u",
nl_msg_type_to_str(cmd), nl_family_to_str(family),
rule->ifp ? rule->ifp->name : "Unknown",
- rule->ifp ? rule->ifp->ifindex : 0, rule->rule.priority,
+ rule->rule.ifindex, rule->rule.priority,
rule->rule.filter.fwmark,
prefix2str(&rule->rule.filter.src_ip, buf1,
sizeof(buf1)),