All of lore.kernel.org
 help / color / mirror / Atom feed
* interface information for recvd packet
@ 2011-08-30 15:55 Viral Mehta
  2011-09-01 19:40 ` Viral Mehta
  0 siblings, 1 reply; 3+ messages in thread
From: Viral Mehta @ 2011-08-30 15:55 UTC (permalink / raw)
  To: netdev

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: interface information for recvd packet
  2011-08-30 15:55 interface information for recvd packet Viral Mehta
@ 2011-09-01 19:40 ` Viral Mehta
  2011-09-02  0:07   ` Viral Mehta
  0 siblings, 1 reply; 3+ messages in thread
From: Viral Mehta @ 2011-09-01 19:40 UTC (permalink / raw)
  To: netdev

On Tue, Aug 30, 2011 at 11:55 AM, Viral Mehta <viral.vkm@gmail.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: interface information for recvd packet
  2011-09-01 19:40 ` Viral Mehta
@ 2011-09-02  0:07   ` Viral Mehta
  0 siblings, 0 replies; 3+ messages in thread
From: Viral Mehta @ 2011-09-02  0:07 UTC (permalink / raw)
  To: netdev

Hi,

On Thu, Sep 1, 2011 at 3:40 PM, Viral Mehta <viral.vkm@gmail.com> wrote:
> On Tue, Aug 30, 2011 at 11:55 AM, Viral Mehta <viral.vkm@gmail.com> wrote:
>> 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....

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-02  0:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-30 15:55 interface information for recvd packet Viral Mehta
2011-09-01 19:40 ` Viral Mehta
2011-09-02  0:07   ` Viral Mehta

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.