summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-06-04 14:25:14 -0400
committerDonald Sharp <sharpd@nvidia.com>2021-07-08 11:12:47 -0400
commitf56697eff3890c21b434f84f34304320462c8d37 (patch)
treef6e871e281b61449a76b1fd90e82b48bb1d4f93e
parentb94683f0db071775ce2d9e92c711f8f7f9acd1b3 (diff)
bgpd, pbrd, zebra: Encode/decode the ip proto from daemons to zebra
Ensure that we properly encode/decode the ip protocol from daemons to zebra. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
-rw-r--r--bgpd/bgp_zebra.c1
-rw-r--r--pbrd/pbr_zebra.c1
-rw-r--r--zebra/zapi_msg.c4
3 files changed, 6 insertions, 0 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index ec71e17034..002758bda9 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -2573,6 +2573,7 @@ static void bgp_encode_pbr_rule_action(struct stream *s,
stream_putl(s, pbr->unique);
else
stream_putl(s, pbra->unique);
+ stream_putc(s, 0); /* ip protocol being used */
if (pbr && pbr->flags & MATCH_IP_SRC_SET)
memcpy(&pfx, &(pbr->src), sizeof(struct prefix));
else {
diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c
index 8e21d24d03..cf7fc16b36 100644
--- a/pbrd/pbr_zebra.c
+++ b/pbrd/pbr_zebra.c
@@ -534,6 +534,7 @@ static void pbr_encode_pbr_map_sequence(struct stream *s,
stream_putl(s, pbrms->seqno);
stream_putl(s, pbrms->ruleno);
stream_putl(s, pbrms->unique);
+ stream_putc(s, 0); /* The ip_proto */
pbr_encode_pbr_map_sequence_prefix(s, pbrms->src, family);
stream_putw(s, pbrms->src_prt);
pbr_encode_pbr_map_sequence_prefix(s, pbrms->dst, family);
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index 8f2aa2fb09..d760432eb1 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -3131,6 +3131,7 @@ static inline void zread_rule(ZAPI_HANDLER_ARGS)
STREAM_GETL(s, zpr.rule.seq);
STREAM_GETL(s, zpr.rule.priority);
STREAM_GETL(s, zpr.rule.unique);
+ STREAM_GETC(s, zpr.rule.filter.ip_proto);
STREAM_GETC(s, zpr.rule.filter.src_ip.family);
STREAM_GETC(s, zpr.rule.filter.src_ip.prefixlen);
STREAM_GET(&zpr.rule.filter.src_ip.u.prefix, s,
@@ -3164,6 +3165,9 @@ static inline void zread_rule(ZAPI_HANDLER_ARGS)
if (zpr.rule.filter.dsfield)
zpr.rule.filter.filter_bm |= PBR_FILTER_DSFIELD;
+ if (zpr.rule.filter.ip_proto)
+ zpr.rule.filter.filter_bm |= PBR_FILTER_IP_PROTOCOL;
+
if (zpr.rule.filter.fwmark)
zpr.rule.filter.filter_bm |= PBR_FILTER_FWMARK;