mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-20 04:02:27 +00:00
. 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>
This commit is contained in:
parent
d1193f6361
commit
f326f69e57
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=277348
@ -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 \
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user