summaryrefslogtreecommitdiffstats
path: root/lib/pbr.h
diff options
context:
space:
mode:
authorG. Paul Ziemba <paulz@labn.net>2023-07-31 04:14:01 +0200
committerG. Paul Ziemba <paulz@labn.net>2023-08-08 19:18:22 +0200
commitc47fd378f33b721cc32b788c6ce89353b1076416 (patch)
treea86e2a1e56e59248781cd1ccd21fb816d5b6b8d3 /lib/pbr.h
parentpbrd: PBR_FILTER_DSFIELD -> {PBR_FILTER_DSCP,PBR_FILTER_ECN} (diff)
downloadfrr-c47fd378f33b721cc32b788c6ce89353b1076416.tar.xz
frr-c47fd378f33b721cc32b788c6ce89353b1076416.zip
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 'lib/pbr.h')
-rw-r--r--lib/pbr.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/pbr.h b/lib/pbr.h
index 1c89f2f55..61a5eb07f 100644
--- a/lib/pbr.h
+++ b/lib/pbr.h
@@ -114,6 +114,7 @@ struct pbr_action {
*/
struct pbr_rule {
vrf_id_t vrf_id;
+ uint8_t family; /* netlink: select which rule database */
uint32_t seq;
uint32_t priority;