< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [repro-users] 400 Malformed Contact


I found this code in DelegatingDatagramSocket.java which I thought might be the cause, but commenting it out did not solve the problem:

try{
super.send(p);
}
// DIRTY, DIRTY, DIRTY!!!
// Here we correct a java under MAC OSX bug when dealing with
// ipv6 local interface: the destination address (as well as the
// source address) under java / MAC OSX must have a scope ID,
// i.e. "fe80::1%en1". This correction (the whole "catch") is to
// be removed as soon as java under MAC OSX implements a real ipv6
// network stack.
catch(Exception ex)
{
InetAddress tmpAddr = p.getAddress();
if(((ex instanceof NoRouteToHostException)
|| (ex.getMessage() != null
&& ex.getMessage().equals("No route to host")))
&& (tmpAddr instanceof Inet6Address)
&& (tmpAddr.isLinkLocalAddress()))
{
Inet6Address newAddr = Inet6Address.getByAddress(
"",
tmpAddr.getAddress(),
((Inet6Address) super.getLocalAddress())
.getScopeId());
p.setAddress(newAddr);

super.send(p);

}
}