After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 453070 - [PATCH] gnome-netstatus does not correctly list interfaces
[PATCH] gnome-netstatus does not correctly list interfaces
Status: RESOLVED WONTFIX
Product: gnome-netstatus
Classification: Deprecated
Component: general
2.12.x
Other FreeBSD
: Normal normal
: ---
Assigned To: Mark McLoughlin
Mark McLoughlin
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2007-07-02 11:26 UTC by Roy Marples
Modified: 2011-07-10 02:44 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Don't rely on structure lengh (718 bytes, patch)
2007-07-02 11:27 UTC, Roy Marples
none Details | Review
Iterate the ifreq structures correctly. (959 bytes, patch)
2007-07-16 11:54 UTC, Roy Marples
needs-work Details | Review
Iterate ifreqs more correctly (938 bytes, patch)
2008-02-22 09:52 UTC, Roy Marples
needs-work Details | Review
Iterate ifreqs more correctly (1005 bytes, patch)
2008-07-30 09:02 UTC, Roy Marples
none Details | Review

Description Roy Marples 2007-07-02 11:26:00 UTC
Please describe the problem:
gnome-netstatus doesn't correctly list the interfaces on FreeBSD.
This is because the ifreq structure length is not constant.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Roy Marples 2007-07-02 11:27:38 UTC
Created attachment 91025 [details] [review]
Don't rely on structure lengh
Comment 2 Roy Marples 2007-07-06 07:25:31 UTC
Sorry for the noise - we had a patch that reverted this for amd64 :/
Comment 3 Roy Marples 2007-07-16 11:54:03 UTC
Created attachment 91850 [details] [review]
Iterate the ifreq structures correctly.

OK, the issue is that on Linux/AMD64 the length of the name + sockaddr struct is an incorrect calcuation. Instead the size of the ifreq struct should be used as this is static for Linux.

This patch lists the addresses correctly on Linux (amd64, x86) and FreeBSD (x86)
Comment 4 Joachim Frieben 2007-12-08 17:15:51 UTC
I have the problem that on an x86_64 system, the connection selector only displays lo, a blank, and an unprintable character. However, there are working connections eth0, eth1, and ath0 whose status cannot be monitored by means of the netstatus applet though. I wonder if this issue reported elsewhere, namely at https://bugzilla.redhat.com/show_bug.cgi?id=318411 is identical with the issue reported above. If not, I will open a new bug report.
The netstatus applet is still of interest for users who cannot use NM because of its ability to deal with multiple active interfaces. For this reason it is disabled by default on Fedora which I am using myself.
Comment 5 Joachim Frieben 2007-12-08 17:17:51 UTC
Of course, I meant to say ".. inability to deal with multiple active interfaces .."
Comment 6 Joachim Frieben 2008-02-17 07:30:06 UTC
The patch from comment #3 restores correct operation of the gnome-netstatus applet on my x86_64 box. Time for a new upstream release?
Comment 7 Christopher Aillon 2008-02-22 05:50:13 UTC
Comment on attachment 91850 [details] [review]
Iterate the ifreq structures correctly.

This patch is not quite right and should not be accepted as-is.  Notably, the fact that this is all contained inside a check for defined(HAVE_SOCKADDR_SA_LEN) is just plain wrong since you are now using a different struct and member.  As this was the only usage in the source tree, not only should the source be updated, but configure.in also needs an update.

Is there a need for a check still?  Are there implementations of ifreq that do not have ifr_name?
Comment 8 Roy Marples 2008-02-22 09:52:14 UTC
Created attachment 105751 [details] [review]
Iterate ifreqs more correctly

OK, this patch uses the ifreq struct directly and also works on newer NetBSD's where the ifreq structure could have structs bigger than sockaddr. As it now uses the ifreq structure only (and sa_len where it exists) it should be fine.
Comment 9 Christopher Aillon 2008-04-26 17:39:10 UTC
Comment on attachment 105751 [details] [review]
Iterate ifreqs more correctly

You missed the part I said about configure.  The code is currently contained inside an #ifdef which is effectively:

#if sockaddr does not have sa_len member
...
#else
...
#endif

But nowhere are you ever using sockaddr.sa_len anymore.  Since this was the only place HAVE_SOCKADDR_SA_LEN is used, this check and this macro ought to be removed entirely from the source (which is here and in configure.in).

However, since there appears to be differing implementations of ifreq are different on different platforms? then a NEW check in configure.in must be added.  You could probably just modify the existing configure.in check.
Comment 10 Christopher Aillon 2008-04-26 17:39:54 UTC
Dan, any input here?
Comment 11 Roy Marples 2008-04-26 19:58:31 UTC
From the patch

+        ifr->ifr_addr.sa_len);

That sure looks like sa_len to me!
Comment 12 Christopher Aillon 2008-04-26 21:06:22 UTC
Ugh, right.  Sorry, I was looking at saddr->sa_len going away and yes of course, ifr_addr is a sockaddr.  :-)
Comment 13 Roy Marples 2008-07-30 09:02:13 UTC
Created attachment 115547 [details] [review]
Iterate ifreqs more correctly

This new patch makes it work on NetBSD -current (4.99.70) (i386, amd64), FreeBSD 6.x,7.x (i386) and Gentoo Linux(i386, amd64)

Please consider applying - this bug is getting old!
Comment 14 Joachim Frieben 2009-06-12 05:04:49 UTC
Version 2.26.0 still doesn't fix this issue. Could somebody be so kind to apply the patch from comment #13? Thanks!
Comment 15 Akhil Laddha 2011-07-10 02:44:12 UTC
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