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 ?
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
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,
--
Thanks,
Viral Mehta
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
Hi,
On Thu, Sep 1, 2011 at 3:40 PM, Viral Mehta [off-list ref] wrote:
On Tue, Aug 30, 2011 at 11:55 AM, Viral Mehta [off-list ref] wrote:
quoted
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 ?
Sorry for the noise. Also I got why nobody replied to my question :-)
Anyway, I was doing silly mistake while debugging the things; my
printks were at wrong place.
And everything works as expected and as per my understanding....