netdev
[Top] [All Lists]

Re: skb->dev = NULL in tcp_v{4,6}_rcv()

To: kuznet@xxxxxxxxxxxxx
Subject: Re: skb->dev = NULL in tcp_v{4,6}_rcv()
From: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@xxxxxxxxxxxxxxxxx>
Date: Fri, 22 Dec 2000 14:14:31 +0900
Cc: netdev@xxxxxxxxxxx
In-reply-to: <200012212033.XAA05009@xxxxxxxxxxxxx>
References: <20001222044900Z.yoshfuji@xxxxxxxxxxxxxxxxx> <200012212033.XAA05009@xxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
In article <200012212033.XAA05009@xxxxxxxxxxxxx> (at Thu, 21 Dec 2000 23:33:47 
+0300 (MSK)), kuznet@xxxxxxxxxxxxx says:

> > If so, how can I get "dev" in tcp_v{4,6}_do_rcv()?
> 
> No way. Device may even not exist to time when skb reaches these functions.
> You can get its index in the way like it is obtained there now,
> look into code. Device can be looked up by index, but the lookup may fail.

Thanks.  Now we use tcp_v6_iif() and dev_get_by_index() 
in tcp_v6_do_rcv():

   struct net_device *dev;
   struct inet6_dev *idev;
:
   dev = dev_get_by_index(tcp_v6_iif(skb));
   idev = dev ? in6_dev_get(dev) : NULL;
   
   /* do idev related things; (idev may be NULL) */

   if (dev){
      if (idev)
         in6_dev_put(idev);
      dev_put(dev);
   }
:

-- 
Hideaki YOSHIFUJI @ USAGI Project  <yoshfuji@xxxxxxxxxxxxxx>
PGP5i FP: F731 6599 5EB2 BBA7 1515  1323 1806 A96F 5700 6B25 

<Prev in Thread] Current Thread [Next in Thread>
  • Re: skb->dev = NULL in tcp_v{4,6}_rcv(), YOSHIFUJI Hideaki / 吉藤英明 <=