Closed Bug 1561273 Opened 5 years ago Closed 5 years ago

network ID: ipv4NetworkId/scanArp returns gateway IP instead of its MAC

Categories

(Core :: Networking, defect, P2)

Unspecified
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: valentin, Assigned: michal)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

Logs captured by :kershaw indicate that we're hashing the gateway's IP address, instead of its MAC address, as expected.
This would make the networkID less reliable on OSX.

2019-06-25 11:15:25.487407 UTC - [Parent 56682: Main Thread]: D/nsNotifyAddr SendEvent: network is 'up'
2019-06-25 11:15:25.489587 UTC - [Parent 56682: Main Thread]: D/nsNotifyAddr networkid: MAC 10.238.24.1
2019-06-25 11:15:25.489679 UTC - [Parent 56682: Main Thread]: D/nsNotifyAddr networkid: id W1r6MYcMw3rjymDpBKgPhlt8T78=
Priority: -- → P2
Whiteboard: [necko-triaged]
Blocks: 1567627
Assignee: nobody → michal.novotny

This patch fixes a bug in ipv4NetworkId where we wrongly hashed IP address instead of MAC address. It also simplifies getMac function. MAC address must be 6 bytes long. If it's not it's probably an error and we must not use it.

Kershaw, could you please check the patch locally? I don't have access to OSX machine. Thanks!

Flags: needinfo?(kershaw)

(In reply to Michal Novotny [:michal] from comment #2)

Kershaw, could you please check the patch locally? I don't have access to OSX machine. Thanks!

Please see the log below.
[Parent 74183: Main Thread]: D/nsNotifyAddr SendEvent: network is 'up'
[Parent 74183: StreamTrans #4]: D/nsNotifyAddr networkid: MAC 00:59:dc:a2:ee:60
[Parent 74183: StreamTrans #4]: D/nsNotifyAddr networkid: id wCpqhdFbxEXd1DH1Sd+ZdbLoAp0=

[Parent 74183: StreamTrans #5]: D/nsNotifyAddr networkid: MAC 00:59:dc:a2:ee:51
[Parent 74183: StreamTrans #5]: D/nsNotifyAddr networkid: id uVRU2aEipWfyBBMA4TE5vOa7Y44=

It looks like the patch works fine.
But I noticed that sometimes when I switch between two different wifi APs, the ReachabilityChanged is not called, only IPConfigChanged gets called. Maybe we should also calculate network id also in IPConfigChanged?

Flags: needinfo?(kershaw)

(In reply to Kershaw Chang [:kershaw] from comment #3)

It looks like the patch works fine.
But I noticed that sometimes when I switch between two different wifi APs, the ReachabilityChanged is not called, only IPConfigChanged gets called. Maybe we should also calculate network id also in IPConfigChanged?

Thanks. Agree, I'll file a new bug for it.

Pushed by mnovotny@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/195dd039e83c
network ID: ipv4NetworkId/scanArp returns gateway IP instead of its MAC, r=kershaw
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: