summaryrefslogtreecommitdiffstats
path: root/net/dccp
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-10-30 02:20:59 +0200
committerArnaldo Carvalho de Melo <acme@mandriva.com>2005-11-01 01:30:02 +0100
commitedc9e81917157d1e73bf081d4fbcad7c34d32783 (patch)
tree28f15652b5965421bed9ff1a0cd676ac4cb14682 /net/dccp
parent[DCCP]: Simplify skb_set_owner_w semantics (diff)
downloadlinux-edc9e81917157d1e73bf081d4fbcad7c34d32783.tar.xz
linux-edc9e81917157d1e73bf081d4fbcad7c34d32783.zip
[DCCP]: Set socket owner iff packet is not data
Here is a complimentary insurance policy for those feeling a bit insecure. You don't have to accept this. However, if you do, you can't blame me for it :) > 1) dccp_transmit_skb sets the owner for all packets except data packets. We can actually verify this by looking at pkt_type. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/dccp')
-rw-r--r--net/dccp/output.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/net/dccp/output.c b/net/dccp/output.c
index c25b0423887a..74ff87025878 100644
--- a/net/dccp/output.c
+++ b/net/dccp/output.c
@@ -58,10 +58,21 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)
switch (dcb->dccpd_type) {
case DCCP_PKT_DATA:
set_ack = 0;
+ /* fall through */
+ case DCCP_PKT_DATAACK:
break;
+
case DCCP_PKT_SYNC:
case DCCP_PKT_SYNCACK:
ackno = dcb->dccpd_seq;
+ /* fall through */
+ default:
+ /*
+ * Only data packets should come through with skb->sk
+ * set.
+ */
+ WARN_ON(skb->sk);
+ skb_set_owner_w(skb, sk);
break;
}
@@ -71,12 +82,6 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)
skb->h.raw = skb_push(skb, dccp_header_size);
dh = dccp_hdr(skb);
- /*
- * Only data packets should come through with skb->sk set.
- */
- if (!skb->sk)
- skb_set_owner_w(skb, sk);
-
/* Build DCCP header and checksum it. */
memset(dh, 0, dccp_header_size);
dh->dccph_type = dcb->dccpd_type;