GNOME Bugzilla – Bug 138390
patch for IPv6 support
Last modified: 2011-07-10 02:44:26 UTC
A patch for IPv6 support in gnome-netstatus is available at: http://davyd.angrygoats.net/gnome-netstatus-ipv6.diff A screenshot is available from: http://davyd.angrygoats.net/images/gnome-netstatus-ipv6.png
Oooh, spicy. :) Adding the PATCH keyword and bumping priority to high.
Created attachment 27636 [details] [review] finalized patch This patch cleans up some mess from my copy of the tree, it also stops displaying the large number of assertion errors it was before. Is it ok to commit?
Created attachment 27754 [details] [review] now with ./configure support configure support might be important. Not everyone has IPv6.
Thanks for your patience :-) - The IPv6 support should always be compiled in available. Have a look at the check in gnome-session - it just tries to create an socket and doesn't build IPv6 support if it fails. I'd just copy that. - Please use GNU coding style everywhere. The existing coding style is very consistent - it should be easy to copy it. - I think we should be able to do this without /proc in using a similar method to get_inet4_details. Create an AF_INET6 socket, get the addr using SIOCGIFADDR and get the scope using the IN6_ADDR_IS_* macros in netinet/in.h. No idea whether that's more portable, but it certainly has a better chance of being portable. - If we have to use /proc, the code to parse it should be in netstatus-sysdeps.c and should be similar to the other /proc parsing code.
Using the ioctl() SIOCGIFADDR won't work in Linux at least. This is what I originally did (straight from Stevens), however there is a stub in the Linux kernel which quite clearly indicates this is not implemented. ifconfig parses /proc, so does iproute2. I'll try and get it rearranged and sorted out.
Ah, I see now you'd already tried SIOCGIFADDR. So, a bit more research leads me to the following conclusions: 1) SIOCGIFADDR can't be implemented for IPv6 since the ifreq structure is too small 2) On Linux and BSDs we should be using the getifaddrs() function rather than using the SIOCGIFCONF/SIOCGIFADDR etc. ioctl()s (even for IPv4) 3) On Solaris we should be using the SIOCGLIFCONF/SIOCGLIFADDR ioctl()s which are newly introduced ioctl()s which take a structure which is big enough to hold the IPv6 data. So, this is a pretty big re-organisation of the code. At some point I want to do it, but I'm happy to go with the /proc/net/if_inet6 parsing for now. Oh, and what ifconfig does is irrelevant - it makes no pretence of portability.
Created attachment 28995 [details] [review] somewhat cleaned up Ok, ./configure now autodetects IPv6, and the /proc parsing has been moved to the sysdeps file. Haven't really done anything to change the coding style, or parse proc in a similar way. Pointers always appriciated.
It looks like this patch never made it in. I'd be glad to forward-port and test it if no one else wants to.
Mark, please feel free to update this patch. Let us know if you have questions.
gnome-netstatus development has been stalled [1]. Maintainers don't have future development plan so i am closing the bugs as WONTFIX. [1] http://mail.gnome.org/archives/desktop-devel-list/2011-June/msg00073.html