aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-10-29 20:20:59 -0400
committerArnaldo Carvalho de Melo <acme@mandriva.com>2005-10-31 19:30:02 -0500
commitedc9e81917157d1e73bf081d4fbcad7c34d32783 (patch)
tree28f15652b5965421bed9ff1a0cd676ac4cb14682 /net
parent48918a4dbd6c599d6af30bd64cb355fadca708eb (diff)
[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')
-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)
58 switch (dcb->dccpd_type) { 58 switch (dcb->dccpd_type) {
59 case DCCP_PKT_DATA: 59 case DCCP_PKT_DATA:
60 set_ack = 0; 60 set_ack = 0;
61 /* fall through */
62 case DCCP_PKT_DATAACK:
61 break; 63 break;
64
62 case DCCP_PKT_SYNC: 65 case DCCP_PKT_SYNC:
63 case DCCP_PKT_SYNCACK: 66 case DCCP_PKT_SYNCACK:
64 ackno = dcb->dccpd_seq; 67 ackno = dcb->dccpd_seq;
68 /* fall through */
69 default:
70 /*
71 * Only data packets should come through with skb->sk
72 * set.
73 */
74 WARN_ON(skb->sk);
75 skb_set_owner_w(skb, sk);
65 break; 76 break;
66 } 77 }
67 78
@@ -71,12 +82,6 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)
71 skb->h.raw = skb_push(skb, dccp_header_size); 82 skb->h.raw = skb_push(skb, dccp_header_size);
72 dh = dccp_hdr(skb); 83 dh = dccp_hdr(skb);
73 84
74 /*
75 * Only data packets should come through with skb->sk set.
76 */
77 if (!skb->sk)
78 skb_set_owner_w(skb, sk);
79
80 /* Build DCCP header and checksum it. */ 85 /* Build DCCP header and checksum it. */
81 memset(dh, 0, dccp_header_size); 86 memset(dh, 0, dccp_header_size);
82 dh->dccph_type = dcb->dccpd_type; 87 dh->dccph_type = dcb->dccpd_type;