Re: [PATCH] ppp_generic.c: last_channel_index

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sat, 14 Jul 2001 21:38:23 +0100 (BST)


> 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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/