dccp: schedule an Ack when receiving timestamps
authorGerrit Renker <gerrit@erg.abdn.ac.uk>
Mon, 11 Oct 2010 18:41:13 +0000 (20:41 +0200)
committerGerrit Renker <gerrit@erg.abdn.ac.uk>
Tue, 12 Oct 2010 04:57:43 +0000 (06:57 +0200)
This schedules an Ack when receiving a timestamp, exploiting the
existing inet_csk_schedule_ack() function, saving one case in the
`dccp_ack_pending()' function.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
net/dccp/dccp.h
net/dccp/options.c

index 60f4f9622ab397362fc147f3eb76ac1a873f2117..3eb264b608239c74c16d27625cc4b3b5199a3ef8 100644 (file)
@@ -459,8 +459,7 @@ static inline void dccp_update_gss(struct sock *sk, u64 seq)
 static inline int dccp_ack_pending(const struct sock *sk)
 {
        const struct dccp_sock *dp = dccp_sk(sk);
-       return dp->dccps_timestamp_echo != 0 ||
-              (dp->dccps_hc_rx_ackvec != NULL &&
+       return (dp->dccps_hc_rx_ackvec != NULL &&
                dccp_ackvec_pending(dp->dccps_hc_rx_ackvec)) ||
               inet_csk_ack_scheduled(sk);
 }
index d4b1ae0daacbd6e76774b6cb1005a421a8a80ce9..cd306181300940f924b682c9f77e5881323ce6a0 100644 (file)
@@ -163,6 +163,8 @@ int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq,
                                      dccp_role(sk), ntohl(opt_val),
                                      (unsigned long long)
                                      DCCP_SKB_CB(skb)->dccpd_ack_seq);
+                       /* schedule an Ack in case this sender is quiescent */
+                       inet_csk_schedule_ack(sk);
                        break;
                case DCCPO_TIMESTAMP_ECHO:
                        if (len != 4 && len != 6 && len != 8)