summaryrefslogtreecommitdiffstats
path: root/net/wanrouter
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
commit482368b1a8e45430672c58c9a42e7d2004367126 (patch)
treece2a1a567d4d62dee7c2e71a46a99cf72cf1d606 /net/wanrouter
parente4d0251c6f56ab2e191afb70f80f382793e23f74 (diff)
Merge with 2.3.47. Guys, this is buggy as shit. You've been warned.
Diffstat (limited to 'net/wanrouter')
-rw-r--r--net/wanrouter/wanmain.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
index af7191563..7f12a1f16 100644
--- a/net/wanrouter/wanmain.c
+++ b/net/wanrouter/wanmain.c
@@ -526,7 +526,10 @@ static int device_shutdown (wan_device_t* wandev)
for (dev = wandev->dev; dev;)
{
if (delete_interface(wandev, dev->name, 0))
- dev = dev->slave;
+ {
+ struct net_device **slave = dev->priv;
+ dev = *slave;
+ }
}
if (wandev->ndev)
return -EBUSY; /* there are opened interfaces */
@@ -608,8 +611,10 @@ static int device_new_if (wan_device_t* wandev, wanif_conf_t* u_conf)
#endif
err = register_netdev(dev);
if (!err) {
+ struct net_device **slave = dev->priv;
+
cli(); /***** critical section start *****/
- dev->slave = wandev->dev;
+ *slave = wandev->dev;
wandev->dev = dev;
++wandev->ndev;
sti(); /****** critical section end ******/
@@ -684,14 +689,19 @@ static int delete_interface (wan_device_t *wandev, char *name, int force)
{
struct net_device *dev, *prev;
- for (dev = wandev->dev, prev = NULL;
- dev && strcmp(name, dev->name);
- prev = dev, dev = dev->slave);
+ dev = wandev->dev;
+ prev = NULL;
+ while (dev && strcmp(name, dev->name)) {
+ struct net_device **slave = dev->priv;
+
+ prev = dev;
+ dev = *slave;
+ }
if (dev == NULL)
return -ENODEV; /* interface not found */
- if (dev->start) {
+ if (netif_running(dev)) {
if (force) {
printk(KERN_WARNING
"%s: deleting opened interface %s!\n",
@@ -705,10 +715,16 @@ static int delete_interface (wan_device_t *wandev, char *name, int force)
wandev->del_if(wandev, dev);
cli(); /***** critical section start *****/
- if (prev)
- prev->slave = dev->slave;
- else
- wandev->dev = dev->slave;
+ if (prev) {
+ struct net_device **prev_slave = prev->priv;
+ struct net_device **slave = dev->priv;
+
+ *prev_slave = *slave;
+ } else {
+ struct net_device **slave = dev->priv;
+
+ wandev->dev = *slave;
+ }
--wandev->ndev;
sti(); /****** critical section end ******/