Skip to content

Enterprise network informations device posture#300

Merged
lissyx merged 2 commits intoenterprise-mainfrom
enterprise-network_informations_device_posture
Jan 23, 2026
Merged

Enterprise network informations device posture#300
lissyx merged 2 commits intoenterprise-mainfrom
enterprise-network_informations_device_posture

Conversation

@lissyx
Copy link
Copy Markdown
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
Comment thread browser/components/enterprise/modules/ConsoleClient.sys.mjs Outdated
@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
Copy link
Copy Markdown
Contributor

@gcp gcp left a comment

Choose a reason for hiding this comment

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

Do we want a Necko peer to at least briefly look at this?

Comment thread browser/components/enterprise/modules/ConsoleClient.sys.mjs Outdated
Comment thread netwerk/system/linux/nsNetworkLinkService.cpp Outdated
Comment thread netwerk/base/nsNetworkInterface.cpp Outdated
Comment thread netwerk/base/nsNetworkInterface.h Outdated
Comment thread netwerk/base/nsNetworkInterface.h Outdated
Comment thread netwerk/system/win32/nsNotifyAddrListener.cpp Outdated
@lissyx
Copy link
Copy Markdown
Contributor Author

lissyx commented Jan 9, 2026

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

@valenting
Copy link
Copy Markdown
Contributor

Looks good generally. My main question is whether we need to guard the new code on MOZ_ENTERPRISE ?

@lissyx
Copy link
Copy Markdown
Contributor Author

lissyx commented Jan 12, 2026

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

@valenting
Copy link
Copy Markdown
Contributor

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.
I would suggest the added capabilities and tests run in all Firefox flavors, even if nsINetworkLinkService.networkInterfaces is only used in enterprise builds.

@lissyx
Copy link
Copy Markdown
Contributor Author

lissyx commented Jan 12, 2026

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. I would suggest the added capabilities and tests run in all Firefox flavors, even if nsINetworkLinkService.networkInterfaces is only used in enterprise builds.

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?

@valenting
Copy link
Copy Markdown
Contributor

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.

Comment thread testing/enterprise/test_felt_device_posture.py Outdated

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

Choose a reason for hiding this comment

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


#if defined(MOZ_ENTERPRISE)
// Skip non up interfaces as well as loopback
networkInterfaces.AppendElement(NetworkInterface(adapter));
Copy link
Copy Markdown
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 +1049
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
Copy Markdown
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

Comment thread netwerk/system/mac/nsNetworkLinkService.mm
Comment thread taskcluster/config.yml
Comment thread netwerk/base/nsNetworkInterface.cpp Outdated
Comment thread netwerk/system/mac/nsNetworkLinkService.mm
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