changeset 1191:60e7b02a3ce7

Allow Vendor-Specific-Application-Id with several Vendor-Id AVPs as seen on some equipments
author Sebastien Decugis <sdecugis@freediameter.net>
date Tue, 11 Jun 2013 09:18:52 +0800
parents 6a1042d8075b
children 48759e3f7611
files contrib/debian/changelog libfdcore/dict_base_proto.c libfdcore/p_ce.c
diffstat 3 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/debian/changelog	Mon Jun 10 16:44:18 2013 +0800
+++ b/contrib/debian/changelog	Tue Jun 11 09:18:52 2013 +0800
@@ -13,7 +13,8 @@
   * API changes: all the fd_*_dump functions now return malloc'd strings instead of logging directly.
   * Updated dbg_monitoring extension to use the new API
   * New script to generate dictionary extensions from org file (see contrib/tools)
-  * New compilation option: WORKAROUND_ACCEPT_INVALID_VSAI to improve interoperability.
+  * New compilation option: WORKAROUND_ACCEPT_INVALID_VSAI to improve compatibility
+    with invalid Vendor-Specific-Application-Id AVPs received from some equipments (e.g. Cisco).
   * New compilation option: DISABLE_PEER_EXPIRY for use in test environments.
   * Extensions are now also searched in LD_LIBRARY_PATH.
   * Copy Proxy-Info AVP automatically in new answers.
--- a/libfdcore/dict_base_proto.c	Mon Jun 10 16:44:18 2013 +0800
+++ b/libfdcore/dict_base_proto.c	Tue Jun 11 09:18:52 2013 +0800
@@ -890,7 +890,14 @@
 					};
 					
 			struct local_rules_definition rules[] = 
-						{ 	 {  "Vendor-Id", 			RULE_REQUIRED, -1, 1 }
+						{
+#ifndef WORKAROUND_ACCEPT_INVALID_VSAI
+							/* ABNF from RFC6733 */
+						 	 {  "Vendor-Id", 			RULE_REQUIRED, -1, 1 }
+#else /* WORKAROUND_ACCEPT_INVALID_VSAI */
+							/* ABNF from RFC3588 (including erratum, because original text is nonsense) */
+						 	 {  "Vendor-Id", 			RULE_REQUIRED, -1, -1}
+#endif /* WORKAROUND_ACCEPT_INVALID_VSAI */
 							,{  "Auth-Application-Id",		RULE_OPTIONAL, -1, 1 }
 							,{  "Acct-Application-Id",		RULE_OPTIONAL, -1, 1 }
 						};
--- a/libfdcore/p_ce.c	Mon Jun 10 16:44:18 2013 +0800
+++ b/libfdcore/p_ce.c	Tue Jun 11 09:18:52 2013 +0800
@@ -469,8 +469,10 @@
 						}
 						switch (inhdr->avp_code) {
 							case AC_VENDOR_ID: /* Vendor-Id */
+#ifndef WORKAROUND_ACCEPT_INVALID_VSAI
 								if (vid != 0)
-									invalid++; /* We already had one such AVP */
+									invalid++; /* We already had one such AVP. This is invalid according to RFC6733 but not RFC3588 (but there is an erratum) */
+#endif /* WORKAROUND_ACCEPT_INVALID_VSAI */
 								vid = inhdr->avp_value->u32;
 								break;
 							case AC_AUTH_APPLICATION_ID: /* Auth-Application-Id */
"Welcome to our mercurial repository"