interface information for recvd packet

3 messages, 1 author, 2011-09-02 · open the first message on its own page

interface information for recvd packet

From: Viral Mehta <hidden>
Date: 2011-08-30 15:55:59

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

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

Re: interface information for recvd packet

From: Viral Mehta <hidden>
Date: 2011-09-02 00:07:20

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....
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help