Bug #4761
closed"Operation not permitted" error if UDP multicast is enabled
Added by Ju Pan about 6 years ago. Updated almost 6 years ago.
100%
Description
After enabling UDP multicast in nfd-wrapper.cpp, I got following error:
10-23 13:57:01.498 3927-3976/net.named_data.nfd.service.NfdService A/nfd.NfdWrapper: Cannot bind multicast rx socket to wlan0: Operation not permitted
SO_BINDTODEVICE need root privilege, but Android doesn't allow application in user space to enter root.
Updated by Junxiao Shi about 6 years ago
- Project changed from NFD to NFD-android
- Subject changed from NFD-Android's NFD daemon cannot start if enable multicast to NFD daemon cannot start if enable multicast
- Category changed from Faces to jni
- Start date deleted (
10/23/2018)
Updated by Junxiao Shi about 6 years ago
- Subject changed from NFD daemon cannot start if enable multicast to NFD daemon cannot start if enable UDP multicast
- Description updated (diff)
Android doesn't allow application in user space to enter root
Root your device, yo!
Updated by Alex Afanasyev about 6 years ago
Junxiao, please avoid such comments. You're in a public space, so please be professional.
Updated by Davide Pesavento about 6 years ago
- Subject changed from NFD daemon cannot start if enable UDP multicast to NFD daemon cannot start if UDP multicast is enabled
Updated by Davide Pesavento about 6 years ago
- Subject changed from NFD daemon cannot start if UDP multicast is enabled to "Operation not permitted" error if UDP multicast is enabled
Updated by Ju Pan about 6 years ago
- Assignee set to Ju Pan
- Start date set to 11/02/2018
- Estimated time set to 10.00 h
Updated by Ju Pan about 6 years ago
I've read some documents and discussion online, it's been said that "Modern smart phones are equipped with multiple network interfaces such as Wi-Fi, cellular radio, Bluetooth, NFC, and others. Each of these interfaces could potentially be used to connect to the web. However, mobile platforms such as Android and iOS allow only one interface to be operational at any given time."
According to this, bindToDevice maybe not necessary for Android. So, I simply commented bindToDevice function out to test, and NFD-android now can automatically create udp v4 and v6 multicast faces when boot up. But I can't create a route using that v4 multicast face since NFD-android only support creating route by URI (on laptop we can create route by face id), but NFD does not allow creating udp multicast faces.
So, if I am on the correct track, next I may modify the NFD-android to support creating route by face id. Any comments? Thx.
Updated by Davide Pesavento about 6 years ago
Ju Pan wrote:
I've read some documents and discussion online, it's been said that "Modern smart phones are equipped with multiple network interfaces such as Wi-Fi, cellular radio, Bluetooth, NFC, and others. Each of these interfaces could potentially be used to connect to the web. However, mobile platforms such as Android and iOS allow only one interface to be operational at any given time."
Well... what does "operational" mean? I think it simply means that the IP routing table on the device is setup in such a way that all outgoing traffic goes over the "best" interface at any given time (where "best" usually means WiFi is preferred to cellular). However the problem we have is with incoming traffic, not outgoing.
In any case, this discussion is moot because in virtually all cases we have exactly one interface where using a multicast face makes sense, and that is the (only) WiFi interface.
According to this, bindToDevice maybe not necessary for Android. So, I simply commented bindToDevice function out to test, and NFD-android now can automatically create udp v4 and v6 multicast faces when boot up. But I can't create a route using that v4 multicast face since NFD-android only support creating route by URI (on laptop we can create route by face id), but NFD does not allow creating udp multicast faces.
We've known for a while that this was a potential workaround. Please do submit a patch.
So, if I am on the correct track, next I may modify the NFD-android to support creating route by face id. Any comments? Thx.
Updated by Davide Pesavento about 6 years ago
- Status changed from New to Code review
Updated by Ju Pan about 6 years ago
- Status changed from Code review to Closed
- % Done changed from 80 to 100
Updated by Alex Afanasyev about 6 years ago
- Status changed from Closed to In Progress
I wouldn't close is yet. This needs to have a corresponding update in NFD-android that actually enables multicast faces.
Updated by Davide Pesavento almost 6 years ago
- Status changed from In Progress to Code review
Updated by Davide Pesavento almost 6 years ago
- Status changed from Code review to Closed
- % Done changed from 80 to 100
All done now.