Bug 1173334: Open nfcd connections with socket type SOCK_SEQPACKET, allstars.chh

NFC requires sequential transfer of individual messages. Using the
socket type SOCK_SEQPACKET guarantees these properties.
This commit is contained in:
Thomas Zimmermann 2015-06-25 08:29:04 -07:00
parent 0ea3d9527b
commit c9da785375
2 changed files with 2 additions and 2 deletions

View File

@ -453,7 +453,7 @@ NfcService::OnConnectSuccess(int aIndex)
switch (aIndex) {
case LISTEN_SOCKET: {
nsCString value("nfcd:-a ");
nsCString value("nfcd:-S -a ");
value.Append(mListenSocketName);
if (NS_WARN_IF(property_set("ctl.start", value.get()) < 0)) {
OnConnectError(STREAM_SOCKET);

View File

@ -23,7 +23,7 @@ NfcConnector::~NfcConnector()
nsresult
NfcConnector::CreateSocket(int& aFd) const
{
aFd = socket(AF_LOCAL, SOCK_STREAM, 0);
aFd = socket(AF_LOCAL, SOCK_SEQPACKET, 0);
if (aFd < 0) {
NS_WARNING("Could not open NFC socket!");
return NS_ERROR_FAILURE;