Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 1 | /* |
| 2 | * net/dccp/input.c |
Arnaldo Carvalho de Melo | 8109b02 | 2006-12-10 16:01:18 -0200 | [diff] [blame] | 3 | * |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 4 | * An implementation of the DCCP protocol |
| 5 | * Arnaldo Carvalho de Melo <acme@conectiva.com.br> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License |
| 9 | * as published by the Free Software Foundation; either version |
| 10 | * 2 of the License, or (at your option) any later version. |
| 11 | */ |
| 12 | |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 13 | #include <linux/dccp.h> |
| 14 | #include <linux/skbuff.h> |
| 15 | |
| 16 | #include <net/sock.h> |
| 17 | |
Arnaldo Carvalho de Melo | ae31c33 | 2005-09-18 00:17:51 -0700 | [diff] [blame] | 18 | #include "ackvec.h" |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 19 | #include "ccid.h" |
| 20 | #include "dccp.h" |
| 21 | |
| 22 | static void dccp_fin(struct sock *sk, struct sk_buff *skb) |
| 23 | { |
| 24 | sk->sk_shutdown |= RCV_SHUTDOWN; |
| 25 | sock_set_flag(sk, SOCK_DONE); |
| 26 | __skb_pull(skb, dccp_hdr(skb)->dccph_doff * 4); |
| 27 | __skb_queue_tail(&sk->sk_receive_queue, skb); |
| 28 | skb_set_owner_r(skb, sk); |
| 29 | sk->sk_data_ready(sk, 0); |
| 30 | } |
| 31 | |
| 32 | static void dccp_rcv_close(struct sock *sk, struct sk_buff *skb) |
| 33 | { |
Arnaldo Carvalho de Melo | 017487d | 2006-03-20 19:25:24 -0800 | [diff] [blame] | 34 | dccp_send_reset(sk, DCCP_RESET_CODE_CLOSED); |
Arnaldo Carvalho de Melo | 7ad07e7 | 2005-08-23 21:50:06 -0700 | [diff] [blame] | 35 | dccp_fin(sk, skb); |
| 36 | dccp_set_state(sk, DCCP_CLOSED); |
Arnaldo Carvalho de Melo | 331968b | 2005-08-23 21:54:23 -0700 | [diff] [blame] | 37 | sk_wake_async(sk, 1, POLL_HUP); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 38 | } |
| 39 | |
| 40 | static void dccp_rcv_closereq(struct sock *sk, struct sk_buff *skb) |
| 41 | { |
| 42 | /* |
| 43 | * Step 7: Check for unexpected packet types |
| 44 | * If (S.is_server and P.type == CloseReq) |
| 45 | * Send Sync packet acknowledging P.seqno |
| 46 | * Drop packet and return |
| 47 | */ |
| 48 | if (dccp_sk(sk)->dccps_role != DCCP_ROLE_CLIENT) { |
Arnaldo Carvalho de Melo | e92ae93 | 2005-08-17 03:10:59 -0300 | [diff] [blame] | 49 | dccp_send_sync(sk, DCCP_SKB_CB(skb)->dccpd_seq, DCCP_PKT_SYNC); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 50 | return; |
| 51 | } |
| 52 | |
Arnaldo Carvalho de Melo | 811265b | 2005-09-13 19:03:15 -0300 | [diff] [blame] | 53 | if (sk->sk_state != DCCP_CLOSING) |
| 54 | dccp_set_state(sk, DCCP_CLOSING); |
Arnaldo Carvalho de Melo | 7ad07e7 | 2005-08-23 21:50:06 -0700 | [diff] [blame] | 55 | dccp_send_close(sk, 0); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 56 | } |
| 57 | |
Arnaldo Carvalho de Melo | c25a18b | 2006-03-20 21:58:56 -0800 | [diff] [blame] | 58 | static void dccp_event_ack_recv(struct sock *sk, struct sk_buff *skb) |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 59 | { |
| 60 | struct dccp_sock *dp = dccp_sk(sk); |
| 61 | |
Arnaldo Carvalho de Melo | a4bf390 | 2006-03-20 22:50:58 -0800 | [diff] [blame] | 62 | if (dccp_msk(sk)->dccpms_send_ack_vector) |
Arnaldo Carvalho de Melo | ae31c33 | 2005-09-18 00:17:51 -0700 | [diff] [blame] | 63 | dccp_ackvec_check_rcv_ackno(dp->dccps_hc_rx_ackvec, sk, |
| 64 | DCCP_SKB_CB(skb)->dccpd_ack_seq); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | static int dccp_check_seqno(struct sock *sk, struct sk_buff *skb) |
| 68 | { |
| 69 | const struct dccp_hdr *dh = dccp_hdr(skb); |
| 70 | struct dccp_sock *dp = dccp_sk(sk); |
Gerrit Renker | cbe1f5f | 2007-09-25 22:41:19 -0700 | [diff] [blame] | 71 | u64 lswl, lawl, seqno = DCCP_SKB_CB(skb)->dccpd_seq, |
| 72 | ackno = DCCP_SKB_CB(skb)->dccpd_ack_seq; |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 73 | |
| 74 | /* |
| 75 | * Step 5: Prepare sequence numbers for Sync |
| 76 | * If P.type == Sync or P.type == SyncAck, |
| 77 | * If S.AWL <= P.ackno <= S.AWH and P.seqno >= S.SWL, |
| 78 | * / * P is valid, so update sequence number variables |
| 79 | * accordingly. After this update, P will pass the tests |
| 80 | * in Step 6. A SyncAck is generated if necessary in |
| 81 | * Step 15 * / |
| 82 | * Update S.GSR, S.SWL, S.SWH |
| 83 | * Otherwise, |
| 84 | * Drop packet and return |
| 85 | */ |
Arnaldo Carvalho de Melo | 8109b02 | 2006-12-10 16:01:18 -0200 | [diff] [blame] | 86 | if (dh->dccph_type == DCCP_PKT_SYNC || |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 87 | dh->dccph_type == DCCP_PKT_SYNCACK) { |
Gerrit Renker | cbe1f5f | 2007-09-25 22:41:19 -0700 | [diff] [blame] | 88 | if (between48(ackno, dp->dccps_awl, dp->dccps_awh) && |
| 89 | dccp_delta_seqno(dp->dccps_swl, seqno) >= 0) |
| 90 | dccp_update_gsr(sk, seqno); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 91 | else |
| 92 | return -1; |
Arnaldo Carvalho de Melo | e92ae93 | 2005-08-17 03:10:59 -0300 | [diff] [blame] | 93 | } |
YOSHIFUJI Hideaki | c9eaf17 | 2007-02-09 23:24:38 +0900 | [diff] [blame] | 94 | |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 95 | /* |
| 96 | * Step 6: Check sequence numbers |
| 97 | * Let LSWL = S.SWL and LAWL = S.AWL |
| 98 | * If P.type == CloseReq or P.type == Close or P.type == Reset, |
| 99 | * LSWL := S.GSR + 1, LAWL := S.GAR |
| 100 | * If LSWL <= P.seqno <= S.SWH |
| 101 | * and (P.ackno does not exist or LAWL <= P.ackno <= S.AWH), |
| 102 | * Update S.GSR, S.SWL, S.SWH |
| 103 | * If P.type != Sync, |
| 104 | * Update S.GAR |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 105 | */ |
Arnaldo Carvalho de Melo | e92ae93 | 2005-08-17 03:10:59 -0300 | [diff] [blame] | 106 | lswl = dp->dccps_swl; |
| 107 | lawl = dp->dccps_awl; |
| 108 | |
| 109 | if (dh->dccph_type == DCCP_PKT_CLOSEREQ || |
Arnaldo Carvalho de Melo | c59eab4 | 2005-08-18 21:12:02 -0300 | [diff] [blame] | 110 | dh->dccph_type == DCCP_PKT_CLOSE || |
| 111 | dh->dccph_type == DCCP_PKT_RESET) { |
Gerrit Renker | cbe1f5f | 2007-09-25 22:41:19 -0700 | [diff] [blame] | 112 | lswl = ADD48(dp->dccps_gsr, 1); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 113 | lawl = dp->dccps_gar; |
| 114 | } |
| 115 | |
Gerrit Renker | cbe1f5f | 2007-09-25 22:41:19 -0700 | [diff] [blame] | 116 | if (between48(seqno, lswl, dp->dccps_swh) && |
| 117 | (ackno == DCCP_PKT_WITHOUT_ACK_SEQ || |
| 118 | between48(ackno, lawl, dp->dccps_awh))) { |
| 119 | dccp_update_gsr(sk, seqno); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 120 | |
| 121 | if (dh->dccph_type != DCCP_PKT_SYNC && |
Gerrit Renker | cbe1f5f | 2007-09-25 22:41:19 -0700 | [diff] [blame] | 122 | (ackno != DCCP_PKT_WITHOUT_ACK_SEQ)) |
| 123 | dp->dccps_gar = ackno; |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 124 | } else { |
Gerrit Renker | 59348b1 | 2006-11-20 18:39:23 -0200 | [diff] [blame] | 125 | DCCP_WARN("DCCP: Step 6 failed for %s packet, " |
| 126 | "(LSWL(%llu) <= P.seqno(%llu) <= S.SWH(%llu)) and " |
| 127 | "(P.ackno %s or LAWL(%llu) <= P.ackno(%llu) <= S.AWH(%llu), " |
| 128 | "sending SYNC...\n", dccp_packet_name(dh->dccph_type), |
Gerrit Renker | cbe1f5f | 2007-09-25 22:41:19 -0700 | [diff] [blame] | 129 | (unsigned long long) lswl, (unsigned long long) seqno, |
Gerrit Renker | 59348b1 | 2006-11-20 18:39:23 -0200 | [diff] [blame] | 130 | (unsigned long long) dp->dccps_swh, |
Gerrit Renker | cbe1f5f | 2007-09-25 22:41:19 -0700 | [diff] [blame] | 131 | (ackno == DCCP_PKT_WITHOUT_ACK_SEQ) ? "doesn't exist" |
| 132 | : "exists", |
| 133 | (unsigned long long) lawl, (unsigned long long) ackno, |
Gerrit Renker | 59348b1 | 2006-11-20 18:39:23 -0200 | [diff] [blame] | 134 | (unsigned long long) dp->dccps_awh); |
Gerrit Renker | e155d76 | 2007-09-25 22:41:56 -0700 | [diff] [blame] | 135 | /* |
| 136 | * Step 6: Check sequence numbers |
| 137 | * Otherwise, |
| 138 | * If P.type == Reset, |
| 139 | * Send Sync packet acknowledging S.GSR |
| 140 | * Otherwise, |
| 141 | * Send Sync packet acknowledging P.seqno |
| 142 | * Drop packet and return |
| 143 | */ |
| 144 | if (dh->dccph_type == DCCP_PKT_RESET) |
| 145 | seqno = dp->dccps_gsr; |
Gerrit Renker | cbe1f5f | 2007-09-25 22:41:19 -0700 | [diff] [blame] | 146 | dccp_send_sync(sk, seqno, DCCP_PKT_SYNC); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 147 | return -1; |
| 148 | } |
| 149 | |
| 150 | return 0; |
| 151 | } |
| 152 | |
Arnaldo Carvalho de Melo | c25a18b | 2006-03-20 21:58:56 -0800 | [diff] [blame] | 153 | static int __dccp_rcv_established(struct sock *sk, struct sk_buff *skb, |
| 154 | const struct dccp_hdr *dh, const unsigned len) |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 155 | { |
| 156 | struct dccp_sock *dp = dccp_sk(sk); |
| 157 | |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 158 | switch (dccp_hdr(skb)->dccph_type) { |
| 159 | case DCCP_PKT_DATAACK: |
| 160 | case DCCP_PKT_DATA: |
| 161 | /* |
Arnaldo Carvalho de Melo | 7690af3 | 2005-08-13 20:34:54 -0300 | [diff] [blame] | 162 | * FIXME: check if sk_receive_queue is full, schedule DATA_DROPPED |
| 163 | * option if it is. |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 164 | */ |
| 165 | __skb_pull(skb, dh->dccph_doff * 4); |
| 166 | __skb_queue_tail(&sk->sk_receive_queue, skb); |
| 167 | skb_set_owner_r(skb, sk); |
| 168 | sk->sk_data_ready(sk, 0); |
| 169 | return 0; |
| 170 | case DCCP_PKT_ACK: |
| 171 | goto discard; |
| 172 | case DCCP_PKT_RESET: |
| 173 | /* |
| 174 | * Step 9: Process Reset |
| 175 | * If P.type == Reset, |
| 176 | * Tear down connection |
| 177 | * S.state := TIMEWAIT |
| 178 | * Set TIMEWAIT timer |
| 179 | * Drop packet and return |
| 180 | */ |
| 181 | dccp_fin(sk, skb); |
| 182 | dccp_time_wait(sk, DCCP_TIME_WAIT, 0); |
| 183 | return 0; |
| 184 | case DCCP_PKT_CLOSEREQ: |
| 185 | dccp_rcv_closereq(sk, skb); |
| 186 | goto discard; |
| 187 | case DCCP_PKT_CLOSE: |
| 188 | dccp_rcv_close(sk, skb); |
| 189 | return 0; |
| 190 | case DCCP_PKT_REQUEST: |
Arnaldo Carvalho de Melo | 8109b02 | 2006-12-10 16:01:18 -0200 | [diff] [blame] | 191 | /* Step 7 |
| 192 | * or (S.is_server and P.type == Response) |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 193 | * or (S.is_client and P.type == Request) |
| 194 | * or (S.state >= OPEN and P.type == Request |
| 195 | * and P.seqno >= S.OSR) |
| 196 | * or (S.state >= OPEN and P.type == Response |
| 197 | * and P.seqno >= S.OSR) |
| 198 | * or (S.state == RESPOND and P.type == Data), |
| 199 | * Send Sync packet acknowledging P.seqno |
| 200 | * Drop packet and return |
| 201 | */ |
| 202 | if (dp->dccps_role != DCCP_ROLE_LISTEN) |
| 203 | goto send_sync; |
| 204 | goto check_seq; |
| 205 | case DCCP_PKT_RESPONSE: |
| 206 | if (dp->dccps_role != DCCP_ROLE_CLIENT) |
| 207 | goto send_sync; |
| 208 | check_seq: |
Gerrit Renker | 8d13bf9 | 2007-03-20 13:08:19 -0300 | [diff] [blame] | 209 | if (dccp_delta_seqno(dp->dccps_osr, |
| 210 | DCCP_SKB_CB(skb)->dccpd_seq) >= 0) { |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 211 | send_sync: |
Arnaldo Carvalho de Melo | e92ae93 | 2005-08-17 03:10:59 -0300 | [diff] [blame] | 212 | dccp_send_sync(sk, DCCP_SKB_CB(skb)->dccpd_seq, |
| 213 | DCCP_PKT_SYNC); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 214 | } |
| 215 | break; |
Arnaldo Carvalho de Melo | e92ae93 | 2005-08-17 03:10:59 -0300 | [diff] [blame] | 216 | case DCCP_PKT_SYNC: |
| 217 | dccp_send_sync(sk, DCCP_SKB_CB(skb)->dccpd_seq, |
| 218 | DCCP_PKT_SYNCACK); |
| 219 | /* |
Gerrit Renker | 0e64e94 | 2006-10-24 16:17:51 -0700 | [diff] [blame] | 220 | * From RFC 4340, sec. 5.7 |
Arnaldo Carvalho de Melo | e92ae93 | 2005-08-17 03:10:59 -0300 | [diff] [blame] | 221 | * |
| 222 | * As with DCCP-Ack packets, DCCP-Sync and DCCP-SyncAck packets |
| 223 | * MAY have non-zero-length application data areas, whose |
Gerrit Renker | 0e64e94 | 2006-10-24 16:17:51 -0700 | [diff] [blame] | 224 | * contents receivers MUST ignore. |
Arnaldo Carvalho de Melo | e92ae93 | 2005-08-17 03:10:59 -0300 | [diff] [blame] | 225 | */ |
| 226 | goto discard; |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | DCCP_INC_STATS_BH(DCCP_MIB_INERRS); |
| 230 | discard: |
| 231 | __kfree_skb(skb); |
| 232 | return 0; |
| 233 | } |
| 234 | |
Andrea Bittau | 709dd3a | 2006-01-03 14:25:17 -0800 | [diff] [blame] | 235 | int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, |
| 236 | const struct dccp_hdr *dh, const unsigned len) |
| 237 | { |
| 238 | struct dccp_sock *dp = dccp_sk(sk); |
| 239 | |
| 240 | if (dccp_check_seqno(sk, skb)) |
| 241 | goto discard; |
| 242 | |
| 243 | if (dccp_parse_options(sk, skb)) |
| 244 | goto discard; |
| 245 | |
| 246 | if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) |
| 247 | dccp_event_ack_recv(sk, skb); |
| 248 | |
Arnaldo Carvalho de Melo | a4bf390 | 2006-03-20 22:50:58 -0800 | [diff] [blame] | 249 | if (dccp_msk(sk)->dccpms_send_ack_vector && |
Andrea Bittau | 709dd3a | 2006-01-03 14:25:17 -0800 | [diff] [blame] | 250 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, |
| 251 | DCCP_SKB_CB(skb)->dccpd_seq, |
| 252 | DCCP_ACKVEC_STATE_RECEIVED)) |
| 253 | goto discard; |
| 254 | |
Gerrit Renker | 151a993 | 2007-03-07 12:53:48 -0800 | [diff] [blame] | 255 | ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb); |
| 256 | ccid_hc_tx_packet_recv(dp->dccps_hc_tx_ccid, sk, skb); |
Andrea Bittau | 709dd3a | 2006-01-03 14:25:17 -0800 | [diff] [blame] | 257 | |
| 258 | return __dccp_rcv_established(sk, skb, dh, len); |
| 259 | discard: |
| 260 | __kfree_skb(skb); |
| 261 | return 0; |
| 262 | } |
| 263 | |
Arnaldo Carvalho de Melo | f21e68c | 2005-12-13 23:24:16 -0800 | [diff] [blame] | 264 | EXPORT_SYMBOL_GPL(dccp_rcv_established); |
| 265 | |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 266 | static int dccp_rcv_request_sent_state_process(struct sock *sk, |
| 267 | struct sk_buff *skb, |
| 268 | const struct dccp_hdr *dh, |
| 269 | const unsigned len) |
| 270 | { |
Arnaldo Carvalho de Melo | 8109b02 | 2006-12-10 16:01:18 -0200 | [diff] [blame] | 271 | /* |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 272 | * Step 4: Prepare sequence numbers in REQUEST |
| 273 | * If S.state == REQUEST, |
| 274 | * If (P.type == Response or P.type == Reset) |
| 275 | * and S.AWL <= P.ackno <= S.AWH, |
| 276 | * / * Set sequence number variables corresponding to the |
| 277 | * other endpoint, so P will pass the tests in Step 6 * / |
| 278 | * Set S.GSR, S.ISR, S.SWL, S.SWH |
| 279 | * / * Response processing continues in Step 10; Reset |
| 280 | * processing continues in Step 9 * / |
| 281 | */ |
| 282 | if (dh->dccph_type == DCCP_PKT_RESPONSE) { |
| 283 | const struct inet_connection_sock *icsk = inet_csk(sk); |
| 284 | struct dccp_sock *dp = dccp_sk(sk); |
Gerrit Renker | 3393da8 | 2007-09-25 22:40:44 -0700 | [diff] [blame] | 285 | long tstamp = dccp_timestamp(); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 286 | |
| 287 | /* Stop the REQUEST timer */ |
| 288 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_RETRANS); |
| 289 | BUG_TRAP(sk->sk_send_head != NULL); |
| 290 | __kfree_skb(sk->sk_send_head); |
| 291 | sk->sk_send_head = NULL; |
| 292 | |
Arnaldo Carvalho de Melo | 7690af3 | 2005-08-13 20:34:54 -0300 | [diff] [blame] | 293 | if (!between48(DCCP_SKB_CB(skb)->dccpd_ack_seq, |
| 294 | dp->dccps_awl, dp->dccps_awh)) { |
| 295 | dccp_pr_debug("invalid ackno: S.AWL=%llu, " |
| 296 | "P.ackno=%llu, S.AWH=%llu \n", |
| 297 | (unsigned long long)dp->dccps_awl, |
| 298 | (unsigned long long)DCCP_SKB_CB(skb)->dccpd_ack_seq, |
| 299 | (unsigned long long)dp->dccps_awh); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 300 | goto out_invalid_packet; |
| 301 | } |
| 302 | |
Andrea Bittau | afe0025 | 2006-03-20 17:43:56 -0800 | [diff] [blame] | 303 | if (dccp_parse_options(sk, skb)) |
| 304 | goto out_invalid_packet; |
| 305 | |
Gerrit Renker | 3393da8 | 2007-09-25 22:40:44 -0700 | [diff] [blame] | 306 | /* Obtain usec RTT sample from SYN exchange (used by CCID 3) */ |
| 307 | if (likely(dp->dccps_options_received.dccpor_timestamp_echo)) |
| 308 | dp->dccps_syn_rtt = dccp_sample_rtt(sk, 10 * (tstamp - |
| 309 | dp->dccps_options_received.dccpor_timestamp_echo)); |
Gerrit Renker | 89560b5 | 2007-03-20 15:27:17 -0300 | [diff] [blame] | 310 | |
YOSHIFUJI Hideaki | c9eaf17 | 2007-02-09 23:24:38 +0900 | [diff] [blame] | 311 | if (dccp_msk(sk)->dccpms_send_ack_vector && |
| 312 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, |
| 313 | DCCP_SKB_CB(skb)->dccpd_seq, |
| 314 | DCCP_ACKVEC_STATE_RECEIVED)) |
| 315 | goto out_invalid_packet; /* FIXME: change error code */ |
Andrea Bittau | 9e37720 | 2006-01-03 14:25:49 -0800 | [diff] [blame] | 316 | |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 317 | dp->dccps_isr = DCCP_SKB_CB(skb)->dccpd_seq; |
Arnaldo Carvalho de Melo | 03ace39 | 2005-08-21 05:36:45 -0300 | [diff] [blame] | 318 | dccp_update_gsr(sk, dp->dccps_isr); |
| 319 | /* |
| 320 | * SWL and AWL are initially adjusted so that they are not less than |
| 321 | * the initial Sequence Numbers received and sent, respectively: |
| 322 | * SWL := max(GSR + 1 - floor(W/4), ISR), |
| 323 | * AWL := max(GSS - W' + 1, ISS). |
| 324 | * These adjustments MUST be applied only at the beginning of the |
| 325 | * connection. |
| 326 | * |
| 327 | * AWL was adjusted in dccp_v4_connect -acme |
| 328 | */ |
| 329 | dccp_set_seqno(&dp->dccps_swl, |
| 330 | max48(dp->dccps_swl, dp->dccps_isr)); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 331 | |
Arnaldo Carvalho de Melo | d83d846 | 2005-12-13 23:26:10 -0800 | [diff] [blame] | 332 | dccp_sync_mss(sk, icsk->icsk_pmtu_cookie); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 333 | |
| 334 | /* |
| 335 | * Step 10: Process REQUEST state (second part) |
| 336 | * If S.state == REQUEST, |
Arnaldo Carvalho de Melo | 7690af3 | 2005-08-13 20:34:54 -0300 | [diff] [blame] | 337 | * / * If we get here, P is a valid Response from the |
| 338 | * server (see Step 4), and we should move to |
| 339 | * PARTOPEN state. PARTOPEN means send an Ack, |
| 340 | * don't send Data packets, retransmit Acks |
| 341 | * periodically, and always include any Init Cookie |
| 342 | * from the Response * / |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 343 | * S.state := PARTOPEN |
| 344 | * Set PARTOPEN timer |
Arnaldo Carvalho de Melo | 8109b02 | 2006-12-10 16:01:18 -0200 | [diff] [blame] | 345 | * Continue with S.state == PARTOPEN |
Arnaldo Carvalho de Melo | 7690af3 | 2005-08-13 20:34:54 -0300 | [diff] [blame] | 346 | * / * Step 12 will send the Ack completing the |
| 347 | * three-way handshake * / |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 348 | */ |
| 349 | dccp_set_state(sk, DCCP_PARTOPEN); |
| 350 | |
| 351 | /* Make sure socket is routed, for correct metrics. */ |
Arnaldo Carvalho de Melo | 57cca05 | 2005-12-13 23:16:16 -0800 | [diff] [blame] | 352 | icsk->icsk_af_ops->rebuild_header(sk); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 353 | |
| 354 | if (!sock_flag(sk, SOCK_DEAD)) { |
| 355 | sk->sk_state_change(sk); |
| 356 | sk_wake_async(sk, 0, POLL_OUT); |
| 357 | } |
| 358 | |
| 359 | if (sk->sk_write_pending || icsk->icsk_ack.pingpong || |
| 360 | icsk->icsk_accept_queue.rskq_defer_accept) { |
| 361 | /* Save one ACK. Data will be ready after |
| 362 | * several ticks, if write_pending is set. |
| 363 | * |
| 364 | * It may be deleted, but with this feature tcpdumps |
| 365 | * look so _wonderfully_ clever, that I was not able |
| 366 | * to stand against the temptation 8) --ANK |
| 367 | */ |
| 368 | /* |
| 369 | * OK, in DCCP we can as well do a similar trick, its |
| 370 | * even in the draft, but there is no need for us to |
| 371 | * schedule an ack here, as dccp_sendmsg does this for |
| 372 | * us, also stated in the draft. -acme |
| 373 | */ |
| 374 | __kfree_skb(skb); |
| 375 | return 0; |
Arnaldo Carvalho de Melo | 8109b02 | 2006-12-10 16:01:18 -0200 | [diff] [blame] | 376 | } |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 377 | dccp_send_ack(sk); |
| 378 | return -1; |
| 379 | } |
| 380 | |
| 381 | out_invalid_packet: |
Arnaldo Carvalho de Melo | 0c10c5d | 2005-09-16 16:58:33 -0700 | [diff] [blame] | 382 | /* dccp_v4_do_rcv will send a reset */ |
| 383 | DCCP_SKB_CB(skb)->dccpd_reset_code = DCCP_RESET_CODE_PACKET_ERROR; |
Arnaldo Carvalho de Melo | 8109b02 | 2006-12-10 16:01:18 -0200 | [diff] [blame] | 384 | return 1; |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 385 | } |
| 386 | |
| 387 | static int dccp_rcv_respond_partopen_state_process(struct sock *sk, |
| 388 | struct sk_buff *skb, |
| 389 | const struct dccp_hdr *dh, |
| 390 | const unsigned len) |
| 391 | { |
| 392 | int queued = 0; |
| 393 | |
| 394 | switch (dh->dccph_type) { |
| 395 | case DCCP_PKT_RESET: |
| 396 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_DACK); |
| 397 | break; |
Arnaldo Carvalho de Melo | 2a9bc9b | 2005-10-10 21:25:00 -0700 | [diff] [blame] | 398 | case DCCP_PKT_DATA: |
| 399 | if (sk->sk_state == DCCP_RESPOND) |
| 400 | break; |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 401 | case DCCP_PKT_DATAACK: |
| 402 | case DCCP_PKT_ACK: |
| 403 | /* |
Arnaldo Carvalho de Melo | 7690af3 | 2005-08-13 20:34:54 -0300 | [diff] [blame] | 404 | * FIXME: we should be reseting the PARTOPEN (DELACK) timer |
| 405 | * here but only if we haven't used the DELACK timer for |
| 406 | * something else, like sending a delayed ack for a TIMESTAMP |
| 407 | * echo, etc, for now were not clearing it, sending an extra |
| 408 | * ACK when there is nothing else to do in DELACK is not a big |
| 409 | * deal after all. |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 410 | */ |
| 411 | |
| 412 | /* Stop the PARTOPEN timer */ |
| 413 | if (sk->sk_state == DCCP_PARTOPEN) |
| 414 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_DACK); |
| 415 | |
| 416 | dccp_sk(sk)->dccps_osr = DCCP_SKB_CB(skb)->dccpd_seq; |
| 417 | dccp_set_state(sk, DCCP_OPEN); |
| 418 | |
Arnaldo Carvalho de Melo | 2a9bc9b | 2005-10-10 21:25:00 -0700 | [diff] [blame] | 419 | if (dh->dccph_type == DCCP_PKT_DATAACK || |
| 420 | dh->dccph_type == DCCP_PKT_DATA) { |
Andrea Bittau | 709dd3a | 2006-01-03 14:25:17 -0800 | [diff] [blame] | 421 | __dccp_rcv_established(sk, skb, dh, len); |
Arnaldo Carvalho de Melo | 7690af3 | 2005-08-13 20:34:54 -0300 | [diff] [blame] | 422 | queued = 1; /* packet was queued |
Andrea Bittau | 709dd3a | 2006-01-03 14:25:17 -0800 | [diff] [blame] | 423 | (by __dccp_rcv_established) */ |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 424 | } |
| 425 | break; |
| 426 | } |
| 427 | |
| 428 | return queued; |
| 429 | } |
| 430 | |
| 431 | int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, |
| 432 | struct dccp_hdr *dh, unsigned len) |
| 433 | { |
| 434 | struct dccp_sock *dp = dccp_sk(sk); |
Arnaldo Carvalho de Melo | 0c10c5d | 2005-09-16 16:58:33 -0700 | [diff] [blame] | 435 | struct dccp_skb_cb *dcb = DCCP_SKB_CB(skb); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 436 | const int old_state = sk->sk_state; |
| 437 | int queued = 0; |
| 438 | |
Arnaldo Carvalho de Melo | 8649b0d | 2005-08-13 20:36:01 -0300 | [diff] [blame] | 439 | /* |
| 440 | * Step 3: Process LISTEN state |
Arnaldo Carvalho de Melo | 8649b0d | 2005-08-13 20:36:01 -0300 | [diff] [blame] | 441 | * |
| 442 | * If S.state == LISTEN, |
Gerrit Renker | d83ca5a | 2006-11-10 16:29:14 -0200 | [diff] [blame] | 443 | * If P.type == Request or P contains a valid Init Cookie option, |
| 444 | * (* Must scan the packet's options to check for Init |
| 445 | * Cookies. Only Init Cookies are processed here, |
| 446 | * however; other options are processed in Step 8. This |
| 447 | * scan need only be performed if the endpoint uses Init |
| 448 | * Cookies *) |
| 449 | * (* Generate a new socket and switch to that socket *) |
| 450 | * Set S := new socket for this port pair |
| 451 | * S.state = RESPOND |
| 452 | * Choose S.ISS (initial seqno) or set from Init Cookies |
| 453 | * Initialize S.GAR := S.ISS |
| 454 | * Set S.ISR, S.GSR, S.SWL, S.SWH from packet or Init |
| 455 | * Cookies Continue with S.state == RESPOND |
| 456 | * (* A Response packet will be generated in Step 11 *) |
| 457 | * Otherwise, |
| 458 | * Generate Reset(No Connection) unless P.type == Reset |
| 459 | * Drop packet and return |
Arnaldo Carvalho de Melo | 8649b0d | 2005-08-13 20:36:01 -0300 | [diff] [blame] | 460 | */ |
| 461 | if (sk->sk_state == DCCP_LISTEN) { |
| 462 | if (dh->dccph_type == DCCP_PKT_REQUEST) { |
Arnaldo Carvalho de Melo | 57cca05 | 2005-12-13 23:16:16 -0800 | [diff] [blame] | 463 | if (inet_csk(sk)->icsk_af_ops->conn_request(sk, |
| 464 | skb) < 0) |
Arnaldo Carvalho de Melo | 8649b0d | 2005-08-13 20:36:01 -0300 | [diff] [blame] | 465 | return 1; |
| 466 | |
| 467 | /* FIXME: do congestion control initialization */ |
| 468 | goto discard; |
| 469 | } |
| 470 | if (dh->dccph_type == DCCP_PKT_RESET) |
| 471 | goto discard; |
| 472 | |
Arnaldo Carvalho de Melo | 0c10c5d | 2005-09-16 16:58:33 -0700 | [diff] [blame] | 473 | /* Caller (dccp_v4_do_rcv) will send Reset */ |
| 474 | dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION; |
Arnaldo Carvalho de Melo | 8649b0d | 2005-08-13 20:36:01 -0300 | [diff] [blame] | 475 | return 1; |
| 476 | } |
| 477 | |
| 478 | if (sk->sk_state != DCCP_REQUESTING) { |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 479 | if (dccp_check_seqno(sk, skb)) |
| 480 | goto discard; |
| 481 | |
| 482 | /* |
| 483 | * Step 8: Process options and mark acknowledgeable |
| 484 | */ |
| 485 | if (dccp_parse_options(sk, skb)) |
| 486 | goto discard; |
| 487 | |
Arnaldo Carvalho de Melo | 0c10c5d | 2005-09-16 16:58:33 -0700 | [diff] [blame] | 488 | if (dcb->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 489 | dccp_event_ack_recv(sk, skb); |
| 490 | |
Arnaldo Carvalho de Melo | 8109b02 | 2006-12-10 16:01:18 -0200 | [diff] [blame] | 491 | if (dccp_msk(sk)->dccpms_send_ack_vector && |
Arnaldo Carvalho de Melo | ae31c33 | 2005-09-18 00:17:51 -0700 | [diff] [blame] | 492 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, |
Arnaldo Carvalho de Melo | 8109b02 | 2006-12-10 16:01:18 -0200 | [diff] [blame] | 493 | DCCP_SKB_CB(skb)->dccpd_seq, |
| 494 | DCCP_ACKVEC_STATE_RECEIVED)) |
| 495 | goto discard; |
Andrea Bittau | e84a9f5 | 2006-01-03 14:26:15 -0800 | [diff] [blame] | 496 | |
Gerrit Renker | 151a993 | 2007-03-07 12:53:48 -0800 | [diff] [blame] | 497 | ccid_hc_rx_packet_recv(dp->dccps_hc_rx_ccid, sk, skb); |
| 498 | ccid_hc_tx_packet_recv(dp->dccps_hc_tx_ccid, sk, skb); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 499 | } |
| 500 | |
| 501 | /* |
| 502 | * Step 9: Process Reset |
| 503 | * If P.type == Reset, |
| 504 | * Tear down connection |
| 505 | * S.state := TIMEWAIT |
| 506 | * Set TIMEWAIT timer |
| 507 | * Drop packet and return |
| 508 | */ |
| 509 | if (dh->dccph_type == DCCP_PKT_RESET) { |
Arnaldo Carvalho de Melo | 7690af3 | 2005-08-13 20:34:54 -0300 | [diff] [blame] | 510 | /* |
| 511 | * Queue the equivalent of TCP fin so that dccp_recvmsg |
| 512 | * exits the loop |
| 513 | */ |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 514 | dccp_fin(sk, skb); |
| 515 | dccp_time_wait(sk, DCCP_TIME_WAIT, 0); |
| 516 | return 0; |
| 517 | /* |
| 518 | * Step 7: Check for unexpected packet types |
| 519 | * If (S.is_server and P.type == CloseReq) |
| 520 | * or (S.is_server and P.type == Response) |
| 521 | * or (S.is_client and P.type == Request) |
| 522 | * or (S.state == RESPOND and P.type == Data), |
| 523 | * Send Sync packet acknowledging P.seqno |
| 524 | * Drop packet and return |
| 525 | */ |
| 526 | } else if ((dp->dccps_role != DCCP_ROLE_CLIENT && |
Arnaldo Carvalho de Melo | 7690af3 | 2005-08-13 20:34:54 -0300 | [diff] [blame] | 527 | (dh->dccph_type == DCCP_PKT_RESPONSE || |
| 528 | dh->dccph_type == DCCP_PKT_CLOSEREQ)) || |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 529 | (dp->dccps_role == DCCP_ROLE_CLIENT && |
| 530 | dh->dccph_type == DCCP_PKT_REQUEST) || |
Arnaldo Carvalho de Melo | 7690af3 | 2005-08-13 20:34:54 -0300 | [diff] [blame] | 531 | (sk->sk_state == DCCP_RESPOND && |
| 532 | dh->dccph_type == DCCP_PKT_DATA)) { |
Arnaldo Carvalho de Melo | 0c10c5d | 2005-09-16 16:58:33 -0700 | [diff] [blame] | 533 | dccp_send_sync(sk, dcb->dccpd_seq, DCCP_PKT_SYNC); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 534 | goto discard; |
Arnaldo Carvalho de Melo | 7ad07e7 | 2005-08-23 21:50:06 -0700 | [diff] [blame] | 535 | } else if (dh->dccph_type == DCCP_PKT_CLOSEREQ) { |
| 536 | dccp_rcv_closereq(sk, skb); |
| 537 | goto discard; |
| 538 | } else if (dh->dccph_type == DCCP_PKT_CLOSE) { |
| 539 | dccp_rcv_close(sk, skb); |
| 540 | return 0; |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 541 | } |
| 542 | |
| 543 | switch (sk->sk_state) { |
| 544 | case DCCP_CLOSED: |
Arnaldo Carvalho de Melo | 0c10c5d | 2005-09-16 16:58:33 -0700 | [diff] [blame] | 545 | dcb->dccpd_reset_code = DCCP_RESET_CODE_NO_CONNECTION; |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 546 | return 1; |
| 547 | |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 548 | case DCCP_REQUESTING: |
| 549 | /* FIXME: do congestion control initialization */ |
| 550 | |
| 551 | queued = dccp_rcv_request_sent_state_process(sk, skb, dh, len); |
| 552 | if (queued >= 0) |
| 553 | return queued; |
| 554 | |
| 555 | __kfree_skb(skb); |
| 556 | return 0; |
| 557 | |
| 558 | case DCCP_RESPOND: |
| 559 | case DCCP_PARTOPEN: |
Arnaldo Carvalho de Melo | 7690af3 | 2005-08-13 20:34:54 -0300 | [diff] [blame] | 560 | queued = dccp_rcv_respond_partopen_state_process(sk, skb, |
| 561 | dh, len); |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 562 | break; |
| 563 | } |
| 564 | |
Arnaldo Carvalho de Melo | 7690af3 | 2005-08-13 20:34:54 -0300 | [diff] [blame] | 565 | if (dh->dccph_type == DCCP_PKT_ACK || |
| 566 | dh->dccph_type == DCCP_PKT_DATAACK) { |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 567 | switch (old_state) { |
| 568 | case DCCP_PARTOPEN: |
| 569 | sk->sk_state_change(sk); |
| 570 | sk_wake_async(sk, 0, POLL_OUT); |
| 571 | break; |
| 572 | } |
Gerrit Renker | 0883170 | 2007-09-26 10:30:05 -0300 | [diff] [blame^] | 573 | } else if (unlikely(dh->dccph_type == DCCP_PKT_SYNC)) { |
| 574 | dccp_send_sync(sk, dcb->dccpd_seq, DCCP_PKT_SYNCACK); |
| 575 | goto discard; |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 576 | } |
| 577 | |
Arnaldo Carvalho de Melo | 8109b02 | 2006-12-10 16:01:18 -0200 | [diff] [blame] | 578 | if (!queued) { |
Arnaldo Carvalho de Melo | 7c65787 | 2005-08-09 20:14:34 -0700 | [diff] [blame] | 579 | discard: |
| 580 | __kfree_skb(skb); |
| 581 | } |
| 582 | return 0; |
| 583 | } |
Arnaldo Carvalho de Melo | f21e68c | 2005-12-13 23:24:16 -0800 | [diff] [blame] | 584 | |
| 585 | EXPORT_SYMBOL_GPL(dccp_rcv_state_process); |
Gerrit Renker | 4712a79 | 2007-03-20 15:23:18 -0300 | [diff] [blame] | 586 | |
| 587 | /** |
Gerrit Renker | 3393da8 | 2007-09-25 22:40:44 -0700 | [diff] [blame] | 588 | * dccp_sample_rtt - Validate and finalise computation of RTT sample |
| 589 | * @delta: number of microseconds between packet and acknowledgment |
| 590 | * The routine is kept generic to work in different contexts. It should be |
| 591 | * called immediately when the ACK used for the RTT sample arrives. |
Gerrit Renker | 4712a79 | 2007-03-20 15:23:18 -0300 | [diff] [blame] | 592 | */ |
Gerrit Renker | 3393da8 | 2007-09-25 22:40:44 -0700 | [diff] [blame] | 593 | u32 dccp_sample_rtt(struct sock *sk, long delta) |
Gerrit Renker | 4712a79 | 2007-03-20 15:23:18 -0300 | [diff] [blame] | 594 | { |
Gerrit Renker | 3393da8 | 2007-09-25 22:40:44 -0700 | [diff] [blame] | 595 | /* dccpor_elapsed_time is either zeroed out or set and > 0 */ |
| 596 | delta -= dccp_sk(sk)->dccps_options_received.dccpor_elapsed_time * 10; |
Gerrit Renker | 4712a79 | 2007-03-20 15:23:18 -0300 | [diff] [blame] | 597 | |
| 598 | if (unlikely(delta <= 0)) { |
Gerrit Renker | 3393da8 | 2007-09-25 22:40:44 -0700 | [diff] [blame] | 599 | DCCP_WARN("unusable RTT sample %ld, using min\n", delta); |
Gerrit Renker | 4712a79 | 2007-03-20 15:23:18 -0300 | [diff] [blame] | 600 | return DCCP_SANE_RTT_MIN; |
| 601 | } |
Gerrit Renker | 3393da8 | 2007-09-25 22:40:44 -0700 | [diff] [blame] | 602 | if (unlikely(delta > DCCP_SANE_RTT_MAX)) { |
| 603 | DCCP_WARN("RTT sample %ld too large, using max\n", delta); |
Gerrit Renker | 4712a79 | 2007-03-20 15:23:18 -0300 | [diff] [blame] | 604 | return DCCP_SANE_RTT_MAX; |
| 605 | } |
| 606 | |
| 607 | return delta; |
| 608 | } |
| 609 | |
| 610 | EXPORT_SYMBOL_GPL(dccp_sample_rtt); |