[PATCH]: Fix invalid return values from sctp_new

Kiran Kumar Immidi immidi at spymac.com
Mon Sep 20 10:39:16 CEST 2004


On Monday 20 September 2004 13:58, Patrick McHardy wrote:

> there are multiple places in sctp_new where it returns -1, but
> it looks like it really wants to return "invalid". The call to
> protocol->new in init_conntrack looks like this:
>
>         if (!protocol->new(conntrack, skb)) {
>                 kmem_cache_free(ip_conntrack_cachep, conntrack);
>                 return NULL;
>         }
>
> so it has to return 0 to say "invalid". Please check if the
> attached patch which fixes these places is correct.

  This seems fair. But the place I copied this from 
[ ip_conntrack_proto_tcp.c:tcp_new() ]  also needs to be fixed I guess..

@@ -237,7 +237,7 @@
        struct tcphdr tcph;

        if (skb_copy_bits(skb, skb->nh.iph->ihl * 4, &tcph, sizeof(tcph)) != 
0)
-               return -1;
+               return 0;


-- 
Regards,
Kiran Kumar Immidi



More information about the netfilter-devel mailing list