Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjfrijters <jfrijters>2012-08-31 15:24:27 +0400
committerjfrijters <jfrijters>2012-08-31 15:24:27 +0400
commitc9df2ba9376d106dec9ac819f93dafffc7adb785 (patch)
tree6133accd4863f0f2c71aa29a12796db7f6e3a2a1 /openjdk/sun
parent168129b3d0a729b65f9e2bbb3b2a867984b20ba2 (diff)
Merged OpenJDK 7u6.
Diffstat (limited to 'openjdk/sun')
-rw-r--r--openjdk/sun/nio/ch/DatagramChannelImpl.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/openjdk/sun/nio/ch/DatagramChannelImpl.java b/openjdk/sun/nio/ch/DatagramChannelImpl.java
index a987bbc4..b2631530 100644
--- a/openjdk/sun/nio/ch/DatagramChannelImpl.java
+++ b/openjdk/sun/nio/ch/DatagramChannelImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -657,7 +657,12 @@ class DatagramChannelImpl
throw new AlreadyBoundException();
InetSocketAddress isa;
if (local == null) {
- isa = new InetSocketAddress(0);
+ // only Inet4Address allowed with IPv4 socket
+ if (family == StandardProtocolFamily.INET) {
+ isa = new InetSocketAddress(InetAddress.getByName("0.0.0.0"), 0);
+ } else {
+ isa = new InetSocketAddress(0);
+ }
} else {
isa = Net.checkAddress(local);
@@ -966,7 +971,8 @@ class DatagramChannelImpl
protected void implCloseSelectableChannel() throws IOException {
synchronized (stateLock) {
- nd.preClose(fd);
+ if (state != ST_KILLED)
+ nd.preClose(fd);
ResourceManager.afterUdpClose();
// if member of mulitcast group then invalidate all keys