[DCCP]: Fix skb leak in dccp_sendmsg
authorArnaldo Carvalho de Melo <acme@mandriva.com>
Wed, 24 Aug 2005 04:50:21 +0000 (21:50 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 29 Aug 2005 23:04:38 +0000 (16:04 -0700)
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dccp/proto.c

index a3f8a8095f81fd835c73a30c290d4f5440c9c0cf..2b6db18e607faf05096de9e1bbd3fbe5a3632e7e 100644 (file)
@@ -206,6 +206,18 @@ int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
                goto out_discard;
 
        rc = dccp_write_xmit(sk, skb, len);
+       /*
+        * XXX we don't use sk_write_queue, so just discard the packet.
+        *     Current plan however is to _use_ sk_write_queue with
+        *     an algorith similar to tcp_sendmsg, where the main difference
+        *     is that in DCCP we have to respect packet boundaries, so
+        *     no coalescing of skbs.
+        *
+        *     This bug was _quickly_ found & fixed by just looking at an OSTRA
+        *     generated callgraph 8) -acme
+        */
+       if (rc != 0)
+               goto out_discard;
 out_release:
        release_sock(sk);
        return rc ? : len;