summaryrefslogtreecommitdiffstats
path: root/src/phFriNfc_Llcp.c
diff options
context:
space:
mode:
authorSylvain Fonteneau <sylvain.fonteneau@trusted-logic.com>2011-04-04 16:45:28 +0200
committerJeff Hamilton <jham@android.com>2011-04-08 10:39:54 -0500
commit46dbed4e11700226e9b43ca17e5ad6f3d192bf63 (patch)
tree68c6a2a7db7f4754add47aff93ba2501e102ed68 /src/phFriNfc_Llcp.c
parentb7e67c8dbd4aa5892815bfed4e7ff934cf49b904 (diff)
downloadexternal_libnfc-nxp-46dbed4e11700226e9b43ca17e5ad6f3d192bf63.zip
external_libnfc-nxp-46dbed4e11700226e9b43ca17e5ad6f3d192bf63.tar.gz
external_libnfc-nxp-46dbed4e11700226e9b43ca17e5ad6f3d192bf63.tar.bz2
Ignore unreadable TLVs during LLCP activation and CONNECT/CC.
The LLCP specification defines that if a TLV cannot be interpreted, it shall be ignored rather than generating an error. This patch removed all error reporting on TLV interpretation. The only error that can still happen is length inconsistency in the whole TLV array buffer. Change-Id: Ibf289fceb2283bfddcdc0ddee9e687ece3e90887
Diffstat (limited to 'src/phFriNfc_Llcp.c')
-rw-r--r--src/phFriNfc_Llcp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/phFriNfc_Llcp.c b/src/phFriNfc_Llcp.c
index 13f1f92..ac38311 100644
--- a/src/phFriNfc_Llcp.c
+++ b/src/phFriNfc_Llcp.c
@@ -408,7 +408,7 @@ static NFCSTATUS phFriNfc_Llcp_ParseLinkParams( phNfc_sData_t
if (sValueBuffer.length != PHFRINFC_LLCP_TLV_LENGTH_VERSION)
{
/* Error : Ill-formed VERSION parameter TLV */
- return PHNFCSTVAL(CID_FRI_NFC_LLCP, NFCSTATUS_INVALID_PARAMETER);
+ break;
}
/* Get VERSION */
version = sValueBuffer.buffer[0];
@@ -420,7 +420,7 @@ static NFCSTATUS phFriNfc_Llcp_ParseLinkParams( phNfc_sData_t
if (sValueBuffer.length != PHFRINFC_LLCP_TLV_LENGTH_MIUX)
{
/* Error : Ill-formed MIUX parameter TLV */
- return PHNFCSTVAL(CID_FRI_NFC_LLCP, NFCSTATUS_INVALID_PARAMETER);
+ break;
}
/* Get MIU */
sParams.miu = PHFRINFC_LLCP_MIU_DEFAULT + ((sValueBuffer.buffer[0] << 8) | sValueBuffer.buffer[1]) & PHFRINFC_LLCP_TLV_MIUX_MASK;
@@ -432,7 +432,7 @@ static NFCSTATUS phFriNfc_Llcp_ParseLinkParams( phNfc_sData_t
if (sValueBuffer.length != PHFRINFC_LLCP_TLV_LENGTH_WKS)
{
/* Error : Ill-formed MIUX parameter TLV */
- return PHNFCSTVAL(CID_FRI_NFC_LLCP, NFCSTATUS_INVALID_PARAMETER);
+ break;
}
/* Get WKS */
sParams.wks = (sValueBuffer.buffer[0] << 8) | sValueBuffer.buffer[1];
@@ -446,7 +446,7 @@ static NFCSTATUS phFriNfc_Llcp_ParseLinkParams( phNfc_sData_t
if (sValueBuffer.length != PHFRINFC_LLCP_TLV_LENGTH_LTO)
{
/* Error : Ill-formed LTO parameter TLV */
- return PHNFCSTVAL(CID_FRI_NFC_LLCP, NFCSTATUS_INVALID_PARAMETER);
+ break;
}
/* Get LTO */
sParams.lto = sValueBuffer.buffer[0];
@@ -458,7 +458,7 @@ static NFCSTATUS phFriNfc_Llcp_ParseLinkParams( phNfc_sData_t
if (sValueBuffer.length != PHFRINFC_LLCP_TLV_LENGTH_OPT)
{
/* Error : Ill-formed OPT parameter TLV */
- return PHNFCSTVAL(CID_FRI_NFC_LLCP, NFCSTATUS_INVALID_PARAMETER);
+ break;;
}
/* Get OPT */
sParams.option = sValueBuffer.buffer[0] & PHFRINFC_LLCP_TLV_OPT_MASK;
@@ -467,7 +467,7 @@ static NFCSTATUS phFriNfc_Llcp_ParseLinkParams( phNfc_sData_t
default:
{
/* Error : Unknown Type */
- return PHNFCSTVAL(CID_FRI_NFC_LLCP, NFCSTATUS_INVALID_PARAMETER);
+ break;
}
}
}