patch-2.3.27 linux/drivers/net/ppp_async.c

Next file: linux/drivers/net/ppp_generic.c
Previous file: linux/drivers/net/pcnet32.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.26/linux/drivers/net/ppp_async.c linux/drivers/net/ppp_async.c
@@ -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;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)