From b3194be286a6af28044375e893cfa0b095dba6e6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 4 Jul 2010 16:09:09 +0200 Subject: s3: Fix some type-punned warnings --- source3/nmbd/nmbd.c | 15 +++++++++------ source3/smbd/server.c | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'source3') diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index f211d6c671..d13607b1f5 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -255,8 +255,9 @@ static void reload_interfaces(time_t t) continue; } - ip = ((struct sockaddr_in *)&iface->ip)->sin_addr; - nmask = ((struct sockaddr_in *)&iface->netmask)->sin_addr; + ip = ((struct sockaddr_in *)(void *)&iface->ip)->sin_addr; + nmask = ((struct sockaddr_in *)(void *) + &iface->netmask)->sin_addr; /* * We don't want to add a loopback interface, in case @@ -264,7 +265,7 @@ static void reload_interfaces(time_t t) * ignore it here. JRA. */ - if (is_loopback_addr((struct sockaddr *)&iface->ip)) { + if (is_loopback_addr((struct sockaddr *)(void *)&iface->ip)) { DEBUG(2,("reload_interfaces: Ignoring loopback " "interface %s\n", print_sockaddr(str, sizeof(str), &iface->ip) )); @@ -303,8 +304,10 @@ static void reload_interfaces(time_t t) "ignoring non IPv4 interface.\n")); continue; } - ip = ((struct sockaddr_in *)&iface->ip)->sin_addr; - nmask = ((struct sockaddr_in *)&iface->netmask)->sin_addr; + ip = ((struct sockaddr_in *)(void *) + &iface->ip)->sin_addr; + nmask = ((struct sockaddr_in *)(void *) + &iface->netmask)->sin_addr; if (ip_equal_v4(ip, subrec->myip) && ip_equal_v4(nmask, subrec->mask_ip)) { break; @@ -434,7 +437,7 @@ static void msg_nmbd_send_packet(struct messaging_context *msg, } in_addr_to_sockaddr_storage(&ss, p->ip); - pss = iface_ip((struct sockaddr *)&ss); + pss = iface_ip((struct sockaddr *)(void *)&ss); if (pss == NULL) { DEBUG(2, ("Could not find ip for packet from %u\n", diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 65db77c0b9..a1250790ce 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -355,7 +355,7 @@ static void smbd_accept_connection(struct tevent_context *ev, pid_t pid = 0; uint64_t unique_id; - smbd_set_server_fd(accept(s->fd,(struct sockaddr *)&addr,&in_addrlen)); + smbd_set_server_fd(accept(s->fd, (struct sockaddr *)(void *)&addr,&in_addrlen)); if (smbd_server_fd() == -1 && errno == EINTR) return; -- cgit