# HG changeset patch # User Sebastien Decugis # Date 1370913532 -28800 # Node ID 60e7b02a3ce7ba99c76e667ea21c24af8b3d67ed # Parent 6a1042d8075bdd2674669df49ab2c784213b9067 Allow Vendor-Specific-Application-Id with several Vendor-Id AVPs as seen on some equipments diff -r 6a1042d8075b -r 60e7b02a3ce7 contrib/debian/changelog --- 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. diff -r 6a1042d8075b -r 60e7b02a3ce7 libfdcore/dict_base_proto.c --- 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 } }; diff -r 6a1042d8075b -r 60e7b02a3ce7 libfdcore/p_ce.c --- 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 */