Hi, 

The problem was that find_target() and find_match()
didn't honor LOAD_MUST_SUCCEED when NO_SHARED_LIBS is defined.

The patch below (committed to cvs) should fix it.

Marc


On Sat, Mar 23, 2002 at 04:34:45PM +0800, Primantara HT wrote:
> Dear.
> 
> I found a bug when using "iptables".
> It results in "segmentaion fault" with these occurences :
>       - Change the Makefile with
>                NO_SHARE_LIBS=1  being activated
>         (meaning that no shared libs are considered)
>       - Compile
>       - run with eg,
>               "iptables -A INPUT -s 10.1.1.1 -j testonly"
>         without running "iptables -N testonly" beforehand
>       - then segmentation fault happens.
> 
> So, I consider to add
> 
>       if(!fw) exit_error(.......);
> 
> in function append_entry in iptables.c, before running other
> statements in this function.
> 
> Thank you, and if this goes to the unrelated email address,
> please delete this email.
> 
> Best Regards,
> 
> Prim


Index: iptables.c
===================================================================
RCS file: /data/cvs/netfilter/userspace/iptables.c,v
retrieving revision 1.44
diff -u -r1.44 iptables.c
--- iptables.c  2002/03/14 11:35:58     1.44
+++ iptables.c  2002/03/24 15:04:35
@@ -681,6 +681,10 @@
                else
                        ptr = NULL;
        }
+       if(!ptr && (tryload == LOAD_MUST_SUCCEED)) {
+               exit_error(PARAMETER_PROBLEM,
+                          "Couldn't find match `%s'\n", name);
+       }
 #endif
 
        if (ptr)
@@ -951,6 +955,10 @@
                        ptr->loaded = 1;
                else
                        ptr = NULL;
+       }
+       if(!ptr && (tryload == LOAD_MUST_SUCCEED)) {
+               exit_error(PARAMETER_PROBLEM,
+                          "Couldn't find target `%s'\n", name);
        }
 #endif
 
Index: ip6tables.c
===================================================================
RCS file: /data/cvs/netfilter/userspace/ip6tables.c,v
retrieving revision 1.19
diff -u -r1.19 ip6tables.c
--- ip6tables.c 2002/03/14 11:35:58     1.19
+++ ip6tables.c 2002/03/24 15:04:36
@@ -740,6 +740,10 @@
                else
                        ptr = NULL;
        }
+       if(!ptr && (tryload == LOAD_MUST_SUCCEED)) {
+               exit_error(PARAMETER_PROBLEM,
+                          "Couldn't find match `%s'\n", name);
+       }
 #endif
 
        if (ptr)
@@ -951,6 +955,10 @@
                        ptr->loaded = 1;
                else
                        ptr = NULL;
+       }
+       if(!ptr && (tryload == LOAD_MUST_SUCCEED)) {
+               exit_error(PARAMETER_PROBLEM,
+                          "Couldn't find target `%s'\n", name);
        }
 #endif
 

Reply via email to