summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-07-04 16:09:09 +0200
committerVolker Lendecke <vl@samba.org>2010-07-04 16:41:14 +0200
commitb3194be286a6af28044375e893cfa0b095dba6e6 (patch)
tree9e153217e848b9ac11fea8330e052bc042b74147
parenteb50f77154e23b9dc231926d5a0af07dd7761bc4 (diff)
downloadsamba-b3194be286a6af28044375e893cfa0b095dba6e6.tar.gz
samba-b3194be286a6af28044375e893cfa0b095dba6e6.tar.bz2
samba-b3194be286a6af28044375e893cfa0b095dba6e6.zip
s3: Fix some type-punned warnings
-rw-r--r--source3/nmbd/nmbd.c15
-rw-r--r--source3/smbd/server.c2
2 files changed, 10 insertions, 7 deletions
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;