]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: fix uninitialized prefixes in the handling of FEC messages
authorRenato Westphal <renato@opensourcerouting.org>
Wed, 20 Sep 2017 03:02:50 +0000 (00:02 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Mon, 9 Oct 2017 23:15:14 +0000 (20:15 -0300)
This was causing some weird prefixes to pop up in my log files. One
alternate solution would be to call apply_mask() on the prefix, but
memcpy() is faster and just enough in this case.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
zebra/zserv.c

index fd2c5dd97cd5d946260f76a1d8b37d16e86c9dd1..f888207818ea1b307b1928fbf677e757b9849d93 100644 (file)
@@ -825,6 +825,7 @@ static int zserv_fec_register(struct zserv *client, int sock, u_short length)
 
        while (l < length) {
                flags = stream_getw(s);
+               memset(&p, 0, sizeof(p));
                p.family = stream_getw(s);
                if (p.family != AF_INET && p.family != AF_INET6) {
                        zlog_err(
@@ -875,6 +876,7 @@ static int zserv_fec_unregister(struct zserv *client, int sock, u_short length)
        while (l < length) {
                // flags = stream_getw(s);
                (void)stream_getw(s);
+               memset(&p, 0, sizeof(p));
                p.family = stream_getw(s);
                if (p.family != AF_INET && p.family != AF_INET6) {
                        zlog_err(