From: Martin Schwenke Date: Fri, 10 Aug 2018 06:14:40 +0000 (+1000) Subject: ctdb-common: Initialise structures when declared X-Git-Tag: tdb-1.3.17~1979 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=172b87cb1be460a06b7bea0b598a5bf159d3faab;p=thirdparty%2Fsamba.git ctdb-common: Initialise structures when declared Instead of using ZERO_STRUCT(). Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/common/system_socket.c b/ctdb/common/system_socket.c index 434ce83c8b2..f9b61c59d80 100644 --- a/ctdb/common/system_socket.c +++ b/ctdb/common/system_socket.c @@ -173,14 +173,14 @@ static uint16_t ip6_checksum(uint16_t *data, size_t n, struct ip6_hdr *ip6) int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface) { int s, ret; - struct sockaddr_ll sall; + struct sockaddr_ll sall = {0}; struct ether_header *eh; struct arphdr *ah; struct ip6_hdr *ip6; struct nd_neighbor_advert *nd_na; struct nd_opt_hdr *nd_oh; struct ether_addr *ea; - struct ifreq if_hwaddr; + struct ifreq if_hwaddr = {{{0}}}; /* Size of IPv6 neighbor advertisement (with option) */ unsigned char buffer[sizeof(struct ether_header) + sizeof(struct ip6_hdr) + @@ -188,11 +188,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface) sizeof(struct nd_opt_hdr) + ETH_ALEN]; char *ptr; char bdcast[] = {0xff,0xff,0xff,0xff,0xff,0xff}; - struct ifreq ifr; - - ZERO_STRUCT(sall); - ZERO_STRUCT(ifr); - ZERO_STRUCT(if_hwaddr); + struct ifreq ifr = {{{0}}}; switch (addr->ip.sin_family) { case AF_INET: