Main index | Section 9 | Options |
#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/ethernet.h>
By default, ether_gen_addr attempts to generate a stable MAC address using the hostid of the jail that the ifp is being added to. During early boot, the hostid may not be set on machines that haven't yet populated /etc/hostid, or on machines that do not use loader(8).
ether_gen_addr can fail to derive a MAC address due to memory allocation failure, or because the hostid has not been populated. In these cases, a locally-administered unicast MAC address will be randomly generated and returned via the hwaddr parameter.
If ether_gen_addr succeeds, then it will return a MAC address in the FreeBSD Foundation OUI, "58:9c:fc", via the hwaddr parameter.
ETHER_GEN_ADDR (9) | June 1, 2021 |
Main index | Section 9 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
“ | Hang in there, people suffering from natural disasters and deadly diseases - we're putting ribbons on our cars as fast as we can | ” |
— Artur Bagyants |