linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ppp_generic.c: last_channel_index
@ 2001-07-14 19:30 Brian Kuschak
  2001-07-14 20:38 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Kuschak @ 2001-07-14 19:30 UTC (permalink / raw)
  To: 'paulus@linuxcare.com.au'; +Cc: 'linux-kernel@vger.kernel.org'

I found that after I repeatedly opened and closed PPP connections, I would
get an Oops.  PPP daemon would try to allocate strange PPP interface numbers
(ppp12, for example) and other sanity checks would fail (kind != INTERFACE
|| CHANNEL)

The last_channel_index wasn't being cleaned up when the channel was closed,
leading to these problems the next time a PPP channel was opened.  This
patch fixes the problem for me.

using ppp-2.4.0, patch against: linux-2.4.6

Regards,
Brian

*** ppp_generic.c       Sun Apr 22 09:46:40 2001
--- /home/brian/linux/drivers/net/ppp_generic.c Fri Jul 13 18:38:30 2001
***************
*** 1871,1876 ****
--- 1796,1802 ----
        ppp_disconnect_channel(pch);
        wake_up_interruptible(&pch->file.rwait);
        spin_lock_bh(&all_channels_lock);
+       last_channel_index--;
        list_del(&pch->file.list);
        spin_unlock_bh(&all_channels_lock);
        if (atomic_dec_and_test(&pch->file.refcnt)) 

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

* Re: [PATCH] ppp_generic.c: last_channel_index
  2001-07-14 19:30 [PATCH] ppp_generic.c: last_channel_index Brian Kuschak
@ 2001-07-14 20:38 ` Alan Cox
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2001-07-14 20:38 UTC (permalink / raw)
  To: Brian Kuschak
  Cc: 'paulus@linuxcare.com.au',
	'linux-kernel@vger.kernel.org'

> get an Oops.  PPP daemon would try to allocate strange PPP interface numbers
> (ppp12, for example) and other sanity checks would fail (kind != INTERFACE
> || CHANNEL)
> 
> The last_channel_index wasn't being cleaned up when the channel was closed,
> leading to these problems the next time a PPP channel was opened.  This
> patch fixes the problem for me.

Im not convinced this is the actual problem I must admit

>         spin_lock_bh(&all_channels_lock);
> +       last_channel_index--;
>         list_del(&pch->file.list);
>         spin_unlock_bh(&all_channels_lock);

Suppose you open channel 0, then 1, then 2, then close 0. Your last_channel_index
is now wrong.

Certainly we should be reusing channel ids but I dont think its as simple as
your patch. The obvious question therefore is why does it work


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

end of thread, other threads:[~2001-07-14 20:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-14 19:30 [PATCH] ppp_generic.c: last_channel_index Brian Kuschak
2001-07-14 20:38 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).