Skip to contentSkip to conversation

dccp: Don't Reset On Confirm for Old NN Feature Values

PATCH In review Samuel Jero 2 participants 3 messages Feb 14, 2011 – Feb 26, 2011 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 3/4 dccp: Don't Reset On Confirm for Old NN Feature Values

The Current DCCP code resets the connection when it encounters a Confirm for an NN feature with a value that doesn't match the most recent Change sent. However, this causes unneeded resets if an NN option changes twice within two RTTs. Further, this would break on the multiple Change options for a feature in one packet example in RFC4340 6.6.1.

This patch modifies the code to simply ignore such a Confirm Option.

---
Signed-off-by: Samuel Jero

net/dccp/feat.c +2 -4
index 6f2bc96..e5c1bad 100644
@@ -1347,10 +1347,8 @@ static u8 dccp_feat_handle_nn_established(struct sock *sk, u8 mandatory, u8 opt,
 			return 0;
 
 		fval.nn = dccp_decode_value_var(val, len);
-		if (fval.nn != entry->val.nn) {
-			DCCP_WARN("Bogus Confirm for non-existing value\n");
-			goto fast_path_failed;
-		}
+		if (fval.nn != entry->val.nn)
+			return 0;
 
 		/* It has been confirmed - so remove the entry */
 		dccp_feat_list_pop(entry);
#1 lore raw

Re: [PATCH 3/4] dccp: Don't Reset On Confirm for Old NN Feature

| --- a/net/dccp/feat.c
| +++ b/net/dccp/feat.c
| @@ -1347,10 +1347,8 @@ static u8 dccp_feat_handle_nn_established(struct sock *sk, u8 mandatory, u8 opt,
|  			return 0;
|  
|  		fval.nn = dccp_decode_value_var(val, len);
| -		if (fval.nn != entry->val.nn) {
| -			DCCP_WARN("Bogus Confirm for non-existing value\n");
| -			goto fast_path_failed;
| -		}
| +		if (fval.nn != entry->val.nn)
| +			return 0;
|  
|  		/* It has been confirmed - so remove the entry */
|  		dccp_feat_list_pop(entry);
| 

This looks good.

It would be good to document this case in a comment above the statement. The description sounds very plausible and I recall that these warnings were triggered quite often. Returning 0 here means that the ChangeL does not enter `confirmed' state, hence gets retransmitted (possibly with the most recent value).

#2 lore raw

Re: [PATCH 3/4] dccp: Don't Reset On Confirm for Old NN Feature

In reply to Samuel Jero

The Current DCCP code resets the connection when it encounters a Confirm for an NN feature with a value that doesn't match the most recent Change sent. However, this causes unneeded resets if an NN option changes twice within two RTTs. Further, this would break on the multiple Change options for a feature in one packet example in RFC4340 6.6.1.

This patch modifies the code to simply ignore such a Confirm Option.

---
Signed-off-by: Samuel Jero

net/dccp/feat.c +8 -4
@@ -1347,10 +1337,14 @@ static u8 dccp_feat_handle_nn_established(struct sock *sk, u8 mandatory, u8 opt,
 			return 0;
 
 		fval.nn = dccp_decode_value_var(val, len);
-		if (fval.nn != entry->val.nn) {
-			DCCP_WARN("Bogus Confirm for non-existing value\n");
-			goto fast_path_failed;
-		}
+		/*
+		 * Just ignore a value that doesn't match our current value.
+		 * If the option changes twice within two RTTs, then at least
+		 * one CONFIRM will be received for the old value after a
+		 * new CHANGE was sent.
+		 */
+		if (fval.nn != entry->val.nn)
+			return 0;
 
 		/* It has been confirmed - so remove the entry */
 		dccp_feat_list_pop(entry);