Skip to content

Emulate Linux network identity probes#181

Merged
jserv merged 1 commit into
sysprog21:mainfrom
Max042004:fix-flexlm-hostid
Jul 9, 2026
Merged

Emulate Linux network identity probes#181
jserv merged 1 commit into
sysprog21:mainfrom
Max042004:fix-flexlm-hostid

Conversation

@Max042004

@Max042004 Max042004 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a host-backed network identity helper for Linux-style interface probes.
  • Implement SIOCGIFHWADDR for socket fds using the Linux ifreq layout.
  • Synthesize /proc/net/dev with loopback and eth0 rows backed by host data.
  • Extend test-netstat coverage for /proc/net/dev and SIOCGIFHWADDR.

Notes

  • eth0 maps to the primary macOS link interface, preferring en0 when available.
  • A locally administered fallback MAC is used only when no host MAC is available.
  • times(2) is intentionally left to PR Implement times(2) syscall #162.

Validation

  • make elfuse
  • make build/test-netstat build/test-net build/test-netlink && tests/driver.sh -e build/elfuse -d build -v test-net test-netstat test-netlink
  • build/elfuse build/test-netstat
  • clang-format --dry-run --Werror src/syscall/net-identity.c src/syscall/net-identity.h src/runtime/procemu.c src/syscall/io.c src/syscall/abi.h tests/test-netstat.c
  • git diff --check
  • make check-syscall-coverage

Fixes #163.


Summary by cubic

Emulates Linux network identity probes so guests can read MAC addresses and interface stats. Adds SIOCGIFHWADDR and a host-backed /proc/net/dev to unblock FlexLM-style license checks.

  • New Features
    • Implemented Linux SIOCGIFHWADDR for socket fds using the Linux ifreq layout; returns loopback/Ethernet families, maps eth0 to the primary macOS link (prefers en0), and uses a locally administered fallback MAC only if no host MAC is available.
    • Synthesized /proc/net/dev with a Linux-style header plus lo and eth0 rows backed by host counters; /proc/net now lists dev. Tests cover /proc/net/dev rows and SIOCGIFHWADDR family/MAC checks.

Written for commit c401775. Summary will update on new commits.

Review in cubic

@Max042004 Max042004 changed the title [codex] Emulate Linux network identity probes Emulate Linux network identity probes Jul 9, 2026
@Max042004 Max042004 marked this pull request as ready for review July 9, 2026 06:17

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 7 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread tests/test-netstat.c Outdated
Comment thread src/syscall/net-identity.c Outdated
@Max042004 Max042004 force-pushed the fix-flexlm-hostid branch from 4fcbad0 to 9c8d251 Compare July 9, 2026 06:22
FlexLM license checks query Linux network identity through
SIOCGIFHWADDR and /proc/net/dev. Those probes previously fell
through to Darwin ioctl handling or missing procfs entries, so
guest programs could fail before reading the license file.

Add a host-backed helper that maps eth0 to the primary macOS
link interface, exposes loopback identity, and fills /proc/net/dev
with host interface counters. Keep a locally administered fallback
only when no usable host MAC address is available.
@Max042004 Max042004 force-pushed the fix-flexlm-hostid branch from 9c8d251 to c401775 Compare July 9, 2026 06:34
@jserv jserv merged commit 2f539c8 into sysprog21:main Jul 9, 2026
9 checks passed
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.

Quartus/FlexLM hostid probe crashes without Linux network identity emulation

2 participants