Add IPv4-compatible IPv6 addresses support

Is it possible to add IPv4-compatible IPv6 address support.
Right now async-dns fails on such (::ffff:192.0.2.128) IPs:

ERROR akka.actor.OneForOneStrategy - java.net.Inet4Address cannot be cast to java.net.Inet6Address
java.lang.ClassCastException: java.net.Inet4Address cannot be cast to java.net.Inet6Address
	at akka.io.dns.AAAARecord$.parseBody(DnsResourceRecords.scala:62)
	at akka.io.dns.ResourceRecord$.parse(DnsResourceRecords.scala:161)
	at akka.io.dns.internal.Message$.$anonfun$parse$4(DnsMessage.scala:150)
	at scala.util.Try$.apply(Try.scala:213)
	at akka.io.dns.internal.Message$.$anonfun$parse$3(DnsMessage.scala:150)
	at akka.io.dns.internal.Message$.$anonfun$parse$3$adapted(DnsMessage.scala:149)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:238)
	at scala.collection.immutable.Range.foreach(Range.scala:158)
	at scala.collection.TraversableLike.map(TraversableLike.scala:238)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:231)
	at scala.collection.AbstractTraversable.map(Traversable.scala:108)
	at akka.io.dns.internal.Message$.parse(DnsMessage.scala:149)
	at akka.io.dns.internal.DnsClient$$anonfun$ready$1.applyOrElse(DnsClient.scala:121)
	at akka.actor.Actor.aroundReceive(Actor.scala:537)
	at akka.actor.Actor.aroundReceive$(Actor.scala:535)
	at akka.io.dns.internal.DnsClient.aroundReceive(DnsClient.scala:40)
	at akka.actor.ActorCell.receiveMessage(ActorCell.scala:577)
	at akka.actor.ActorCell.invoke(ActorCell.scala:547)
	at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:270)
	at akka.dispatch.Mailbox.run(Mailbox.scala:231)
	at akka.dispatch.Mailbox.exec(Mailbox.scala:243)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

Hi @devrivne, for such a request, I think it’s best you created an issue in the GitHub repository.

Cheers,

1 Like

Sure.
Thanks for reply.