--- a/jdk/src/share/classes/java/net/NetworkInterface.java Tue Dec 01 08:55:15 2009 -0800
+++ b/jdk/src/share/classes/java/net/NetworkInterface.java Wed Dec 02 12:17:42 2009 +0000
@@ -290,8 +290,12 @@
* If the specified address is <tt>null</tt>.
*/
public static NetworkInterface getByInetAddress(InetAddress addr) throws SocketException {
- if (addr == null)
+ if (addr == null) {
throw new NullPointerException();
+ }
+ if (!(addr instanceof Inet4Address || addr instanceof Inet6Address)) {
+ throw new IllegalArgumentException ("invalid address type");
+ }
return getByInetAddress0(addr);
}