patch-2.1.91 linux/net/core/dst.c
Next file: linux/net/core/iovec.c
Previous file: linux/net/core/datagram.c
Back to the patch index
Back to the overall index
-  Lines: 15
-  Date:
Mon Mar 23 16:48:25 1998
-  Orig file: 
v2.1.90/linux/net/core/dst.c
-  Orig date: 
Tue Mar 17 22:18:16 1998
diff -u --recursive --new-file v2.1.90/linux/net/core/dst.c linux/net/core/dst.c
@@ -101,6 +101,14 @@
 void __dst_free(struct dst_entry * dst)
 {
 	start_bh_atomic();
+	/* The first case (dev==NULL) is required, when
+	   protocol module is unloaded.
+	 */
+	if (dst->dev == NULL || !(dst->dev->flags&IFF_UP)) {
+		dst->input = dst_discard;
+		dst->output = dst_blackhole;
+		dst->dev = &loopback_dev;
+	}
 	dst->obsolete = 2;
 	dst->next = dst_garbage_list;
 	dst_garbage_list = dst;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov