]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: preinitialize rtrlib tr structures
authorMarcel Röthke <marcel.roethke@haw-hamburg.de>
Tue, 24 Mar 2020 13:36:04 +0000 (14:36 +0100)
committerMarcel Röthke <marcel.roethke@haw-hamburg.de>
Sat, 13 Jun 2020 11:44:39 +0000 (13:44 +0200)
The tr_*_config structs were previously not pre initialized because
every field is initialized explicitly. But future rtrlib version will
introduce additional fields. Preinitialising the entire struct will
ensure forward compatibility.

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
bgpd/bgp_rpki.c

index 1ba07e95e629eb2275d82b1eb3b74febb6f39105..be1df08ad2e1d97d7b1448218aaf132bf49c37e3 100644 (file)
@@ -811,7 +811,7 @@ static int add_tcp_cache(const char *host, const char *port,
 {
        struct rtr_socket *rtr_socket;
        struct tr_tcp_config *tcp_config =
-               XMALLOC(MTYPE_BGP_RPKI_CACHE, sizeof(struct tr_tcp_config));
+               XCALLOC(MTYPE_BGP_RPKI_CACHE, sizeof(struct tr_tcp_config));
        struct tr_socket *tr_socket =
                XMALLOC(MTYPE_BGP_RPKI_CACHE, sizeof(struct tr_socket));
        struct cache *cache =
@@ -845,7 +845,7 @@ static int add_ssh_cache(const char *host, const unsigned int port,
                         const uint8_t preference)
 {
        struct tr_ssh_config *ssh_config =
-               XMALLOC(MTYPE_BGP_RPKI_CACHE, sizeof(struct tr_ssh_config));
+               XCALLOC(MTYPE_BGP_RPKI_CACHE, sizeof(struct tr_ssh_config));
        struct cache *cache =
                XMALLOC(MTYPE_BGP_RPKI_CACHE, sizeof(struct cache));
        struct tr_socket *tr_socket =