From a95587674c67e74d3ee696fbbb6c5ed711f51df9 Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Thu, 7 May 1998 00:39:56 +0000 Subject: [PATCH] Make syslogd function in non-secure mode. Log the correct ^2 packet as per the last commit comment. --- usr.sbin/syslogd/syslogd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 7985aee67459..6a55c355ce3a 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94"; #endif static const char rcsid[] = - "$Id: syslogd.c,v 1.29 1998/04/22 06:28:18 phk Exp $"; + "$Id: syslogd.c,v 1.30 1998/04/24 17:32:23 phk Exp $"; #endif /* not lint */ /* @@ -248,7 +248,7 @@ int Initialized = 0; /* set when we have initialized ourselves */ int MarkInterval = 20 * 60; /* interval between marks in seconds */ int MarkSeq = 0; /* mark sequence number */ int SecureMode = 0; /* when true, receive only unix domain socks */ -int Vogons = 0; /* packets arriving in SecureMode */ +u_int Vogons = 0; /* packets arriving in SecureMode */ int created_lsock = 0; /* Flag if local socket created */ char bootfile[MAXLINE+1]; /* booted kernel file */ @@ -385,8 +385,8 @@ main(argc, argv) logerror("bind"); if (!Debug) die(0); + } else inetm = FDMASK(finet); - } } if ((fklog = open(_PATH_KLOG, O_RDONLY, 0)) >= 0) @@ -458,7 +458,7 @@ main(argc, argv) (struct sockaddr *)&frominet, &len); if (SecureMode) { Vogons++; - if (Vogons & (Vogons + 1)) { + if (!(Vogons & (Vogons - 1))) { (void)snprintf(line, sizeof line, "syslogd: discarded %d unwanted packets in secure mode", Vogons); logmsg(LOG_SYSLOG|LOG_AUTH, line,