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
|