Commit faa9979f authored by Paul Fulghum's avatar Paul Fulghum Committed by Linus Torvalds

[PATCH] ppp: terminate connection on hangup

I reviewed, patched, and tested ppp_async.c to implement
ldisc->hangup().  This correctly terminates the PPP connection on
hangup.

Paul Mackerras already did an excellent job of ensuring safe shutdown
and I/O completion in ldisc->close so the change is trivial: just add
the ldisc->hangup and call the existing close routine.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 49380827
...@@ -237,6 +237,18 @@ ppp_asynctty_close(struct tty_struct *tty) ...@@ -237,6 +237,18 @@ ppp_asynctty_close(struct tty_struct *tty)
kfree(ap); kfree(ap);
} }
/*
* Called on tty hangup in process context.
*
* Wait for I/O to driver to complete and unregister PPP channel.
* This is already done by the close routine, so just call that.
*/
static int ppp_asynctty_hangup(struct tty_struct *tty)
{
ppp_asynctty_close(tty);
return 0;
}
/* /*
* Read does nothing - no data is ever available this way. * Read does nothing - no data is ever available this way.
* Pppd reads and writes packets via /dev/ppp instead. * Pppd reads and writes packets via /dev/ppp instead.
...@@ -380,6 +392,7 @@ static struct tty_ldisc ppp_ldisc = { ...@@ -380,6 +392,7 @@ static struct tty_ldisc ppp_ldisc = {
.name = "ppp", .name = "ppp",
.open = ppp_asynctty_open, .open = ppp_asynctty_open,
.close = ppp_asynctty_close, .close = ppp_asynctty_close,
.hangup = ppp_asynctty_hangup,
.read = ppp_asynctty_read, .read = ppp_asynctty_read,
.write = ppp_asynctty_write, .write = ppp_asynctty_write,
.ioctl = ppp_asynctty_ioctl, .ioctl = ppp_asynctty_ioctl,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment