]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Fix up rule encoding to zebra so it works 7456/head
authorDonald Sharp <sharpd@nvidia.com>
Wed, 4 Nov 2020 14:11:53 +0000 (09:11 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Wed, 4 Nov 2020 14:11:53 +0000 (09:11 -0500)
Recent changes to the rule encoding that were made
did not get reflected in bgpd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_zebra.c

index 00213b4239431b703390796dfad274db40752195..957db4cbc123e79829937bd647f43140a38dfcf6 100644 (file)
@@ -2390,6 +2390,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;
@@ -2431,7 +2432,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);
@@ -2440,7 +2441,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,