From ee3e14f93122ab571906b06aa5b7e7410291cbbd Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 4 Nov 2020 09:11:53 -0500 Subject: [PATCH] bgpd: Fix up rule encoding to zebra so it works Recent changes to the rule encoding that were made did not get reflected in bgpd. Signed-off-by: Donald Sharp --- bgpd/bgp_zebra.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index b203238520..a3ad5e9ea7 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -2366,6 +2366,7 @@ static void bgp_encode_pbr_rule_action(struct stream *s, { struct prefix pfx; uint8_t fam = AF_INET; + char ifname[INTERFACE_NAMSIZ]; if (pbra->nh.type == NEXTHOP_TYPE_IPV6) fam = AF_INET6; @@ -2407,7 +2408,7 @@ static void bgp_encode_pbr_rule_action(struct stream *s, stream_put(s, &pfx.u.prefix, prefix_blen(&pfx)); stream_putw(s, 0); /* dst port */ - + stream_putc(s, 0); /* dsfield */ /* if pbr present, fwmark is not used */ if (pbr) stream_putl(s, 0); @@ -2416,7 +2417,8 @@ static void bgp_encode_pbr_rule_action(struct stream *s, stream_putl(s, pbra->table_id); - stream_putl(s, 0); /* ifindex unused */ + memset(ifname, 0, sizeof(ifname)); + stream_put(s, ifname, INTERFACE_NAMSIZ); /* ifname unused */ } static void bgp_encode_pbr_ipset_match(struct stream *s, -- 2.39.5