Re: iptables 1.3.7 doesn't properly test for condition patch

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

 



cc nf-dev

On May 29 2007 06:34, Andrew Schulman wrote:
>
>For the archive, Massimilano Hofer sent me the attached patch, which solves
>the problem.  It seems that this patch should be merged into iptables.
>
>Andrew.
>
>diff -Nru iptables-1.3.5-20060922.orig/extensions/.condition-test iptables-1.3.5-20060922.new/extensions/.condition-test
>--- iptables-1.3.5-20060922.orig/extensions/.condition-test	2002-11-02 16:00:15.000000000 +0100
>+++ iptables-1.3.5-20060922.new/extensions/.condition-test	2006-09-26 12:56:01.000000000 +0200
>@@ -1,3 +1,5 @@
> #!/bin/sh
> # True if condition is applied.
>-[ -f $KERNEL_DIR/include/linux/netfilter_ipv4/ipt_condition.h ] && echo condition
>+( [ -f $KERNEL_DIR/include/linux/netfilter_ipv4/ipt_condition.h ] ||
>+  [ -f $KERNEL_DIR/include/linux/netfilter/xt_condition.h ] ) &&
>+ echo condition

While it is valid, why not use one '[ ]' test instead of two?

[ -f "$KERNEL_DIR/include/linux/netfilter_ipv4/ipt_condition.h" -o \
  -f "$KERNEL_DIR/include/linux/netfilter/xt_condition.h" ] && \
	echo condition;

Of course, the common prefix can be merged, i.e.:

S="$KERNEL_DIR/include/linux";
[ -f "$S/netfilter_ipv4/ipt_condition.h" -o "$S/netfilter/xt_condition.h" ] ...


	Jan
-- 


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux