Function to analyze: NetlinkService::CalculateNetworkID() in netwerk/system/netlink/NetlinkService.cpp.
Or, even better, it's based on CalculateIDForFamily.
It uses some combination of gateway, MAC addresses and in general of routes.
There are even some functions for non-Ethernet links.
Now I'm really curious on what this is used for.
telemetry in DoH (more or less "anonymized" with an additional seed)
So, I think returning an empty string for these cases should be safe (the nasty API returns undefined in case).
I should audit a little bit more, but at the moment I've thought of this strategy: a pair of implementations already have a seed as local-rubbish.
We could change it to be a random ID regenerated at every browser start: we'll keep everything working, but it could help if we missed any leak of the internal mNetworkId member.
We could use nsID, for example (it is fallible, but we could avoid computing an ID or refuse to save the computed one, if the seed creation failed).
I would appreciate some documentation on its need.
I think Mozilla itself should randomize the ID in the way I proposed, or explicitly write why they don't want to.