Datagram socket and security manager

I have subclassed the security manager to implement my own network security rules.

However when the receive(datagramPacket) method is called by the my datagram socket, the host parameter passed to the checkAccept(host, port) method does not belong to the sender of the packet(to be received).

How then can malicious addresses be blocked by the security manager, as suggested by the comments in the source code of DatagramSocket.

Any help is greatly appreciated. Thank you in advance.

[508 byte] By [jinfunna] at [2007-11-26 16:38:58]
# 1

> However when the receive(datagramPacket) method is

> called by the my datagram socket, the host parameter

> passed to the checkAccept(host, port) method does

> not belong to the sender of the packet(to be

> received).

It should. What are you getting instead?

ejpa at 2007-7-8 23:05:49 > top of Java-index,Core,Core APIs...
# 2
I'm getting it address which my datagram socket is bounded to.
jinfunna at 2007-7-8 23:05:49 > top of Java-index,Core,Core APIs...
# 3
It's a bug in DatagramSocket. Report it. It creates a new DatagramPacket and then gets the IP address from that, without peeking at the actual incoming packet, unless you are in <= JDK 1.3. So you get your own IP address.Bizarre.
ejpa at 2007-7-8 23:05:49 > top of Java-index,Core,Core APIs...
# 4
that's what i thought. strange that nobody noticed it. thanks a lot for confirming it for me.
jinfunna at 2007-7-8 23:05:49 > top of Java-index,Core,Core APIs...
# 5
Sorry, I'm wrong about that, it's done in native code. Can't explain your problem at all.
ejpa at 2007-7-8 23:05:49 > top of Java-index,Core,Core APIs...
# 6
What version of the jdk are you using? I cannot reproduce this problem either. Do you have a simple testcase?
chegara at 2007-7-8 23:05:49 > top of Java-index,Core,Core APIs...