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 759064 - Rewrite of glibtop_get_netload_p()
Rewrite of glibtop_get_netload_p()
Product: libgtop
Classification: Core
Component: bsd
Other OpenBSD
: Normal enhancement
: ---
Assigned To: libgtop maintainers
libgtop maintainers
Depends on:
Reported: 2015-12-05 16:34 UTC by Martin Pieuchot
Modified: 2018-01-10 19:52 UTC
See Also:
GNOME target: ---
GNOME version: ---

Rewrite of glibtop_get_netload_p() (13.39 KB, patch)
2015-12-05 16:34 UTC, Martin Pieuchot
none Details | Review
Correct patch (12.30 KB, patch)
2015-12-05 16:36 UTC, Martin Pieuchot
none Details | Review

Description Martin Pieuchot 2015-12-05 16:34:01 UTC
Created attachment 316805 [details] [review]
Rewrite of glibtop_get_netload_p()

The attached patch is a rewrite of glibtop_get_netload_p() to use libc's getifaddrs(3) function rather than reading kernel's memory via the libkvm.

The latter is deprecated and should be avoided.  I'm trying to rid of the direct reads of the "struct ifnet" structure via this interface to facilitate kernel changes.

Could it be possible to integrate this diff?
Comment 1 Martin Pieuchot 2015-12-05 16:36:30 UTC
Created attachment 316807 [details] [review]
Correct patch
Comment 2 Antoine Jacoutot 2015-12-05 18:07:43 UTC
That patch will land in OpenBSD ports soon and considering that it's in the OpenBSD-specific part of the code, I think we should commit it.
Comment 3 Benoît Dejean 2015-12-05 18:59:14 UTC
Do you get any regression when running something like examples/netload.c ?
Comment 4 Martin Pieuchot 2015-12-05 19:31:26 UTC
Currently it prints wrong informations, 0 everywhere.  My diff fixes that and
I verified that the output of "netload" is coherent to "netstat -sI" for the
same interface.
Comment 5 Benoît Dejean 2015-12-06 13:39:07 UTC
Why would you strip the GPL header ?
Comment 6 Martin Pieuchot 2015-12-06 14:05:22 UTC
I'm not sure what you mean :)

I rewrote the function completely, trying to respect the coding style and since I don't think it makes sense to create a new file I just sent a diff with the
existing one.  So I'm not stripping anything, it's a diff.

Now if your question is why I did not put why work under GPLv2 it's just to allow
other people to re-use it under ISC.  But since this code is part of libgtop2
the GPLv2 applies to the library in the end.

Does that answer your question or did I get it wrong?
Comment 7 Jasper Lievisse Adriaanse 2016-04-18 17:06:03 UTC
Benoit, is there any news on this?
Comment 8 GNOME Infrastructure Team 2018-01-10 19:52:18 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: