]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] ppp: disconnect on hangup (synctty)
authorPaul Fulghum <paulkf@microgate.com>
Thu, 21 Oct 2004 05:38:55 +0000 (22:38 -0700)
committerLinus Torvalds <torvalds@evo.osdl.org>
Thu, 21 Oct 2004 05:38:55 +0000 (22:38 -0700)
Here is the hangup implementation for ppp_synctty.c (same as patch
previously for ppp_asynctty.c)

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/net/ppp_synctty.c

index 3103e0136479f0d867890712cf82990ce7752e32..37bbfad7edf70a41ed9bc01a66817db63ffebec6 100644 (file)
@@ -284,6 +284,18 @@ ppp_sync_close(struct tty_struct *tty)
        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_sync_hangup(struct tty_struct *tty)
+{
+       ppp_sync_close(tty);
+       return 0;
+}
+
 /*
  * Read does nothing - no data is ever available this way.
  * Pppd reads and writes packets via /dev/ppp instead.
@@ -422,6 +434,7 @@ static struct tty_ldisc ppp_sync_ldisc = {
        .name   = "pppsync",
        .open   = ppp_sync_open,
        .close  = ppp_sync_close,
+       .hangup = ppp_sync_hangup,
        .read   = ppp_sync_read,
        .write  = ppp_sync_write,
        .ioctl  = ppp_synctty_ioctl,