Re: interface information for recvd packet
From: Viral Mehta <hidden>
Date: 2011-09-01 19:40:13
On Tue, Aug 30, 2011 at 11:55 AM, Viral Mehta [off-list ref] wrote:
Hi, I was trying to implement following thing, 1. I wanted to know whenever packet received for particular socket, I want to know which network interface actually received it ?
My objective is still the same..
2. I was looking at net/ipv4/tcp.c and in function tcp_recvmsg(); I am trying to get interface name by accessing sk_buff->dev->name
I tried printing address of SKBs, but it gives different address in NIC driver and tcp.c My understanding is, struct sk_buff* remains same through out all layers i.e., NIC driver allocates it after receving frame and same is passed till TCP layer. But, apparently looks I am wrong from the prints that I have put. Can someone shed some light ?
However, it gives me (null). I have made sure that in my ethernet (NIC) driver, I filled up that information before doing netif_rx(). So, the question is, Is this information Trimmed out at some upper layer ??
-- Thanks, Viral Mehta