*: fix more initialisers (for BSD)
FreeBSD and NetBSD spew a few more warnings about variable initialisers.
Found with OSR's/NetDEF's fancy new CI system.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index 33f802c..416a3e5 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -131,8 +131,8 @@
void *object)
{
union sockunion *su;
- union sockunion su_def = { .sin.sin_family = AF_INET,
- .sin.sin_addr.s_addr = INADDR_ANY };
+ union sockunion su_def = { .sin = { .sin_family = AF_INET,
+ .sin_addr.s_addr = INADDR_ANY } };
struct peer_group *group;
struct peer *peer;
struct listnode *node, *nnode;
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index 82e3818..4c0b67d 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -1317,7 +1317,7 @@
int sock;
struct sockaddr_in6 from;
struct ripng_packet *packet;
- unsigned int ifindex;
+ unsigned int ifindex = 0;
struct interface *ifp;
int hoplimit = -1;
diff --git a/zebra/ioctl.c b/zebra/ioctl.c
index d783b0a..f7a7ff4 100644
--- a/zebra/ioctl.c
+++ b/zebra/ioctl.c
@@ -52,7 +52,7 @@
{
int sock;
int ret;
- int err;
+ int err = 0;
if (zserv_privs.change(ZPRIVS_RAISE))
zlog (NULL, LOG_ERR, "Can't raise privileges");
@@ -85,7 +85,7 @@
{
int sock;
int ret;
- int err;
+ int err = 0;
if (zserv_privs.change(ZPRIVS_RAISE))
zlog (NULL, LOG_ERR, "Can't raise privileges");