]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: fix rpki compilation without rtrlib ssh
authorLouis Scalbert <louis.scalbert@6wind.com>
Thu, 21 Dec 2023 10:41:53 +0000 (11:41 +0100)
committerLouis Scalbert <louis.scalbert@6wind.com>
Thu, 11 Jan 2024 13:13:46 +0000 (14:13 +0100)
Fix RPKI module compilation when rtrlib is compiled without SSH support,
ie. with cmake option:

> -D RTRLIB_TRANSPORT_SSH=No

> bgpd/bgp_rpki.c: In function ‘config_write’:
> bgpd/bgp_rpki.c:1062:3: error: enumeration value ‘SSH’ not handled in switch [-Werror=switch-enum]
>  1062 |   switch (cache->type) {
>       |   ^~~~~~
> bgpd/bgp_rpki.c: In function ‘show_rpki_cache_connection_magic’:
> bgpd/bgp_rpki.c:1598:3: error: enumeration value ‘SSH’ not handled in switch [-Werror=switch-enum]
>  1598 |   switch (cache->type) {
>       |   ^~~~~~
> cc1: all warnings being treated as errors

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
bgpd/bgp_rpki.c

index 546438551e30e687bade4259aa02898a8d4de0b1..5782cb5391e02a1dfd78d96d247e410c8a64a8ad 100644 (file)
@@ -63,7 +63,12 @@ static struct event *t_rpki_sync;
 #define RPKI_OUTPUT_STRING "Control rpki specific settings\n"
 
 struct cache {
-       enum { TCP, SSH } type;
+       enum {
+               TCP,
+#if defined(FOUND_SSH)
+               SSH
+#endif
+       } type;
        struct tr_socket *tr_socket;
        union {
                struct tr_tcp_config *tcp_config;