13 May, 2010

1 commit

  • This patch removes from net/ netfilter files
    all the unnecessary return; statements that precede the
    last closing brace of void functions.

    It does not remove the returns that are immediately
    preceded by a label as gcc doesn't like that.

    Done via:
    $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
    xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'

    Signed-off-by: Joe Perches
    [Patrick: changed to keep return statements in otherwise empty function bodies]
    Signed-off-by: Patrick McHardy

    Joe Perches
     

12 May, 2010

2 commits


25 Mar, 2010

4 commits

  • When extended status codes are available, such as ENOMEM on failed
    allocations, or subsequent functions (e.g. nf_ct_get_l3proto), passing
    them up to userspace seems like a good idea compared to just always
    EINVAL.

    Signed-off-by: Jan Engelhardt

    Jan Engelhardt
     
  • The following semantic patch does part of the transformation:
    //
    @ rule1 @
    struct xt_match ops;
    identifier check;
    @@
    ops.checkentry = check;

    @@
    identifier rule1.check;
    @@
    check(...) { }

    @@
    identifier rule1.check;
    @@
    check(...) { }
    //

    Signed-off-by: Jan Engelhardt

    Jan Engelhardt
     
  • Restore function signatures from bool to int so that we can report
    memory allocation failures or similar using -ENOMEM rather than
    always having to pass -EINVAL back.

    This semantic patch may not be too precise (checking for functions
    that use xt_mtchk_param rather than functions referenced by
    xt_match.checkentry), but reviewed, it produced the intended result.

    //
    @@
    type bool;
    identifier check, par;
    @@
    -bool check
    +int check
    (struct xt_mtchk_param *par) { ... }
    //

    Signed-off-by: Jan Engelhardt

    Jan Engelhardt
     
  • Supplement to 1159683ef48469de71dc26f0ee1a9c30d131cf89.

    Downgrade the log level to INFO for most checkentry messages as they
    are, IMO, just an extra information to the -EINVAL code that is
    returned as part of a parameter "constraint violation". Leave errors
    to real errors, such as being unable to create a LED trigger.

    Signed-off-by: Jan Engelhardt

    Jan Engelhardt
     

17 Mar, 2010

1 commit


13 Jan, 2009

1 commit


08 Oct, 2008

4 commits


23 Sep, 2008

1 commit

  • The function localtime_3 in xt_time.c gives a wrong monthday in a leap
    year after 28th 2. calculating monthday should use the array
    days_since_leapyear[] not days_since_year[] in a leap year.

    Signed-off-by: Kaihui Luo
    Acked-by: Jan Engelhardt
    Signed-off-by: Andrew Morton
    Signed-off-by: David S. Miller

    Kaihui Luo
     

22 Jul, 2008

1 commit


14 Apr, 2008

1 commit


11 Mar, 2008

1 commit

  • From: Andrew Schulman

    xt_time_match() in net/netfilter/xt_time.c in kernel 2.6.24 never
    matches on Sundays. On my host I have a rule like

    iptables -A OUTPUT -m time --weekdays Sun -j REJECT

    and it never matches. The problem is in localtime_2(), which uses

    r->weekday = (4 + r->dse) % 7;

    to map the epoch day onto a weekday in {0,...,6}. In particular this
    gives 0 for Sundays. But 0 has to be wrong; a weekday of 0 can never
    match. xt_time_match() has

    if (!(info->weekdays_match & (1 << current_time.weekday)))
    return false;

    and when current_time.weekday = 0, the result of the & is always
    zero, even when info->weekdays_match = XT_TIME_ALL_WEEKDAYS = 0xFE.

    Signed-off-by: Jan Engelhardt
    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Jan Engelhardt
     

29 Jan, 2008

2 commits


13 Nov, 2007

1 commit


07 Nov, 2007

1 commit


11 Oct, 2007

1 commit

  • This is ipt_time from POM-ng enhanced by the following:

    * xtables/ipv6 support
    * second granularity for daytime
    * day-of-month support (for example "match on the 15th of each month")
    * match against UTC or local timezone

    Signed-off-by: Jan Engelhardt
    Signed-off-by: Patrick McHardy
    Signed-off-by: David S. Miller

    Jan Engelhardt