EINVAL when using libipt_limit on sparc64, revisited

Jed Davis jldavis+netfilterlist@cs.oberlin.edu
07 Jul 2001 14:59:34 -0400


As I asked about on the regular netfilter list, whenever I use "-m
limit" on my sparc64 box, no matter what else is or isn't in the rule,
I get this message (do_command() returning with errno=EINVAL):
iptables: Invalid argument

Since this didn't tell me which argument to what is invalid, I tried
using a gdb watchpoint to see where errno was being changed.  This did
not work.

Since Nobody Else Has This Problem, I was suspecting the interface
between the 32-bit userland and the 64-bit kernel.  Compiling the
iptables user code as 64-bit with gcc3 and the "--oformat elf64-sparc"
argument to ld gave me a bunch of linker warning about architectures
not quite matching, and the resulting binary segfaulted; gdb wouldn't
recognize the file as executable, so I gave that up.

I also noticed that the size and layout of struct ipt_rateinfo,
defined in /usr/include/linux/netfilter_ipv4/ipt_limit.h, change
depending on whether the compiler is 32/64-bit (one member is unsigned
long, another is a pointer where the alignment changes its offset).
So I fiddled the struct definition to make it word-size-independent,
but still got the unhelpful error message.

So I ask: is there any magic I can do with gdb, or anything else, to
find out where the error originates, or any other useful information?

Thanks,
--Jed

-- 
"But life wasn't yes-no, on-off.  Life was shades of gray, and rainbows
not in the order of the spectrum."   -- L. E. Modesitt, Jr., _Adiamante_

sub f{(($n,$d,@_)=@_)?(substr(" ExhortJavelinBus",$n&&$d/$n,1),$n?f($d%$n,$
n,@_):&f):("\n")}print f 1461,10324,55001,444162,1208,1341,5660480,79715997