summaryrefslogtreecommitdiff
path: root/src/ndef.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2013-06-21 01:04:33 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2013-06-21 01:04:33 +0200
commit2cf6216ac51488f8b143bcc2baf69b47f937b7be (patch)
tree38d3194b3b072e21d45bec726b474a7ae4acb5fa /src/ndef.c
parent1ee012d9dd83d6abc7eefa6a07fff0e43c9196aa (diff)
downloadneard-2cf6216ac51488f8b143bcc2baf69b47f937b7be.tar.gz
neard-2cf6216ac51488f8b143bcc2baf69b47f937b7be.tar.bz2
neard-2cf6216ac51488f8b143bcc2baf69b47f937b7be.zip
ndef: Support receiving empty Handover select frames
Empty handover select frames are received when the peer notifies us about not supporting any of the carrier sent in the handover request frame. In that case there is nothing to do but disconnecting from the handover service.
Diffstat (limited to 'src/ndef.c')
-rw-r--r--src/ndef.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ndef.c b/src/ndef.c
index f86df89..641f5df 100644
--- a/src/ndef.c
+++ b/src/ndef.c
@@ -2414,6 +2414,13 @@ static struct near_ndef_ho_payload *parse_ho_payload(enum record_type rec_type,
goto fail;
}
} else if (reply != NULL) {
+ /* This is a Hs with no cfg and no Ac: No reply and fail */
+ if (rec_type == RECORD_TYPE_WKT_HANDOVER_SELECT &&
+ g_slist_length(acs) == 0) {
+ *reply = NULL;
+ goto fail;
+ }
+
/* Prepare Hs, it depends upon Hr message carrier types */
*reply = near_ndef_prepare_hs_reply(mimes, c_datas);
if (*reply == NULL) {