wow, why does everything presume ethernet? Re: skb->mac.raw, when is does it point to ethhdr

Henrik Nordstrom hno at marasystems.com
Sun May 1 22:54:04 CEST 2005


On Fri, 29 Apr 2005, Amin Azez wrote:

> However, to get at a source mac address is still uncertain, maybe I need to 
> dispatch to a different routine or different offsets based on input_dev->type 
> ?

You need to know each and every link layer you need to support.

The link layer part of the packet isn't supposed to be accessed outside of 
the link layer, so this isn't made easy.

> Does anyone know without looking how "ifconfig" works out how to format the 
> mac address?

If I am not wrong it simply hexdumps it with : between the octets. Length 
is known. But there may be special cases for some link layers.. see the 
source to make be sure. iproute just hext dumps it with :.

Regards
Henrik



More information about the netfilter-devel mailing list