summaryrefslogtreecommitdiff
path: root/native/jni
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2009-10-22 16:51:18 +0000
committerAndrew Haley <aph@redhat.com>2009-10-22 16:51:18 +0000
commitd13376fc5a0bb0a2ee0246e76ee3319e6baf9516 (patch)
tree04e140c03b4123587b0ed0e0423480d57faf88ed /native/jni
parentcca242d46d9679fe82e8457544ff2dda5c04121d (diff)
downloadclasspath-d13376fc5a0bb0a2ee0246e76ee3319e6baf9516.tar.gz
2009-10-22 Andrew Haley <aph@redhat.com>
* native/jni/native-lib/cpnet.c (cpnet_addMembership): Fix aliasing warning. (cpnet_dropMembership): Likewise. 2009-10-21 Richard Guenther <rguenther@suse.de> PR cp-tools/39177 * tools/gnu/classpath/tools/jar/Creator.java (writeCommandLineEntries): Do not use uninitialized manifest.
Diffstat (limited to 'native/jni')
-rw-r--r--native/jni/native-lib/cpnet.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/native/jni/native-lib/cpnet.c b/native/jni/native-lib/cpnet.c
index 044498113..154a7dd7d 100644
--- a/native/jni/native-lib/cpnet.c
+++ b/native/jni/native-lib/cpnet.c
@@ -578,9 +578,10 @@ jint cpnet_addMembership (JNIEnv *env UNUSED, jint fd, cpnet_address *addr)
{
struct ip_mreq req;
int ret;
+ struct sockaddr_in *sockaddr = (struct sockaddr_in *)addr->data;
memset(&req, 0, sizeof(req));
- req.imr_multiaddr = ((struct sockaddr_in *)addr->data)->sin_addr;
+ req.imr_multiaddr = sockaddr->sin_addr;
req.imr_interface.s_addr = INADDR_ANY;
ret = setsockopt(fd, IPPROTO_IP, IP_ADD_MEMBERSHIP, &req, sizeof(req));
if (ret != 0)
@@ -593,9 +594,10 @@ jint cpnet_dropMembership (JNIEnv *env UNUSED, jint fd, cpnet_address *addr)
{
struct ip_mreq req;
int ret;
+ struct sockaddr_in *sockaddr = (struct sockaddr_in *)addr->data;
memset(&req, 0, sizeof(req));
- req.imr_multiaddr = ((struct sockaddr_in *)addr->data)->sin_addr;
+ req.imr_multiaddr = sockaddr->sin_addr;
req.imr_interface.s_addr = INADDR_ANY;
ret = setsockopt(fd, IPPROTO_IP, IP_DROP_MEMBERSHIP, &req, sizeof(req));
if (ret != 0)