diff options
author | glewis <glewis@FreeBSD.org> | 2011-07-08 15:28:46 +0800 |
---|---|---|
committer | glewis <glewis@FreeBSD.org> | 2011-07-08 15:28:46 +0800 |
commit | 1727a6553b7651cc7bc4dadeffeeac825a31459b (patch) | |
tree | 45ccf4418e6fa1708700b3b97336304b242bd23f /java | |
parent | 959f8ab4ee43be507e0c881925f786c96003cf6d (diff) | |
download | freebsd-ports-gnome-1727a6553b7651cc7bc4dadeffeeac825a31459b.tar.gz freebsd-ports-gnome-1727a6553b7651cc7bc4dadeffeeac825a31459b.tar.zst freebsd-ports-gnome-1727a6553b7651cc7bc4dadeffeeac825a31459b.zip |
. Try harder to make sure the flags returned from getFlags isn't negative,
since a number of places in the code check for that and assume that it
means an error occurred. On FreeBSD, in particular, the value of
ifr_flags can be negative if multicast is enabled on the socket since
the possible flags have expanded to fill more than a short.
Instead of blindly promoting ifr_flags to an int, which will preserve
the sign, we fill the int return value with ifr_flagshigh in the high
16 bits and ifr_flags in the low 16 bits.
PR: 155186
Reported by: Alex Hayward <xelah-freebsd-pr@xelah.com>
Diffstat (limited to 'java')
-rw-r--r-- | java/openjdk7/Makefile | 1 | ||||
-rw-r--r-- | java/openjdk7/files/patch-src-solaris-native-java-net-NetworkInterface.c | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/java/openjdk7/Makefile b/java/openjdk7/Makefile index 9b9b80e1d0f4..c9b77134b8dd 100644 --- a/java/openjdk7/Makefile +++ b/java/openjdk7/Makefile @@ -7,6 +7,7 @@ PORTNAME= openjdk PORTVERSION= ${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_BUILD_NUMBER} +PORTREVISION= 1 CATEGORIES= java devel MASTER_SITES= http://download.java.net/openjdk/jdk7/promoted/b${JDK_BUILD_NUMBER}/ \ http://download.java.net/jaxp/1.4.5/:jaxp \ diff --git a/java/openjdk7/files/patch-src-solaris-native-java-net-NetworkInterface.c b/java/openjdk7/files/patch-src-solaris-native-java-net-NetworkInterface.c new file mode 100644 index 000000000000..8a977e6d87d7 --- /dev/null +++ b/java/openjdk7/files/patch-src-solaris-native-java-net-NetworkInterface.c @@ -0,0 +1,17 @@ +$FreeBSD$ + +--- jdk/src/solaris/native/java/net/NetworkInterface.c Mon Jun 27 22:08:16 2011 -0700 ++++ jdk/src/solaris/native/java/net/NetworkInterface.c Thu Jul 07 23:37:05 2011 -0700 +@@ -1968,7 +1968,11 @@ + return -1; + } + +- return if2.ifr_flags; ++#ifdef __FreeBSD__ ++ return ((if2.ifr_flags & 0xffff) | (if2.ifr_flagshigh << 16)); ++#else ++ return (((int) if2.ifr_flags) & 0xffff); ++#endif + } + + #endif |