Browse Source

*: 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>
David Lamparter 4 years ago
parent
commit
6ed810d986
3 changed files with 5 additions and 5 deletions
  1. 2 2
      bgpd/bgp_routemap.c
  2. 1 1
      ripngd/ripngd.c
  3. 2 2
      zebra/ioctl.c

+ 2 - 2
bgpd/bgp_routemap.c

@@ -131,8 +131,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;

+ 1 - 1
ripngd/ripngd.c

@@ -1317,7 +1317,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;
 

+ 2 - 2
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");