Unique machine identifier for nfsv4 client

Rick Macklem rmacklem at uoguelph.ca
Mon Mar 30 08:04:05 PDT 2009


An nfsv4 client needs a unique identifier that is persistent across
reboots. My code currently uses the MAC address of the first net
interface that it can find that has an Ethernet style MAC.

There are two problems with this:
1 - If it can't find a net interface with a MAC, it falls back on a
     randomly generated identifier, which changes when it is rebooted.
2 - The code that finds the MAC breaks layering (ie knows stuff about
     the network code like struct ifnet) and only builds if
     "options VIMAGE_GLOBALS" is set.

Can anyone suggest a better way to do this?

If not, would it be reasonable to put a function in sys/net that returns
a MAC address if it can find one? (At least this gets around the
"options VIMAGE_GLOBALS" issue.)

Thanks in advance for any help, rick



More information about the freebsd-arch mailing list