On Mon, Jul 01, 2013 at 05:54:49PM +0530, Varun Sharma wrote:
Hi,
can anyone briefly help me to understand which value is copy in skb through neigh_hh_output(include/net/neighbour.h) ? I print that value but that is not mac address .
I see the hh_len comes from struct hh_cache is 14 .Due to this i think mac_header bulid here .But on exploring i found that mac header build in eth_header function .Now What is value copy in skb through neigh_hh_output function ?
Hi Varun, hh_cache is, indeed, the cached layer 2 header. It contains (in the case of Ethernet) the MAC addresses and ethertype. Layer 2 headers tend to be the same for all packets in a connection, so Linux tries to cache them. I assume that the eth_header function exists for device drivers that don't support L2 header caching, but I am not sure if there are such cases. You can read more about header caching in section 27.8 of "Understanding Linux Network Internals", by Christian Benvenuti. Hope this helps, Vlad