Closed Bug 1166170 Opened 9 years ago Closed 8 years ago

B2G NetworkManager: _addSubnetRoutes error: Invalid argument

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: swu, Unassigned)

References

Details

Attachments

(1 file)

In NetworkManager.js, the _addSubnetRoutes() returns error.  The log indicates that gateway information was not passed to addHostRouteLegacy() as expected.

Log:
========================================================================
05-19 06:48:00.480 I/Gecko   (  984): -*- NetworkService: addHostRoute: 1.2.3.4-24-null-eth1 -> undefined
05-19 06:48:00.480 E/NetworkUtils(  984): addHostRouteLegacy does not support empty gateway.
05-19 06:48:00.480 I/Gecko   (  984): -*- NetworkService: NetworkManager received message from worker: {"broadcast":false,"curExternalIfname":"","curInternalIfname":"","dns1":0,"dns1_str":"","dns2":0,"dns2_str":"","enable":false,"error":true,"flag":"down","gateway":0,"gateway_str":"","id":12,"ipAddr":"","ipaddr":0,"ipaddr_str":"","lease":0,"macAddr":"","mask":0,"mask_str":"","netId":"","reason":"Invalid argument","reply":"","result":false,"resultCode":22,"resultReason":"","ret":false,"route":"","server":0,"server_str":"","success":false,"topic":"","vendor_str":""}
05-19 06:48:00.480 I/Gecko   (  984): -*- NetworkService: dequeue id: 12
05-19 06:48:00.480 I/Gecko   (  984): -*- NetworkManager: _addSubnetRoutes error: Invalid argument
========================================================================
Edgar, could you help to review this patch?  Thanks!
Assignee: nobody → swu
Attachment #8608083 - Flags: review?(echen)
Comment on attachment 8608083 [details] [diff] [review]
Patch: Add gateway argument.

Review of attachment 8608083 [details] [diff] [review]:
-----------------------------------------------------------------

Passing no gateway to modifyRoute() is for scope link route and _addSubnetRoutes() intends to doing so.
The scope link route will only be handled automatically in main routing table. But in Lollipop, each interface has it's own routing table, we have to handle scope link route manually for interface table.
For SDK_VERSION < 20 (KK or older version), there is only main table, we don't have to worry about the scope link route.
So IMHO, what we should do is just returning success for scope link operation in KK (or older version). But it probably requires a bit refactor, because NetworkParam now assigns all attributes with a default value [1], NetworkUtils is unable to tell `the gateway is really passed as an empty string` or `caller doesn't pass gateway actually but NetworkParam assigns a default value on it`.  
Thanks you.

[1] https://dxr.mozilla.org/mozilla-central/source/dom/system/gonk/NetworkUtils.h#68-205
Attachment #8608083 - Flags: review?(echen)
The explanation is very clear, thank you!  Will make a new patch for this.
Unassign myself, as I am not able to work on this in short term.
Assignee: swu → nobody
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: