Sunday, February 20, 2011

Troubles Pinging IPv6 with Android

As of Android 2.3, pinging IPv6 is not going to work. Well, at least not yet. Net Ping works by calling on the underlying 'ping' command in Android to do the heavy lifting.  Any non-rooted ping application on Android will have this problem.

In Android's ping source code (ping.c), there is a strict limitation to using IPv4 addresses. At this point, the address is limited to 4 bytes (IPv4).

ping.c, Line 1805: memcpy(&whereto.sin_addr, hp->h_addr, 4);

I can understand why they neglected to include IPv6. Check out line 2.

ping..c, Line 2: * Copyright (c) 1989 The Regents of the University of California.

This file doesn't seem to have been changed much since 1989.

This doesn't mean that pinging IPv6 is impossible, but it does present a significant challenge. One possibility is that I could contribute a ping.c update to include IPv6 to Android.

So Net Ping today will try IPv6 pinging. And with version 1.5, it will display a special error message when it detects that ping doesn't work with IPv6.  With luck, when the day comes that IPv6 starts working so will Net Ping.

Thanks again for using Net Ping!

No comments:

Post a Comment