usin->sin_port);
dccp_update_gss(sk, dp->dccps_iss);
+ /*
+ * SWL and AWL are initially adjusted so that they are not less than
+ * the initial Sequence Numbers received and sent, respectively:
+ * SWL := max(GSR + 1 - floor(W/4), ISR),
+ * AWL := max(GSS - W' + 1, ISS).
+ * These adjustments MUST be applied only at the beginning of the
+ * connection.
+ */
+ dccp_set_seqno(&dp->dccps_awl, max48(dp->dccps_awl, dp->dccps_iss));
+
inet->id = dp->dccps_iss ^ jiffies;
err = dccp_connect(sk);
sizeof(struct dccp_hdr_reset);
struct sk_buff *skb;
struct dst_entry *dst;
+ u64 seqno;
/* Never send a reset in response to a reset. */
if (rxdh->dccph_type == DCCP_PKT_RESET)
dccp_hdr_reset(skb)->dccph_reset_code =
DCCP_SKB_CB(rxskb)->dccpd_reset_code;
- dccp_hdr_set_seq(dh, DCCP_SKB_CB(rxskb)->dccpd_ack_seq);
+ /* See "8.3.1. Abnormal Termination" in draft-ietf-dccp-spec-11 */
+ seqno = 0;
+ if (DCCP_SKB_CB(rxskb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ)
+ dccp_set_seqno(&seqno, DCCP_SKB_CB(rxskb)->dccpd_ack_seq + 1);
+
+ dccp_hdr_set_seq(dh, seqno);
dccp_hdr_set_ack(dccp_hdr_ack_bits(skb),
DCCP_SKB_CB(rxskb)->dccpd_seq);
return 1;
if (!pskb_may_pull(skb, sizeof(struct dccp_hdr))) {
- printk(KERN_WARNING "DCCP: pskb_may_pull failed\n");
+ LIMIT_NETDEBUG(KERN_WARNING "DCCP: pskb_may_pull failed\n");
return 1;
}
/* If the packet type is not understood, drop packet and return */
if (dh->dccph_type >= DCCP_PKT_INVALID) {
- printk(KERN_WARNING "DCCP: invalid packet type\n");
+ LIMIT_NETDEBUG(KERN_WARNING "DCCP: invalid packet type\n");
return 1;
}
* packet, drop packet and return
*/
if (dh->dccph_doff < dccp_hdr_len(skb) / sizeof(u32)) {
- printk(KERN_WARNING "DCCP: Offset(%u) too small 1\n",
- dh->dccph_doff);
+ LIMIT_NETDEBUG(KERN_WARNING "DCCP: P.Data Offset(%u) "
+ "too small 1\n",
+ dh->dccph_doff);
return 1;
}
if (!pskb_may_pull(skb, dh->dccph_doff * sizeof(u32))) {
- printk(KERN_WARNING "DCCP: P.Data Offset(%u) too small 2\n",
- dh->dccph_doff);
+ LIMIT_NETDEBUG(KERN_WARNING "DCCP: P.Data Offset(%u) "
+ "too small 2\n",
+ dh->dccph_doff);
return 1;
}
dh->dccph_type != DCCP_PKT_DATA &&
dh->dccph_type != DCCP_PKT_ACK &&
dh->dccph_type != DCCP_PKT_DATAACK) {
- printk(KERN_WARNING "DCCP: P.type (%s) not Data, Ack nor "
- "DataAck and P.X == 0\n",
- dccp_packet_name(dh->dccph_type));
+ LIMIT_NETDEBUG(KERN_WARNING "DCCP: P.type (%s) not Data, Ack "
+ "nor DataAck and P.X == 0\n",
+ dccp_packet_name(dh->dccph_type));
return 1;
}
/* If the header checksum is incorrect, drop packet and return */
if (dccp_v4_verify_checksum(skb, skb->nh.iph->saddr,
skb->nh.iph->daddr) < 0) {
- printk(KERN_WARNING "DCCP: header checksum is incorrect\n");
+ LIMIT_NETDEBUG(KERN_WARNING "DCCP: header checksum is "
+ "incorrect\n");
return 1;
}
dccp_init_xmit_timers(sk);
inet_csk(sk)->icsk_rto = DCCP_TIMEOUT_INIT;
sk->sk_state = DCCP_CLOSED;
+ sk->sk_write_space = dccp_write_space;
dp->dccps_mss_cache = 536;
dp->dccps_role = DCCP_ROLE_UNDEFINED;
if (inet_csk(sk)->icsk_bind_hash != NULL)
inet_put_port(&dccp_hashinfo, sk);
+ ccid_hc_rx_exit(dp->dccps_hc_rx_ccid, sk);
+ ccid_hc_tx_exit(dp->dccps_hc_tx_ccid, sk);
dccp_ackpkts_free(dp->dccps_hc_rx_ackpkts);
dp->dccps_hc_rx_ackpkts = NULL;
ccid_exit(dp->dccps_hc_rx_ccid, sk);