From 89abf4706b304c059d0a92f79e44fd4cd6130b07 Mon Sep 17 00:00:00 2001 From: brian Date: Sun, 7 Mar 1999 11:54:43 +0000 Subject: Correctly drop existing connections when reopening the diagnostic socket. --- usr.sbin/ppp/log.c | 14 ++++++++++---- usr.sbin/ppp/ppp.8 | 8 ++++---- usr.sbin/ppp/ppp.8.m4 | 8 ++++---- usr.sbin/ppp/server.c | 4 ++-- 4 files changed, 20 insertions(+), 14 deletions(-) (limited to 'usr.sbin/ppp') diff --git a/usr.sbin/ppp/log.c b/usr.sbin/ppp/log.c index 90cedb8..93cea2e 100644 --- a/usr.sbin/ppp/log.c +++ b/usr.sbin/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.34 1998/08/09 15:34:11 brian Exp $ + * $Id: log.c,v 1.35 1998/08/21 18:10:14 brian Exp $ */ #include @@ -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.8 b/usr.sbin/ppp/ppp.8 index 77b26bf..393120a 100644 --- a/usr.sbin/ppp/ppp.8 +++ b/usr.sbin/ppp/ppp.8 @@ -1,4 +1,4 @@ -.\" $Id: ppp.8,v 1.153 1999/03/03 23:00:40 brian Exp $ +.\" $Id: ppp.8,v 1.154 1999/03/04 17:42:15 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.8.m4 b/usr.sbin/ppp/ppp.8.m4 index 77b26bf..393120a 100644 --- a/usr.sbin/ppp/ppp.8.m4 +++ b/usr.sbin/ppp/ppp.8.m4 @@ -1,4 +1,4 @@ -.\" $Id: ppp.8,v 1.153 1999/03/03 23:00:40 brian Exp $ +.\" $Id: ppp.8,v 1.154 1999/03/04 17:42:15 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/server.c b/usr.sbin/ppp/server.c index 2a6ccfe7..5ae15f5 100644 --- a/usr.sbin/ppp/server.c +++ b/usr.sbin/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.22 1998/06/27 14:18:10 brian Exp $ + * $Id: server.c,v 1.23 1998/08/02 13:01:16 brian Exp $ */ #include @@ -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); -- cgit v1.1