Index: net/dccp/dccp_options.c
===================================================================
--- net/dccp/dccp_options.c.orig	2005-05-06 09:09:41.000000000 -0300
+++ net/dccp/dccp_options.c	2005-05-06 09:16:34.000000000 -0300
@@ -178,6 +178,14 @@
 			 * MUST be ignored, and any option space following an option with
 			 * nonsensical length MUST likewise be ignored.
 			 */
+			if (next_mandatory)
+				/*
+				 * we don't understand a mandatory option, we
+				 * should reset with "Mandatory Error" (see
+				 * 5.8.2)
+				 */
+				goto unknown_mandatory_option;
+
 			DCCP_INC_STATS_BH(DCCP_MIB_INVALIDOPT);
 			LIMIT_NETDEBUG(dccp_pr_debug("invalid option size\n"));
 			rc = 0; /* Just ignoring the other options, no need to reset */
@@ -279,11 +287,7 @@
 				 * should reset with "Mandatory Error" (see
 				 * 5.8.2)
 				 */
-				DCCP_SKB_CB(skb)->dccpd_reset_code = DCCP_RESET_CODE_MANDATORY_ERROR;
-				LIMIT_NETDEBUG(dccp_pr_debug("mandatory option not recognized!\n"));
-				DCCP_INC_STATS_BH(DCCP_MIB_OPTMANDATORYERROR);
-				rc = -1; /* Caller will do the reset for us */
-				goto out;
+				goto unknown_mandatory_option;
 			}
 
 			/*
@@ -309,6 +313,14 @@
 	}
 out:
 	return rc;
+
+unknown_mandatory_option:
+	DCCP_SKB_CB(skb)->dccpd_reset_code = DCCP_RESET_CODE_MANDATORY_ERROR;
+	LIMIT_NETDEBUG(printk(KERN_ERR "%s: mandatory option not "
+		       "recognized or with invalid format!\n", __FUNCTION__));
+	DCCP_INC_STATS_BH(DCCP_MIB_OPTMANDATORYERROR);
+	rc = -1; /* Caller will do the reset for us */
+	goto out;
 }
 
 static inline int dccp_ndp_len(const int ndp)
