summaryrefslogtreecommitdiff
path: root/pfinet
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2001-07-18 16:56:57 +0000
committerMarcus Brinkmann <marcus@gnu.org>2001-07-18 16:56:57 +0000
commitde810c391f2ef32edf6106340a274b01b006cdce (patch)
tree04a438d1fd2398e0f249ce5ea536f625cb98c671 /pfinet
parent3b882621b5de27c1c3ee619ea303eb6448459e8f (diff)
2001-07-13 Neal H Walfield <neal@cs.uml.edu>
* options.c (parse_opt): In the cases where we hold global_lock and fail, we must release the lock before calling FAIL.
Diffstat (limited to 'pfinet')
-rw-r--r--pfinet/ChangeLog5
-rw-r--r--pfinet/options.c18
2 files changed, 18 insertions, 5 deletions
diff --git a/pfinet/ChangeLog b/pfinet/ChangeLog
index af66b0be..0a32afc7 100644
--- a/pfinet/ChangeLog
+++ b/pfinet/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-13 Neal H Walfield <neal@cs.uml.edu>
+
+ * options.c (parse_opt): In the cases where we hold global_lock
+ and fail, we must release the lock before calling FAIL.
+
2001-06-08 Marcus Brinkmann <marcus@gnu.org>
* timer-emul.c (add_timer): Don't add jiffies to EXPIRES, it is
diff --git a/pfinet/options.c b/pfinet/options.c
index 31d9e075..92534982 100644
--- a/pfinet/options.c
+++ b/pfinet/options.c
@@ -1,6 +1,6 @@
/* Pfinet option parsing
- Copyright (C) 1996,97,2000 Free Software Foundation, Inc.
+ Copyright (C) 1996,97,2000,01 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.org>
@@ -253,7 +253,10 @@ parse_opt (int opt, char *arg, struct argp_state *state)
err = configure_device (in->device, in->address, in->netmask,
in->peer, INADDR_NONE);
if (err)
- FAIL (err, 16, 0, "cannot configure interface");
+ {
+ __mutex_unlock (&global_lock);
+ FAIL (err, 16, 0, "cannot configure interface");
+ }
}
/* Set the default gateway. This code is cobbled together from what
@@ -289,7 +292,10 @@ parse_opt (int opt, char *arg, struct argp_state *state)
{
err = - (*tb->tb_delete) (tb, &req.rtm, &rta, &req.nlh, 0);
if (err && err != ESRCH)
- FAIL (err, 17, 0, "cannot remove old default gateway");
+ {
+ __mutex_unlock (&global_lock);
+ FAIL (err, 17, 0, "cannot remove old default gateway");
+ }
err = 0;
}
}
@@ -302,13 +308,15 @@ parse_opt (int opt, char *arg, struct argp_state *state)
err = (!tb ? ENOBUFS
: - (*tb->tb_insert) (tb, &req.rtm, &rta, &req.nlh, 0));
if (err)
- FAIL (err, 17, 0, "cannot set default gateway");
+ {
+ __mutex_unlock (&global_lock);
+ FAIL (err, 17, 0, "cannot set default gateway");
+ }
}
}
__mutex_unlock (&global_lock);
-
/* Fall through to free hook. */
case ARGP_KEY_ERROR: