Enterprise network informations device posture#300
Conversation
f72fa07 to
54e0723
Compare
54e0723 to
9e16467
Compare
9e16467 to
eded123
Compare
gcp
left a comment
There was a problem hiding this comment.
Do we want a Necko peer to at least briefly look at this?
Likely, that was my plan before the holidays, but I wanted to clean things first |
c3f3444 to
df9ef7e
Compare
|
Looks good generally. My main question is whether we need to guard the new code on MOZ_ENTERPRISE ? |
In the light that we plan to merge this back to mozilla-central as soon as feasible, I think we want |
My main concern with guarding new code by MOZ_ENTERPRISE is that if there's a bug in the MOZ_ENTERPRISE code, we might not see it in regular build. So thread safety and logic bugs might be missed by CI runs. |
We have testing https://treeherder.mozilla.org/jobs?repo=enterprise-firefox and I'm making progress so that classic test suites are running as well. Do you think it's not enough? |
It seems to me that enterprise specific features can be tested on the enterprise branch, but general platform implementations should run and be tested under all branches. That would make me feel more confident that enterprise specific code isn't introducing issues that are difficult to reproduce. |
|
|
||
| nsTArray<NetworkInterface> networkInterfaces; | ||
| for (const auto& linkInfo : mLinks.Values()) { | ||
| if (linkInfo->mIsUp) { |
There was a problem hiding this comment.
https://searchfox.org/firefox-main/rev/5917a9f2af3294b27a325371c5c499e7dd9554fd/netwerk/system/netlink/NetlinkService.cpp#258-261 so we dont report loopback on linux @gcp
|
|
||
| #if defined(MOZ_ENTERPRISE) | ||
| // Skip non up interfaces as well as loopback | ||
| networkInterfaces.AppendElement(NetworkInterface(adapter)); |
There was a problem hiding this comment.
@gcp moved this so we skip loopback interfaces
| if (!(ifa->ifa_flags & IFF_UP)) { | ||
| continue; | ||
| } | ||
|
|
||
| if (ifa->ifa_flags & IFF_LOOPBACK) { | ||
| continue; | ||
| } | ||
|
|
||
| if (!(ifa->ifa_flags & IFF_RUNNING)) { | ||
| continue; | ||
| } | ||
|
|
||
| int s = socket(ifa->ifa_addr->sa_family == AF_LINK ? AF_INET : ifa->ifa_addr->sa_family, SOCK_DGRAM, 0); | ||
| if (s < 0) { | ||
| continue; | ||
| } | ||
|
|
||
| struct ifmediareq ifmr; | ||
| memset(&ifmr, 0, sizeof(ifmr)); | ||
| strlcpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name)); | ||
|
|
||
| if (ioctl(s, SIOCGIFXMEDIA, (caddr_t)&ifmr) < 0) { | ||
| close(s); | ||
| continue; | ||
| } | ||
|
|
||
| if (!(ifmr.ifm_status & IFM_ACTIVE)) { | ||
| close(s); | ||
| continue; | ||
| } |
There was a problem hiding this comment.
@gcp this allows up to skip interfaces that are:
- not up or not running
- loopback
- or dont report as active on the media level
No description provided.