In `bgpctl show flowspec inet` adjust the sent aid to a flowspec version.
The parser returns AID_INET, AID_INET6 (or the currently unsuported
AID_VPNv4/6) but bgpd wants AID_FLOWSPECv4 and AID_FLOWSPECv6.
Fix this up before sending the command.

-- 
:wq Claudio

Index: bgpctl.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpctl/bgpctl.c,v
retrieving revision 1.293
diff -u -p -r1.293 bgpctl.c
--- bgpctl.c    21 Apr 2023 10:49:01 -0000      1.293
+++ bgpctl.c    21 Apr 2023 15:28:00 -0000
@@ -386,7 +386,20 @@ main(int argc, char *argv[])
                break;
        case FLOWSPEC_SHOW:
                memset(&ribreq, 0, sizeof(ribreq));
-               ribreq.aid = res->aid;
+               switch (res->aid) {
+               case AID_INET:
+                       ribreq.aid = AID_FLOWSPECv4;
+                       break;
+               case AID_INET6:
+                       ribreq.aid = AID_FLOWSPECv6;
+                       break;
+               case AID_UNSPEC:
+                       ribreq.aid = res->aid;;
+                       break;
+               default:
+                       errx(1, "flowspec family %s currently not supported",
+                           aid2str(res->aid));
+               }
                strlcpy(ribreq.rib, res->rib, sizeof(ribreq.rib));
                imsg_compose(ibuf, IMSG_CTL_SHOW_FLOWSPEC, 0, 0, -1,
                    &ribreq, sizeof(ribreq));

Reply via email to