From 9b6710b406ff7ba6e6b6d356a678edb746066424 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 21 Apr 2015 10:13:07 +0200 Subject: [PATCH] *: 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 --- bgpd/bgp_routemap.c | 4 ++-- ripngd/ripngd.c | 2 +- zebra/ioctl.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index d32c79d204..11b6919bf2 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -240,8 +240,8 @@ route_match_peer (void *rule, struct prefix *prefix, route_map_object_t type, 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 e026d4748e..277adce33e 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -1319,7 +1319,7 @@ ripng_read (struct thread *thread) 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 24df98557d..f91ee2438d 100644 --- a/zebra/ioctl.c +++ b/zebra/ioctl.c @@ -52,7 +52,7 @@ if_ioctl (u_long request, caddr_t buffer) { 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 @@ if_ioctl_ipv6 (u_long request, caddr_t buffer) { int sock; int ret; - int err; + int err = 0; if (zserv_privs.change(ZPRIVS_RAISE)) zlog (NULL, LOG_ERR, "Can't raise privileges"); -- 2.39.5