On Sat, Mar 16, 2002 at 10:29:11AM +0100, Bart De Schuymer wrote:
> Even worse is when one wants to use pointers in the communication structs.
> Lucky me wants to do this. Iptables is unlucky too, struct ipt_replace has a
> "struct ipt_counters *counters" member.

yes, there's a section in libiptc.c which is supposed to deal with this.

It does exactly the convert-to-u64-and-write-back approach you are 
mentioning.

However, it doesn't really work well - the counters show some insane values,
as soon as you start inserting rules into a chain:

yavin:~# iptables -L -v -n -x
Chain INPUT (policy ACCEPT 20213 packets, 2889457 bytes)
    pkts      bytes target     prot opt in     out     source               
destination         

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
    pkts      bytes target     prot opt in     out     source               
destination         

Chain OUTPUT (policy ACCEPT 15066 packets, 1683655 bytes)
    pkts      bytes target     prot opt in     out     source               
destination         
yavin:~# iptables -A INPUT -j ACCEPT
yavin:~# iptables -L -v -n -x
Chain INPUT (policy ACCEPT 8077090347409708768 packets, 0 bytes)
    pkts      bytes target     prot opt in     out     source               
destination         
       7      508 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0    
      

Chain FORWARD (policy ACCEPT 786253893258008 packets, 5716568006022397952 bytes)
    pkts      bytes target     prot opt in     out     source               
destination         

Chain OUTPUT (policy ACCEPT 5 packets, 548 bytes)
    pkts      bytes target     prot opt in     out     source               
destination         
yavin:~# 

> So, as iptables does not do any of these things and I heard it works on the
> Sparc64 (only rumours) I am very interested in knowing how this is done.
> I am probably going to remove support for these special architectures with
> different sizes for userspace and kernel (there are others, like ppc64,
> mips64 and hppa64) if it has to be done the ugly way. It is just, well, too
> ugly...

ppc64 does have a 64 bit userspace, IIRC. So as long as you compile your
program as a 64bit executable, it should work right ahead.

> cheers,
> Bart

-- 
Live long and prosper
- Harald Welte / [EMAIL PROTECTED]               http://www.gnumonks.org/
============================================================================
GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M+ 
V-- PS++ PE-- Y++ PGP++ t+ 5-- !X !R tv-- b+++ !DI !D G+ e* h--- r++ y+(*)

Reply via email to