Re: diald and ppp under 2.3.18

really fedor@ms2.inr.ac.ru (inr-linux-kernel@ms2.inr.ac.ru)
22 Oct 1999 16:16:47 +0400


Mike Jagdis (mike@roan.co.UK) wrote:
> > diald uses ioctl PPPIOCGUNIT on terminal device to get the ppp unit
> > number attached to the terminal. In the new ppp driver there is no
> > such ioctl in ppp_async.c. I solved the problem so far by simply
> > adding this ioctl to ppp_async, but I am not quite sure it is a good
> > solution. Is there any another method to deal with this problem, or
> > this ioctl was simply forgotten?

> This is essential. Without it only pppd can know what unit was
> allocated for a particular line. Without knowing the unit we
> cannot know which interface we have just started.

Ok, then something like the following patch can be applied.

--
Fedor Bezrukov                      E-Mail: fedor@ms2.inr.ac.ru
  Physics Department of MSU         http://www.inr.ac.ru/~fedor/
  Institute for Nuclear Research    Tel: 135-20-51

--- orig/linux/drivers/net/ppp_async.c Thu Sep 2 16:17:46 1999 +++ linux/drivers/net/ppp_async.c Fri Oct 22 16:13:41 1999 @@ -64,6 +64,7 @@ struct ppp_channel chan; /* interface to generic ppp layer */ int connected; + int index; unsigned char obuf[OBUFSIZE]; }; @@ -387,6 +388,7 @@ if (err != 0) break; ap->connected = 1; + ap->index = val; break; case PPPIOCDETACH: err = -ENXIO; @@ -394,6 +396,14 @@ break; ppp_unregister_channel(&ap->chan); ap->connected = 0; + err = 0; + break; + case PPPIOCGUNIT: + err = -ENXIO; + if (!ap->connected) + break; + if (put_user(ap->index, (int *) arg)) + break; err = 0; break;

-- 
Fedor Bezrukov                      E-Mail: fedor@ms2.inr.ac.ru
  Physics Department of MSU         http://www.inr.ac.ru/~fedor/
  Institute for Nuclear Research    Tel: 135-20-51

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