patch-2.1.22 linux/net/x25/x25_link.c

Next file: linux/net/x25/x25_out.c
Previous file: linux/net/x25/x25_in.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.21/linux/net/x25/x25_link.c linux/net/x25/x25_link.c
@@ -51,7 +51,7 @@
 static void x25_link_set_timer(struct x25_neigh *neigh)
 {
 	unsigned long flags;
-	
+
 	save_flags(flags);
 	cli();
 	del_timer(&neigh->timer);
@@ -68,7 +68,7 @@
 static void x25_link_reset_timer(struct x25_neigh *neigh)
 {
 	unsigned long flags;
-	
+
 	save_flags(flags);
 	cli();
 	del_timer(&neigh->timer);
@@ -278,6 +278,9 @@
 	}
 }
 
+/*
+ *	Called when the link layer has become established.
+ */
 void x25_link_established(struct x25_neigh *neigh)
 {
 	switch (neigh->state) {
@@ -293,6 +296,10 @@
 	}
 }
 
+/*
+ *	Called when the link layer has terminated, or an establishment
+ *	request has failed. XXX should tell sockets.
+ */
 void x25_link_terminated(struct x25_neigh *neigh)
 {
 	neigh->state = X25_LINK_STATE_0;
@@ -332,7 +339,7 @@
 
 	while ((skb = skb_dequeue(&x25_neigh->queue)) != NULL)
 		kfree_skb(skb, FREE_WRITE);
-	
+
 	del_timer(&x25_neigh->timer);
 
 	save_flags(flags);
@@ -369,7 +376,7 @@
 	while (x25_neigh != NULL) {
 		neigh     = x25_neigh;
 		x25_neigh = x25_neigh->next;
-		
+
 		if (neigh->dev == dev)
 			x25_remove_neigh(neigh);
 	}
@@ -401,7 +408,18 @@
 
 	switch (cmd) {
 
-		case SIOCX25SETSUBSCR:
+		case SIOCX25GSUBSCRIP:
+			if ((err = verify_area(VERIFY_WRITE, arg, sizeof(struct x25_subscrip_struct))) != 0)
+				return err;
+			if ((dev = x25_dev_get(x25_subscr.device)) == NULL)
+				return -EINVAL;
+			if ((x25_neigh = x25_get_neigh(dev)) == NULL)
+				return -EINVAL;
+			x25_subscr.extended = x25_neigh->extended;
+			copy_to_user(arg, &x25_subscr, sizeof(struct x25_subscrip_struct));
+			break;
+
+		case SIOCX25SSUBSCRIP:
 			if ((err = verify_area(VERIFY_READ, arg, sizeof(struct x25_subscrip_struct))) != 0)
 				return err;
 			copy_from_user(&x25_subscr, arg, sizeof(struct x25_subscrip_struct));
@@ -446,7 +464,7 @@
 			len   = 0;
 			begin = pos;
 		}
-		
+
 		if (pos > offset + length)
 			break;
 	}
@@ -473,7 +491,7 @@
 	while (x25_neigh != NULL) {
 		neigh     = x25_neigh;
 		x25_neigh = x25_neigh->next;
-		
+
 		x25_remove_neigh(neigh);
 	}
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov