Closed Bug 1586774 Opened 5 years ago Closed 5 years ago

network ID: split NetlinkService::CalculateIDForFamily() into multiple methods

Categories

(Core :: Networking, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: michal, Assigned: sonakshisaxena1)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

NetlinkService::CalculateIDForFamily() is very long and hard to read. It should be split into multiple methods.

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

NetlinkService::CalculateIDForFamily() is very long and hard to read. It should be split into multiple methods.

Hey [:michal]
Can I take this up?

Thanks!

sure

Hey [:michal]

The following is my approach to this bug -

I made 3 new methods which offload the work that NetlinkService::CalculateIDForFamily() was doing.
1.GetGWNeighboursForFamily()
2.CalculateIDForEthernetLink()
3.CalculateIDForNonEthernetLink()

In CalculateIDForFamily(), we were getting an array of gateway neighbours for a particular address family, for which we know the MAC address. I off-loaded that part to GetGWNeighboursForFamily() method.

Then later on in CalculateIDForFamily(), depending on whether the traffic is routed through Ethernet or non-Ethernet device, we were calculating the NetworkID. So I moved those parts to CalculateIDForEthernetLink() and CalculateIDForNonEthernetLink().

I'm putting up a patch for this. Kindly review it.
Thanks!

Assignee: nobody → sonakshisaxena1
Status: NEW → ASSIGNED

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

sure

Hey Michal!
I have put up a patch for this. Can you please review it?
Thanks! :)

Pushed by mnovotny@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/938010c3886c network ID: split NetlinkService::CalculateIDForFamily() into multiple methods r=michal
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: