summaryrefslogtreecommitdiff
path: root/bgpd/bgp_zebra.c
diff options
context:
space:
mode:
authorG. Paul Ziemba <paulz@labn.net>2023-07-30 19:14:01 -0700
committerG. Paul Ziemba <paulz@labn.net>2023-08-08 10:18:22 -0700
commitc47fd378f33b721cc32b788c6ce89353b1076416 (patch)
treea86e2a1e56e59248781cd1ccd21fb816d5b6b8d3 /bgpd/bgp_zebra.c
parent5572f45d51c587691384a9ec3a195e6a01540930 (diff)
pbrd: add explicit 'family' field for rules
In the netlink-mediated kernel dataplane, each rule is stored in either an IPv4-specific database or an IPv6-specific database. PBRD opportunistically gleans each rule's address family value from its source or destination IP address match value (if either exists), or from its nexthop or nexthop-group (if it exists). The 'family' value is particularly needed for netlink during incremental rule deletion when none of the above fields remain set. Before now, this address family has been encoded by occult means in the (possibly otherwise unset) source/destination IP match fields in ZAPI and zebra. This commit documents the reasons for maintaining the 'family' field in the PBRD rule structure, adds a 'family' field in the common lib/pbr.h rule structure, and carries it explicitly in ZAPI. Signed-off-by: G. Paul Ziemba <paulz@labn.net>
Diffstat (limited to 'bgpd/bgp_zebra.c')
-rw-r--r--bgpd/bgp_zebra.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 8ff6b63e05..9784c1c837 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -2737,6 +2737,7 @@ static void bgp_encode_pbr_rule_action(struct stream *s,
else
r.unique = pbra->unique;
+ r.family = fam;
/* filter */