Closed
Bug 1173334
Opened 9 years ago
Closed 9 years ago
NFC requires SOCK_SEQPACKET for connections to nfcd
Categories
(Firefox OS Graveyard :: NFC, defect)
Tracking
(firefox41 fixed)
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: tzimmermann, Assigned: tzimmermann)
References
Details
Attachments
(2 files)
NFC expects messages from nfcd to be complete and transmitted one-by-one. Otherwise it will fail with an assertion. [1]
But the current code uses SOCK_STREAM as its socket type. [2] It transfers data in arbitrary chunks. We should change the type to SOCK_SEQPACKET, which provides sequential transfers of individual messages. The Linux kernel will guarantee these properties.
[1] https://dxr.mozilla.org/mozilla-central/source/dom/nfc/gonk/NfcService.cpp#279
[2] https://dxr.mozilla.org/mozilla-central/source/ipc/nfc/NfcConnector.cpp#26
[3] http://linux.die.net/man/2/socket
Assignee | ||
Comment 1•9 years ago
|
||
Hi Dimi, Yoshi,
I'd provide patches for this bug. But since the change has to be done in Gecko and nfcd, landing them will need a bit of coordination and probably break compatibility with older versions of either program.
Just wanted to ask for your feedback first. How stable and forward compatible is the NFC protocol?
Flags: needinfo?(dlee)
Flags: needinfo?(allstars.chh)
Assignee | ||
Updated•9 years ago
|
Summary: NFC requires SOCK_SEQPACKET for connection to nfcd → NFC requires SOCK_SEQPACKET for connections to nfcd
Comment 2•9 years ago
|
||
Hi Thomas
Since we keep refining NFC architecture both in gecko and nfcd part, we don't guarantee that nfcd and gecko could work fine if there version are not match.For now we ask QA to do full flash when test NFC.
So in my opinion it should be fine to land patches break compatibility with older versions for now.
Flags: needinfo?(dlee)
go for it,
but I'd suggest that we do this after work week so we can focus on fixing bugs if any.
Flags: needinfo?(allstars.chh)
Assignee | ||
Comment 4•9 years ago
|
||
Thanks for the infos. Taking this bug...
Assignee: nobody → tzimmermann
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•9 years ago
|
||
SOCK_STREAM is still the default for compatibility with the current Gecko. The option 'S' (as in sequential) enables SOCK_SEQPACKET.
Attachment #8620853 -
Flags: review?(dlee)
Assignee | ||
Comment 6•9 years ago
|
||
Passing '-S' to nfcd enables SOCK_SEQPACKET on the nfcd side.
Attachment #8620854 -
Flags: review?(allstars.chh)
Assignee | ||
Comment 7•9 years ago
|
||
(In reply to Yoshi Huang[:allstars.chh] from comment #3)
> go for it,
> but I'd suggest that we do this after work week so we can focus on fixing
> bugs if any.
I'd ask to land this before Whistler because I'll be on PTO afterwards. But the patches are so trivial that I don't expect much problems.
Nfcd supports both socket types and is controlled by Gecko. So I'd suggest to land the nfcd side this week and Gecko's side next week. During the extra week, people will pick-up the nfcd changes and won't notice when Gecko switches.
Updated•9 years ago
|
Attachment #8620853 -
Flags: review?(dlee) → review+
Attachment #8620854 -
Flags: review?(allstars.chh) → review+
Assignee | ||
Comment 8•9 years ago
|
||
Thanks! I merged the nfcd pull request. Gecko can follow in a few days when people have pulled the nfcd changes.
please send notice to dev-b2g/dev-gaia, otherwise NFC might be broken after OTA.
Assignee | ||
Comment 10•9 years ago
|
||
Done.
Assignee | ||
Comment 11•9 years ago
|
||
Comment 12•9 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•