13 #include <linux/dccp.h>
15 #include <linux/slab.h>
28 __skb_pull(skb,
dccp_hdr(skb)->dccph_doff * 4);
30 skb_set_owner_r(skb, sk);
44 dccp_enqueue_skb(sk, skb);
51 switch (sk->sk_state) {
93 static int dccp_rcv_closereq(
struct sock *sk,
struct sk_buff *skb)
109 switch (sk->sk_state) {
127 static u16 dccp_reset_code_convert(
const u8 code)
149 static void dccp_rcv_reset(
struct sock *sk,
struct sk_buff *skb)
163 static void dccp_handle_ackvec_processing(
struct sock *sk,
struct sk_buff *skb)
174 static void dccp_deliver_input_to_ccids(
struct sock *sk,
struct sk_buff *skb)
189 static int dccp_check_seqno(
struct sock *sk,
struct sk_buff *skb)
211 dccp_delta_seqno(dp->
dccps_swl, seqno) >= 0)
212 dccp_update_gsr(sk, seqno);
238 if (between48(seqno, lswl, dp->
dccps_swh) &&
240 between48(ackno, lawl, dp->
dccps_awh))) {
241 dccp_update_gsr(sk, seqno);
262 sysctl_dccp_sync_ratelimit)))
265 DCCP_WARN(
"Step 6 failed for %s packet, "
266 "(LSWL(%llu) <= P.seqno(%llu) <= S.SWH(%llu)) and "
267 "(P.ackno %s or LAWL(%llu) <= P.ackno(%llu) <= S.AWH(%llu), "
269 (
unsigned long long) lswl, (
unsigned long long) seqno,
273 (
unsigned long long) lawl, (
unsigned long long) ackno,
287 static int __dccp_rcv_established(
struct sock *sk,
struct sk_buff *skb,
288 const struct dccp_hdr *dh,
const unsigned int len)
292 switch (
dccp_hdr(skb)->dccph_type) {
300 dccp_enqueue_skb(sk, skb);
313 dccp_rcv_reset(sk, skb);
316 if (dccp_rcv_closereq(sk, skb))
320 if (dccp_rcv_close(sk, skb))
369 const struct dccp_hdr *dh,
const unsigned int len)
371 if (dccp_check_seqno(sk, skb))
377 dccp_handle_ackvec_processing(sk, skb);
378 dccp_deliver_input_to_ccids(sk, skb);
380 return __dccp_rcv_established(sk, skb, dh, len);
388 static int dccp_rcv_request_sent_state_process(
struct sock *sk,
391 const unsigned int len)
412 "P.ackno=%llu, S.AWH=%llu\n",
414 (
unsigned long long)
DCCP_SKB_CB(skb)->dccpd_ack_seq,
416 goto out_invalid_packet;
473 goto unable_to_proceed;
521 static int dccp_rcv_respond_partopen_state_process(
struct sock *sk,
524 const unsigned int len)
530 switch (dh->dccph_type) {
564 __dccp_rcv_established(sk, skb, dh, len);
575 struct dccp_hdr *dh,
unsigned int len)
579 const int old_state = sk->sk_state;
606 if (inet_csk(sk)->icsk_af_ops->conn_request(sk,
656 dccp_rcv_reset(sk, skb);
659 if (dccp_rcv_closereq(sk, skb))
663 if (dccp_rcv_close(sk, skb))
668 switch (sk->sk_state) {
670 queued = dccp_rcv_request_sent_state_process(sk, skb, dh, len);
679 dccp_handle_ackvec_processing(sk, skb);
680 dccp_deliver_input_to_ccids(sk, skb);
683 queued = dccp_rcv_respond_partopen_state_process(sk, skb,
720 delta -= dccp_sk(sk)->dccps_options_received.dccpor_elapsed_time * 10;
723 DCCP_WARN(
"unusable RTT sample %ld, using min\n", delta);
727 DCCP_WARN(
"RTT sample %ld too large, using max\n", delta);