#68 Outputs help screen all the time (ppc)

open
nobody
userspace (8)
5
2009-03-24
2009-03-24
Anonymous
No

On a mini mac ppc:

> cat /proc/version
Linux version 2.6.26-1-powerpc (Debian 2.6.26-13lenny2) (dannf@debian.org) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 Fri Mar 13 23:21:57 UTC 2009

Building resulted in:

> echo $?
0

But when trying to execute it, it gives me the help output all the time.

Did exactly the same thing on a x86:

> cat /proc/version
Linux version 2.6.26-1-686 (Debian 2.6.26-13lenny2) (dannf@debian.org) (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Fri Mar 13 18:08:45 UTC 2009

and it worked.

Discussion

  • I forgot to mention that it was the 0.11 user-space version I was trying with.

     
  • gavinlee303
    gavinlee303
    2010-07-18

    Same here, running Gentoo Linux x86 works, on Gentoo Linux arm l7-filter will only display a help screen.
    Looking into the code i notice it is to do with the way l7-filter uses getopt. Patch I did works for me, please test.

    --- l7-filter-userspace-0.11/l7-filter.cpp.old 2010-07-12 10:43:58.485002456 +0100
    +++ l7-filter-userspace-0.11/l7-filter.cpp 2010-07-12 11:14:38.825001868 +0100
    @@ -186,15 +186,11 @@
    conffilename = "";
    const char *opts = "f:q:vh?sb:dn:p:m:cz";

    - int done = 0;
    - while(!done)
    + int c;
    + while ((c = getopt (argc, argv, opts)) != -1)
    {
    - char c;
    - switch(c = getopt(argc, argv, opts))
    + switch(c)
    {
    - case -1:
    - done = 1;
    - break;
    case 'f':
    conffilename = optarg;
    break;