Messages in this thread Patches in this message |  | | From | (Andreas Koppenhoefer) | Subject | tunnel & dummy interface broken in 1.99.5 and later | Date | 23 May 1996 08:06:45 +0200 |
| |
-----BEGIN PGP SIGNED MESSAGE-----
In 1.99.5 (pre-2.0.5) and later tunnel and dummy net drivers are broken if they are compiled into kernel (not compiled as module). This is due to changes in linux/net/core/dev.c: every network interface is required to always have a dev->open routine.
Additionally I've found an unnecessary assignment in loopback driver.
The following patch should go cleanly into 1.99.7...
- Andreas
diff -u linux-1.99.7/drivers/net/new_tunnel.c 1.99.7/drivers/net/new_tunnel.c --- linux-1.99.7/drivers/net/new_tunnel.c Tue May 21 12:48:08 1996 +++ 1.99.7/drivers/net/new_tunnel.c Wed May 22 13:20:35 1996 @@ -86,19 +86,18 @@ #define TUNL_HLEN (((ETH_HLEN+15)&~15)+tunnel_hlen) -#ifdef MODULE static int tunnel_open(struct device *dev) { MOD_INC_USE_COUNT; return 0; } +#ifdef MODULE static int tunnel_close(struct device *dev) { MOD_DEC_USE_COUNT; return 0; } - #endif #ifdef TUNNEL_DEBUG @@ -348,8 +347,8 @@ } /* Add our tunnel functions to the device */ -#ifdef MODULE dev->open = tunnel_open; +#ifdef MODULE dev->stop = tunnel_close; #endif dev->hard_start_xmit = tunnel_xmit; diff -u linux-1.99.7/drivers/net/dummy.c 1.99.7/drivers/net/dummy.c --- linux-1.99.7/drivers/net/dummy.c Wed May 22 13:18:51 1996 +++ 1.99.7/drivers/net/dummy.c Wed May 22 14:36:12 1996 @@ -64,11 +64,13 @@ return 0; } +#ifdef MODULE static int dummy_close(struct device *dev) { MOD_DEC_USE_COUNT; return 0; } +#endif
int dummy_init(struct device *dev) @@ -89,7 +91,9 @@ #endif
dev->open = dummy_open; +#ifdef MODULE dev->stop = dummy_close; +#endif
/* Fill in the fields of the device structure with ethernet-generic values. */ ether_setup(dev); diff -u linux-1.99.7/drivers/net/loopback.c 1.99.7/drivers/net/loopback.c --- linux-1.99.7/drivers/net/loopback.c Tue May 21 12:50:15 1996 +++ 1.99.7/drivers/net/loopback.c Wed May 22 13:20:36 1996 @@ -122,7 +122,6 @@ dev->mtu = LOOPBACK_MTU; dev->tbusy = 0; dev->hard_start_xmit = loopback_xmit; - dev->open = NULL; dev->hard_header = eth_header; dev->hard_header_len = ETH_HLEN; /* 14 */ dev->addr_len = ETH_ALEN; /* 6 */ -----BEGIN PGP SIGNATURE----- Version: 2.6.2i Comment: Processed by Mailcrypt 3.3, an Emacs/PGP interface iQBVAwUBMaQAU0VdjNvyndGpAQFVCQIAlI7nsoMnKwOor0olqXf+YM9nvI2ASssT ihiOzkqPpOQLwxf9ttEp3PBAOWJUhNa1CG1TOclH0q/xXmGehP8umA== =SgF7 -----END PGP SIGNATURE----- -- Andreas Koppenhoefer, Student der Universitaet Stuttgart, BR Deutschland <koppenas@informatik.uni-stuttgart.de>, <akoppenhoefer@schweinfurt.netsurf.de> Franz-Schubert-Str. 2, 97616 Bad Neustadt, Germany, +49 9771 7943 (9-21h MEZ)
|  |