-
Notifications
You must be signed in to change notification settings - Fork 10
Enterprise network informations device posture #300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: enterprise-main
Are you sure you want to change the base?
Enterprise network informations device posture #300
Conversation
f72fa07 to
54e0723
Compare
54e0723 to
9e16467
Compare
9e16467 to
eded123
Compare
fdba88a to
2fea1cb
Compare
d22d50e to
6841b7c
Compare
|
|
||
| nsTArray<NetworkInterface> networkInterfaces; | ||
| for (const auto& linkInfo : mLinks.Values()) { | ||
| if (linkInfo->mIsUp) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://searchfox.org/firefox-main/rev/5917a9f2af3294b27a325371c5c499e7dd9554fd/netwerk/system/netlink/NetlinkService.cpp#258-261 so we dont report loopback on linux @gcp
6841b7c to
ba8a011
Compare
|
|
||
| #if defined(MOZ_ENTERPRISE) | ||
| // Skip non up interfaces as well as loopback | ||
| networkInterfaces.AppendElement(NetworkInterface(adapter)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gcp this allows up to skip interfaces that are:
- not up or not running
- loopback
- or dont report as active on the media level
ba8a011 to
5a251f4
Compare
0e8e673 to
b8b552c
Compare
b8b552c to
6e78d7b
Compare
No description provided.