[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: get MAC address from userspace program

Kamil Andrusz schrob:
> Martin Schmachtel <schmadde_(_at_)_syscall_(_dot_)_de>:
> > I need to find out the MAC address of a given ethernet interface from
> > a userspace program. I cannot, however, find out how to get this data.

> Maybe this diff will help:
> http://mniam.net/soft/ifconfig.diff

Thanks, sockaddr_dl and the LLADDR macro was exactly what I was looking
for. Works like a charm. Thanks to the others as well (yes, I was using
getifaddrs already).