* Re : Re : Re : Bug in using inet_lookup ()
@ 2007-11-15 16:29 Nj A
2007-11-15 16:45 ` Evgeniy Polyakov
0 siblings, 1 reply; 2+ messages in thread
From: Nj A @ 2007-11-15 16:29 UTC (permalink / raw)
To: Evgeniy Polyakov; +Cc: netdev, kaber, davem
Hello all,
No bugs are due to the inet_lookup call now using the following:
if ((s_skb = alloc_skb (MAX_TCP_HEADER + 15, GFP_ATOMIC)) == NULL)
{
printk ("%s: Unable to allocate memory \n", __FUNCTION__);
err = -ENOMEM;
}
dev = s_skb->dev;
if (!dev)
printk ("%s: no device attached to s_skb\n", __FUNCTION__);
goto process_dev;
sk = inet_lookup (&tcp_hashinfo, src, p_src, dst, p_dst, inet_iif (s_skb));
bh_lock_sock (sk);
process_dev:
spin_lock (&tmp_lock);
new_dev = list_entry (&tmp, struct net_device, todo_list);
spin_unlock (&tmp_lock);
if (!new_dev)
printk ("%s: no device attached to new_dev \n", __FUNCTION__);
s_skb->dev = new_dev;
...
bh_unlock_sock (sk);
...
However, I am not having the right results. I checked with an established socket and expected to see that the socket is established (which is the case) but got the wrong state when testing on (sk->sk_state) and the socket seems in the TIME_WAIT / CLOSE state.
May be I am corrupting the search by manually attaching a device to the skb?
Any idea please?
Cheers,
----- Message d'origine ----
> De : Evgeniy Polyakov <johnpol@2ka.mipt.ru>
> À : Nj A <nj_a83@yahoo.fr>
> Cc : netdev@vger.kernel.org
> Envoyé le : Jeudi, 15 Novembre 2007, 11h12mn 28s
> Objet : Re: Re : Re : Bug in using inet_lookup ()
>
> On Wed, Nov 14, 2007 at 04:47:22PM +0000, Nj A (nj_a83@yahoo.fr) wrote:
> > By setting the ID of the ingress device to the inet_lookup() to 0, the machine
> reboots automatically.
> > Setting proc/sys/kernel/panic* to non zero values dosn't help more..
>
> Sorry, I did not understand?
> You mean after you provide zero to inet_lookup() instead of device id it
> strted to reboot?
>
> --
> Evgeniy Polyakov
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at
> http://vger.kernel.org/majordomo-info.html
>
_____________________________________________________________________________
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Re : Re : Re : Bug in using inet_lookup ()
2007-11-15 16:29 Re : Re : Re : Bug in using inet_lookup () Nj A
@ 2007-11-15 16:45 ` Evgeniy Polyakov
0 siblings, 0 replies; 2+ messages in thread
From: Evgeniy Polyakov @ 2007-11-15 16:45 UTC (permalink / raw)
To: Nj A; +Cc: netdev, kaber, davem
On Thu, Nov 15, 2007 at 05:29:52PM +0100, Nj A (nj_a83@yahoo.fr) wrote:
> Hello all,
> No bugs are due to the inet_lookup call now using the following:
> if ((s_skb = alloc_skb (MAX_TCP_HEADER + 15, GFP_ATOMIC)) == NULL)
> {
> printk ("%s: Unable to allocate memory \n", __FUNCTION__);
> err = -ENOMEM;
> }
> dev = s_skb->dev;
>
> if (!dev)
> printk ("%s: no device attached to s_skb\n", __FUNCTION__);
> goto process_dev;
>
> sk = inet_lookup (&tcp_hashinfo, src, p_src, dst, p_dst, inet_iif (s_skb));
>
> bh_lock_sock (sk);
> process_dev:
> spin_lock (&tmp_lock);
> new_dev = list_entry (&tmp, struct net_device, todo_list);
> spin_unlock (&tmp_lock);
> if (!new_dev)
> printk ("%s: no device attached to new_dev \n", __FUNCTION__);
> s_skb->dev = new_dev;
>
> ...
> bh_unlock_sock (sk);
> ...
>
> However, I am not having the right results. I checked with an established socket and expected to see that the socket is established (which is the case) but got the wrong state when testing on (sk->sk_state) and the socket seems in the TIME_WAIT / CLOSE state.
>
> May be I am corrupting the search by manually attaching a device to the skb?
> Any idea please?
Well, your code will oops just like before - you provide empty skb to
the inet_iif(), which is wrong. Actually you will not even reach that
point, since your code will exit after skb->dev check.
Try simple inet_lookup(&tcp_hashinfo, src, p_src, dst, p_dst, 0).
It does work.
--
Evgeniy Polyakov
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-11-15 16:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-15 16:29 Re : Re : Re : Bug in using inet_lookup () Nj A
2007-11-15 16:45 ` Evgeniy Polyakov
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.