how to get mac address info in kernel code?

h bagade bagadeh at gmail.com
Wed Mar 6 10:12:11 UTC 2013


On Tue, Mar 5, 2013 at 7:23 PM, George Neville-Neil <gnn at neville-neil.com>wrote:

>
> On Mar 5, 2013, at 08:54 , h bagade <bagadeh at gmail.com> wrote:
>
> > Hi all,
> >
> > I need to get interface MAC address within the kernel code and I couldn't
> > use "getifaddrs" because it's user-mode. How can I have the MAC address
> > information within kernel code?
> >
> > Any hints or comments are really appreciated.
>
> If you have access to the struct ifnet you can look at the if_addr member,
> which is
> a struct ifaddr, defined in if_var.h .
>
> Best,
> George
>

Thanks for your suggestion. I will make it a try.


More information about the freebsd-net mailing list