summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1999-03-07 11:55:28 +0000
committerbrian <brian@cvs.openbsd.org>1999-03-07 11:55:28 +0000
commit7739013052c237d3eb51542bd760110dbe13c146 (patch)
treef05ef29c9026e06ce5a0394591503f7de1fe8384 /usr.sbin
parentd84a9dc31b0f950e39bd4a5b34b16b5cb77c5c71 (diff)
Correctly drop existing connections when reopening the diagnostic
socket.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/ppp/log.c14
-rw-r--r--usr.sbin/ppp/ppp/ppp.88
-rw-r--r--usr.sbin/ppp/ppp/server.c4
3 files changed, 16 insertions, 10 deletions
diff --git a/usr.sbin/ppp/ppp/log.c b/usr.sbin/ppp/ppp/log.c
index 443303bd8f3..528b1d511f5 100644
--- a/usr.sbin/ppp/ppp/log.c
+++ b/usr.sbin/ppp/ppp/log.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: log.c,v 1.2 1999/02/06 03:22:41 brian Exp $
+ * $Id: log.c,v 1.3 1999/03/07 11:55:26 brian Exp $
*/
#include <sys/types.h>
@@ -132,15 +132,21 @@ log_UnRegisterPrompt(struct prompt *prompt)
void
log_DestroyPrompts(struct server *s)
{
- struct prompt *p, *pn;
+ struct prompt *p, *pn, *pl;
p = promptlist;
+ pl = NULL;
while (p) {
pn = p->next;
- if (s && p->owner != s) {
+ if (s && p->owner == s) {
+ if (pl)
+ pl->next = p->next;
+ else
+ promptlist = p->next;
p->next = NULL;
prompt_Destroy(p, 1);
- }
+ } else
+ pl = p;
p = pn;
}
}
diff --git a/usr.sbin/ppp/ppp/ppp.8 b/usr.sbin/ppp/ppp/ppp.8
index 7f4625fecc0..9069fc1969e 100644
--- a/usr.sbin/ppp/ppp/ppp.8
+++ b/usr.sbin/ppp/ppp/ppp.8
@@ -1,4 +1,4 @@
-.\" $Id: ppp.8,v 1.25 1999/03/04 17:42:26 brian Exp $
+.\" $Id: ppp.8,v 1.26 1999/03/07 11:55:26 brian Exp $
.Dd 20 September 1995
.nr XX \w'\fC00'
.Os FreeBSD
@@ -3981,9 +3981,9 @@ to close any existing socket.
If you wish to specify a local domain socket,
.Ar LocalName
must be specified as an absolute file name, otherwise it is assumed
-to be the name or number of a TCP port. You may specify the octal umask that
-should be used with local domain sockets as a four character octal number
-beginning with
+to be the name or number of a TCP port. You must specify the octal umask
+that should be used with local domain sockets as a four character octal
+number beginning with
.Sq 0 .
Refer to
.Xr umask 2
diff --git a/usr.sbin/ppp/ppp/server.c b/usr.sbin/ppp/ppp/server.c
index 8fca38eebdf..c91cab9742d 100644
--- a/usr.sbin/ppp/ppp/server.c
+++ b/usr.sbin/ppp/ppp/server.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: server.c,v 1.2 1999/02/06 03:22:47 brian Exp $
+ * $Id: server.c,v 1.3 1999/03/07 11:55:27 brian Exp $
*/
#include <sys/types.h>
@@ -191,6 +191,7 @@ server_LocalOpen(struct bundle *bundle, const char *name, mode_t mask)
return 0;
}
+ server_Close(bundle);
memset(&server.ifsun, '\0', sizeof server.ifsun);
server.ifsun.sun_len = strlen(name);
if (server.ifsun.sun_len > sizeof server.ifsun.sun_path - 1) {
@@ -223,7 +224,6 @@ server_LocalOpen(struct bundle *bundle, const char *name, mode_t mask)
ID0unlink(name);
return 5;
}
- server_Close(bundle);
server.fd = s;
server.rm = server.ifsun.sun_path;
log_Printf(LogPHASE, "Listening at local socket %s.\n", name);