patch-1.3.14 linux/net/netrom/nr_route.c

Next file: linux/net/netrom/nr_subr.c
Previous file: linux/net/netrom/nr_out.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.13/linux/net/netrom/nr_route.c linux/net/netrom/nr_route.c
@@ -53,6 +53,7 @@
 #include <net/netrom.h>
 
 static int nr_neigh_no = 1;
+static int nr_route_on = 1;
 
 static struct nr_node  *nr_node_list  = NULL;
 static struct nr_neigh *nr_neigh_list = NULL;
@@ -564,6 +565,7 @@
 	struct nr_route_struct nr_route;
 	struct device *dev;
 	int err;
+	long opt = 0;
 
 	switch (cmd) {
 
@@ -606,6 +608,13 @@
 
 		case SIOCNRDECOBS:
 			return nr_dec_obs();
+			
+		case SIOCNRRTCTL:
+			if ((err = verify_area(VERIFY_READ, arg, sizeof(int))) != 0)
+				return err;
+			opt = get_fs_long((void *)arg);
+			nr_route_on = opt ? 1 : 0;
+			return 0;
 	}
 
 	return 0;
@@ -651,6 +660,9 @@
 
 	if ((dev = nr_dev_get(nr_dest)) != NULL)	/* Its for me */
 		return nr_rx_frame(skb, dev);
+
+	if (!nr_route_on && ax25 != NULL)
+		return 0;
 
 	/* Its Time-To-Live has expired */
 	if (--skb->data[14] == 0)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this