virtio: get rid of redundant VIRTIO_ID_9P definition
[safe/jmp/linux-2.6] / net / dccp / output.c
index 0aab919..c96119f 100644 (file)
@@ -196,7 +196,7 @@ void dccp_write_space(struct sock *sk)
 {
        read_lock(&sk->sk_callback_lock);
 
-       if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
+       if (sk_has_sleeper(sk))
                wake_up_interruptible(sk->sk_sleep);
        /* Should agree with poll, otherwise some programs break */
        if (sock_writeable(sk))
@@ -276,7 +276,20 @@ void dccp_write_xmit(struct sock *sk, int block)
                        const int len = skb->len;
 
                        if (sk->sk_state == DCCP_PARTOPEN) {
-                               /* See 8.1.5.  Handshake Completion */
+                               const u32 cur_mps = dp->dccps_mss_cache - DCCP_FEATNEG_OVERHEAD;
+                               /*
+                                * See 8.1.5 - Handshake Completion.
+                                *
+                                * For robustness we resend Confirm options until the client has
+                                * entered OPEN. During the initial feature negotiation, the MPS
+                                * is smaller than usual, reduced by the Change/Confirm options.
+                                */
+                               if (!list_empty(&dp->dccps_featneg) && len > cur_mps) {
+                                       DCCP_WARN("Payload too large (%d) for featneg.\n", len);
+                                       dccp_send_ack(sk);
+                                       dccp_feat_list_purge(&dp->dccps_featneg);
+                               }
+
                                inet_csk_schedule_ack(sk);
                                inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK,
                                                  inet_csk(sk)->icsk_rto,
@@ -337,7 +350,7 @@ struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst,
        /* Reserve space for headers. */
        skb_reserve(skb, sk->sk_prot->max_header);
 
-       skb->dst = dst_clone(dst);
+       skb_dst_set(skb, dst_clone(dst));
 
        dreq = dccp_rsk(req);
        if (inet_rsk(req)->acked)       /* increase ISS upon retransmission */
@@ -355,7 +368,7 @@ struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst,
        /* Build and checksum header */
        dh = dccp_zeroed_hdr(skb, dccp_header_size);
 
-       dh->dccph_sport = inet_sk(sk)->sport;
+       dh->dccph_sport = inet_rsk(req)->loc_port;
        dh->dccph_dport = inet_rsk(req)->rmt_port;
        dh->dccph_doff  = (dccp_header_size +
                           DCCP_SKB_CB(skb)->dccpd_opt_len) / 4;