more loopback devices

tmb@best.com
Sat, 16 Sep 1995 16:26:59 -0800


I would like to have additional loopback devices in the kernel, at least
as a configurable option.

This has been useful on a laptop where such devices can be configured as
stand-ins for Ethernet cards that are only intermittently present. The
idea is to put an ifconfig and route for a loopback device with the
"stop" action into /etc/pcmcia/network. Without additional loopback
devices, there are no permanently available network addresses to
configure network daemons on.

I have appended a patch to the kernel sources that implements this. I
would hope that it can be included in one of the next Linux kernel releases.

Thanks,
Thomas.

*** drivers/net/Space.c.orig Tue Sep 5 03:21:13 1995
--- drivers/net/Space.c Tue Sep 5 01:45:24 1995
***************
*** 311,316 ****
--- 311,329 ----

extern int loopback_init(struct device *dev);

+ #ifndef NOHACKS
+ /* need extra loopback devices to stand in when some networks are down */
+
+ struct device loopback3_dev =
+ { "lo3", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NEXT_DEV, loopback_init };
+ struct device loopback2_dev =
+ { "lo2", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, &loopback3_dev, loopback_init };
+ struct device loopback1_dev =
+ { "lo1", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, &loopback2_dev, loopback_init };
+ # undef NEXT_DEV
+ # define NEXT_DEV (&loopback1_dev)
+ #endif
+
struct device loopback_dev = {
"lo", /* Software Loopback interface */
0x0, /* recv memory end */