🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: muc.lists.freebsd.bugs
2 messages
2 total messages Started by bugzilla-noreply Tue, 20 Oct 2026 13:29
[Bug 299638] Linuxulator: SIOCGIFHWADDR returns original MAC instead of current interface MAC
#162
Author: bugzilla-noreply
Date: Tue, 20 Oct 2026 13:29
105 lines
6340 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299638

            Bug ID: 299638
           Summary: Linuxulator: SIOCGIFHWADDR returns original MAC
                    instead of current interface MAC
           Product: Base System
           Version: CURRENT
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: david@remdrivet.se

Created attachment 276001
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=276001&action=edit
Fix Linuxulator’s SIOCGIFHWADDR to return the interface’s current MAC address

I ran into this while trying to activate a licensed Linux application (DaVinci
Resolve Studio) in a Rocky Linux 9.8 VNET jail on FreeBSD. The application
started, but I couldn't get the license activation to work.

While investigating, I found that Linux SIOCGIFHWADDR and
/sys/class/net/eth0/address reported different MAC addresses for the same
interface. The ioctl returned the original hardware address, while sysf
returned the currently configured address.
Comparing these with native FreeBSD ifconfig confirmed that the ioctl matched
"hwaddr" and sysfs matched "ether". The interface was an epair with a
configured MAC that differed from its original address.

I had to patch sys/compat/linux/linux_ioctl.c to make SIOCGIFHWADDR return the
current address. In linux_ioctl_socket_ifreq(), it currently goes through
FreeBSD's SIOCGHWADDR, which returns the original address.

The attached patch uses the existing linux_ifhwaddr() helper instead, as
linsysfs already does, with NET_EPOCH protection. It also lets the helper
report the loopback hardware type rather than treating it as Ethernet.

After building and loading the patched linux64 module, the ioctl and sysfs
results matched, and the application's license activation succeeded.

I have since been able to restart the application and jail and use the
application. I haven't traced the licensing internals, so I can't say exactly
how it uses these addresses, but the inconsistent ioctl result seems like a
Linux compatibility bug on its own.

Tested on FreeBSD 16.0-CURRENT amd64, main-n290191-02971f200083. The linux64
module built successfully with the kernel's -Werror flags. Any broader
regression testing have not yet been done.

To reproduce the address mismatch independently of the application, use a Linux
VNET jail with an Ethernet interface named eth0 whose configured MAC differs
from its original hardware address. Compare Linux SIOCGIFHWADDR with
/sys/class/net/eth0/address, and compare both with native FreeBSD ifconfig's
ether/hwaddr fields. I expect the Linux ioctl to return the current address,
matching sysfs.
Before the patch it returned the original address; after the patch they
matched.

There were also two network setup details along the way. With the jail's
original interface name, aaadx_net1b, Linux SIOCGIFADDR failed with EINVAL;
using eth0 made that query work.
The jail's lo0 was initially down and had no IPv4 address, so I also brought it
up with 127.0.0.1/8. After that, address queries worked for eth0 and for both
lo/lo0. Activation still failed until the MAC-address patch was applied.

The working setup therefore uses eth0 and a configured loopback, but I haven't
established that the licensing code requires those exact names. Perhaps it's
hardcoded to make sure it's a Linux system?
The interface-name lookup issue and missing loopback configuration are separate
from the hardware-address ioctl bug addressed by this patch.
The patch doesn't change the interface MAC or any application/license files.

I hope someone are interested in addressing this and for it to be solved to
further the awesome linuxlator compatibility rather than having to manually
patch this in the future.

Note:
Testing, investigating and experimenting with the patch was done with the help
of an llm, so someone who knows the source should have a look and perhaps make
a more elegant solution.

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
[Bug 299638] Linuxulator: SIOCGIFHWADDR returns original MAC instead of current interface MAC
#172
Author: bugzilla-noreply
Date: Tue, 20 Oct 2026 20:58
16 lines
2633 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299638

Mark Linimon <linimon@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|bugs@FreeBSD.org            |emulation@FreeBSD.org

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads