Skip to content

Conversation

@lissyx
Copy link
Contributor

@lissyx lissyx commented Dec 19, 2025

No description provided.

@lissyx lissyx requested a review from gcp December 19, 2025 13:08
@lissyx lissyx self-assigned this Dec 19, 2025
@lissyx lissyx requested a review from a team December 19, 2025 13:08
@lissyx lissyx force-pushed the enterprise-network_informations_device_posture branch from f72fa07 to 54e0723 Compare December 19, 2025 13:16
@gcp gcp requested a review from a team December 19, 2025 13:37
@lissyx lissyx force-pushed the enterprise-network_informations_device_posture branch from 54e0723 to 9e16467 Compare December 19, 2025 14:24
@lissyx lissyx force-pushed the enterprise-network_informations_device_posture branch from 9e16467 to eded123 Compare December 19, 2025 14:29
@lissyx lissyx force-pushed the enterprise-network_informations_device_posture branch from fdba88a to 2fea1cb Compare January 12, 2026 16:15
@lissyx lissyx force-pushed the enterprise-network_informations_device_posture branch 4 times, most recently from d22d50e to 6841b7c Compare January 13, 2026 17:57

nsTArray<NetworkInterface> networkInterfaces;
for (const auto& linkInfo : mLinks.Values()) {
if (linkInfo->mIsUp) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lissyx lissyx force-pushed the enterprise-network_informations_device_posture branch from 6841b7c to ba8a011 Compare January 14, 2026 15:19

#if defined(MOZ_ENTERPRISE)
// Skip non up interfaces as well as loopback
networkInterfaces.AppendElement(NetworkInterface(adapter));
Copy link
Contributor Author

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

Comment on lines 1020 to 1052
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;
}
Copy link
Contributor Author

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

@lissyx lissyx force-pushed the enterprise-network_informations_device_posture branch 2 times, most recently from 0e8e673 to b8b552c Compare January 15, 2026 10:55
@lissyx lissyx force-pushed the enterprise-network_informations_device_posture branch from b8b552c to 6e78d7b Compare January 16, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants