Re: libgtop is being a wh0re :)



On Mon, 30 Nov 1998, GnEaThEg0d wrote:

> I also checked a few of the header files that netload.c uses and could
> not find anything pertinent except perhaps for glibtop.h, net/if.h and
> netinet/ip_fw.h.  the third header file looks like it could be the
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Absolutely correct - it's libc5 only including <linux/ip_fw.h> here
instead of defining

#define IP_FW_F_ACCTIN  0x1000  /* Account incoming packets only.     */
#define IP_FW_F_ACCTOUT 0x2000  /* Account outgoing packets only.     */

and some structures ...

> culperit(sp?) but I'm not entirely sure.. i'm thinking that, most
> likely, these need to be defined within netload.c ...
> 
> if it's of any use, here are some of my system stats:
> 
> Slackware 3.5 Linux
> kernel 2.1.130
> libc5 only (i haven't bothered with trying to install glibc2 yet)
> gcc version: egcs 1.0.3

Aha !

> if Martin or anyone has a patch or any kind of advice for this problem,
> it would be greatly appreciated. Thank you.

Yes, I have - kernel 2.1.130 with libc5 was the only possible situation
I did not test since I had no libc5 system with linux 2.1.xx.

Starting with linux 2.1.114 ([FIXME: when exactly ?]) /proc/net/dev
has not only packet but also byte counts. This means we don't need
IP accounting with recent kernels - just made this conditionally to
LINUX_VERSION_CODE < 131442 (2.1.114 - if someone wants to change this
please keep in mind that you need a version that has byte counts in
/proc/net/dev but no firewall chains ...).

Also used some conditionals to include the correct header files with a
braindead <netinet/ip_fw.h> on libc5 systems:

#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
/* GNU LibC */
#include <net/if.h>
#include <netinet/ip_fw.h>
#else /* Libc 5 */
#include <linux/if.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/icmp.h>
#include <linux/tcp.h>
#include <linux/udp.h>
#include <linux/ip_fw.h>
#endif

So this should now work in all possible situations or did I miss
something:

	linux 2.0.36 / glibc (RedHat 5.2)
	linux 2.1.130 / glibc (RedHat 5.2)
	linux 2.0.35 / libc (SuSE 5.3)
	linux 2.1.114 / libc5 (Debian 2.0)

Martin

-----------------------------------------------------------------
   Martin Baulig - Angewandte Mathematik - Universitaet Trier
   martin@home-of-linux.org, http://www.home-of-linux.org/
------------------------------------------------------------------



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]