summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-08-31 22:59:49 +0000
committerbrian <brian@FreeBSD.org>1997-08-31 22:59:49 +0000
commitc9a9461a21671bac4629e498a3208808d4f14757 (patch)
tree3fc9c8ab35ac1452e5cf005f4ca3bc9e21650abc /usr.sbin/ppp
parentb217a31a96f18aecebfa079789e822952e9da3a8 (diff)
downloadFreeBSD-src-c9a9461a21671bac4629e498a3208808d4f14757.zip
FreeBSD-src-c9a9461a21671bac4629e498a3208808d4f14757.tar.gz
Cosmetic: Make LogPrintf() calls consistent.
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/arp.c12
-rw-r--r--usr.sbin/ppp/chat.c52
-rw-r--r--usr.sbin/ppp/command.c4
-rw-r--r--usr.sbin/ppp/filter.c8
-rw-r--r--usr.sbin/ppp/fsm.c5
-rw-r--r--usr.sbin/ppp/ipcp.c25
-rw-r--r--usr.sbin/ppp/lcp.c4
-rw-r--r--usr.sbin/ppp/loadalias.c3
-rw-r--r--usr.sbin/ppp/lqr.c4
-rw-r--r--usr.sbin/ppp/main.c14
-rw-r--r--usr.sbin/ppp/modem.c4
-rw-r--r--usr.sbin/ppp/os.c35
-rw-r--r--usr.sbin/ppp/route.c23
-rw-r--r--usr.sbin/ppp/systems.c4
14 files changed, 103 insertions, 94 deletions
diff --git a/usr.sbin/ppp/arp.c b/usr.sbin/ppp/arp.c
index ded4d98..03b242e 100644
--- a/usr.sbin/ppp/arp.c
+++ b/usr.sbin/ppp/arp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: arp.c,v 1.12 1997/06/09 03:27:11 brian Exp $
+ * $Id: arp.c,v 1.13 1997/08/25 00:29:03 brian Exp $
*
*/
@@ -94,8 +94,7 @@ sifproxyarp(int unit, u_long hisaddr)
*/
memset(&arpmsg, 0, sizeof(arpmsg));
if (!get_ether_addr(unit, hisaddr, &arpmsg.hwa)) {
- LogPrintf(LogERROR, "Cannot determine ethernet address"
- " for proxy ARP\n");
+ LogPrintf(LogERROR, "Cannot determine ethernet address for proxy ARP\n");
return 0;
}
if ((routes = socket(PF_ROUTE, SOCK_RAW, AF_INET)) < 0) {
@@ -186,7 +185,7 @@ sifproxyarp(int unit, u_long hisaddr)
((struct sockaddr_in *) & arpreq.arp_pa)->sin_addr.s_addr = hisaddr;
arpreq.arp_flags = ATF_PERM | ATF_PUBL;
if (ioctl(unit, SIOCSARP, (caddr_t) & arpreq) < 0) {
- LogPrintf(LogERROR, "sifproxyarp: ioctl(SIOCSARP): \n");
+ LogPrintf(LogERROR, "sifproxyarp: ioctl(SIOCSARP): %s\n", strerror(errno));
return 0;
}
return 1;
@@ -204,7 +203,7 @@ cifproxyarp(int unit, u_long hisaddr)
SET_SA_FAMILY(arpreq.arp_pa, AF_INET);
((struct sockaddr_in *) & arpreq.arp_pa)->sin_addr.s_addr = hisaddr;
if (ioctl(unit, SIOCDARP, (caddr_t) & arpreq) < 0) {
- LogPrintf(LogERROR, "cifproxyarp: ioctl(SIOCDARP): \n");
+ LogPrintf(LogERROR, "cifproxyarp: ioctl(SIOCDARP): %s\n", strerror(errno));
return 0;
}
return 1;
@@ -232,7 +231,8 @@ get_ether_addr(int s, u_long ipaddr, struct sockaddr_dl * hwaddr)
ifc.ifc_len = sizeof(ifs);
ifc.ifc_req = ifs;
if (ioctl(s, SIOCGIFCONF, &ifc) < 0) {
- LogPrintf(LogERROR, "get_ether_addr: ioctl(SIOCGIFCONF): \n");
+ LogPrintf(LogERROR, "get_ether_addr: ioctl(SIOCGIFCONF): %s\n",
+ strerror(errno));
return 0;
}
diff --git a/usr.sbin/ppp/chat.c b/usr.sbin/ppp/chat.c
index 168ac6a..6432529 100644
--- a/usr.sbin/ppp/chat.c
+++ b/usr.sbin/ppp/chat.c
@@ -18,7 +18,7 @@
* Columbus, OH 43221
* (614)451-1883
*
- * $Id: chat.c,v 1.31 1997/08/17 22:47:07 brian Exp $
+ * $Id: chat.c,v 1.32 1997/08/25 00:29:07 brian Exp $
*
* TODO:
* o Support more UUCP compatible control sequences.
@@ -188,7 +188,7 @@ ExpandString(char *str, char *result, int reslen, int sendmode)
result += strlen(result);
if (VarTerm)
fprintf(VarTerm, "Phone: %s\n", phone);
- LogPrintf(LogPHASE, "Phone: %s", phone);
+ LogPrintf(LogPHASE, "Phone: %s\n", phone);
break;
case 'U':
strncpy(result, VarAuthName, reslen);
@@ -240,9 +240,9 @@ static void
flush_log()
{
if (LogIsKept(LogCONNECT))
- LogPrintf(LogCONNECT, "%s", logbuff);
+ LogPrintf(LogCONNECT, "%s\n", logbuff);
else if (LogIsKept(LogCARRIER) && strstr(logbuff, "CARRIER"))
- LogPrintf(LogCARRIER, "%s", logbuff);
+ LogPrintf(LogCARRIER, "%s\n", logbuff);
clear_log();
}
@@ -283,13 +283,13 @@ WaitforString(char *estr)
#endif
clear_log();
(void) ExpandString(estr, buff, sizeof(buff), 0);
- LogPrintf(LogCHAT, "Wait for (%d): %s --> %s", TimeoutSec, estr, buff);
+ LogPrintf(LogCHAT, "Wait for (%d): %s --> %s\n", TimeoutSec, estr, buff);
str = buff;
inp = inbuff;
if (strlen(str) >= IBSIZE) {
str[IBSIZE - 1] = 0;
- LogPrintf(LogCHAT, "Truncating String to %d character: %s", IBSIZE, str);
+ LogPrintf(LogCHAT, "Truncating String to %d character: %s\n", IBSIZE, str);
}
nfds = modem + 1;
s = str;
@@ -313,14 +313,14 @@ WaitforString(char *estr)
continue;
sigsetmask(omask);
#endif
- LogPrintf(LogERROR, "select: %s", strerror(errno));
+ LogPrintf(LogERROR, "WaitForString: select(): %s\n", strerror(errno));
*inp = 0;
return (NOMATCH);
} else if (i == 0) { /* Timeout reached! */
*inp = 0;
if (inp != inbuff)
- LogPrintf(LogCHAT, "Got: %s", inbuff);
- LogPrintf(LogCHAT, "Can't get (%d).", timeout.tv_sec);
+ LogPrintf(LogCHAT, "Got: %s\n", inbuff);
+ LogPrintf(LogCHAT, "Can't get (%d).\n", timeout.tv_sec);
#ifdef SIGALRM
sigsetmask(omask);
#endif
@@ -347,7 +347,7 @@ WaitforString(char *estr)
}
for (i = 0; i < numaborts; i++) {
if (strstr(inbuff, AbortStrings[i])) {
- LogPrintf(LogCHAT, "Abort: %s", AbortStrings[i]);
+ LogPrintf(LogCHAT, "Abort: %s\n", AbortStrings[i]);
#ifdef SIGALRM
sigsetmask(omask);
#endif
@@ -357,7 +357,7 @@ WaitforString(char *estr)
}
} else {
if (read(modem, &ch, 1) < 0) {
- LogPrintf(LogERROR, "read error: %s", strerror(errno));
+ LogPrintf(LogERROR, "read error: %s\n", strerror(errno));
*inp = '\0';
return (NOMATCH);
}
@@ -387,7 +387,7 @@ WaitforString(char *estr)
s1 = AbortStrings[i];
len = strlen(s1);
if ((len <= inp - inbuff) && (strncmp(inp - len, s1, len) == 0)) {
- LogPrintf(LogCHAT, "Abort: %s", s1);
+ LogPrintf(LogCHAT, "Abort: %s\n", s1);
*inp = 0;
#ifdef SIGALRM
sigsetmask(omask);
@@ -422,13 +422,14 @@ ExecStr(char *command, char *out)
cp--;
}
if (snprintf(tmp, sizeof tmp, "%s %s", command, cp) >= sizeof tmp) {
- LogPrintf(LogCHAT, "Too long string to ExecStr: \"%s\"", command);
+ LogPrintf(LogCHAT, "Too long string to ExecStr: \"%s\"\n", command);
return;
}
(void) MakeArgs(tmp, vector, VECSIZE(vector));
if (pipe(fids) < 0) {
- LogPrintf(LogCHAT, "Unable to create pipe in ExecStr: %s", strerror(errno));
+ LogPrintf(LogCHAT, "Unable to create pipe in ExecStr: %s\n",
+ strerror(errno));
return;
}
pid = fork();
@@ -441,27 +442,27 @@ ExecStr(char *command, char *out)
signal(SIGALRM, SIG_DFL);
close(fids[0]);
if (dup2(fids[1], 1) < 0) {
- LogPrintf(LogCHAT, "dup2(fids[1], 1) in ExecStr: %s", strerror(errno));
+ LogPrintf(LogCHAT, "dup2(fids[1], 1) in ExecStr: %s\n", strerror(errno));
return;
}
close(fids[1]);
nb = open("/dev/tty", O_RDWR);
if (dup2(nb, 0) < 0) {
- LogPrintf(LogCHAT, "dup2(nb, 0) in ExecStr: %s", strerror(errno));
+ LogPrintf(LogCHAT, "dup2(nb, 0) in ExecStr: %s\n", strerror(errno));
return;
}
- LogPrintf(LogCHAT, "exec: %s", command);
+ LogPrintf(LogCHAT, "exec: %s\n", command);
/* switch back to original privileges */
if (setgid(getgid()) < 0) {
- LogPrintf(LogCHAT, "setgid: %s", strerror(errno));
+ LogPrintf(LogCHAT, "setgid: %s\n", strerror(errno));
exit(1);
}
if (setuid(getuid()) < 0) {
- LogPrintf(LogCHAT, "setuid: %s", strerror(errno));
+ LogPrintf(LogCHAT, "setuid: %s\n", strerror(errno));
exit(1);
}
pid = execvp(command, vector);
- LogPrintf(LogCHAT, "execvp failed for (%d/%d): %s", pid, errno, command);
+ LogPrintf(LogCHAT, "execvp failed for (%d/%d): %s\n", pid, errno, command);
exit(127);
} else {
close(fids[1]);
@@ -501,11 +502,10 @@ SendString(char *str)
} else {
(void) ExpandString(str, buff + 2, sizeof(buff) - 2, 1);
}
- if (strstr(str, "\\P")) { /* Do not log the password itself. */
- LogPrintf(LogCHAT, "sending: %s", str);
- } else {
- LogPrintf(LogCHAT, "sending: %s", buff + 2);
- }
+ if (strstr(str, "\\P")) /* Do not log the password itself. */
+ LogPrintf(LogCHAT, "sending: %s\n", str);
+ else
+ LogPrintf(LogCHAT, "sending: %s\n", buff + 2);
cp = buff;
if (DEV_IS_SYNC)
bcopy("\377\003", buff, 2); /* Prepend HDLC header */
@@ -530,7 +530,7 @@ ExpectString(char *str)
++timeout_next;
return (MATCH);
}
- LogPrintf(LogCHAT, "Expecting %s", str);
+ LogPrintf(LogCHAT, "Expecting %s\n", str);
while (*str) {
/*
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index ba06fa0..78aee53 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: command.c,v 1.74 1997/08/21 17:07:30 brian Exp $
+ * $Id: command.c,v 1.75 1997/08/25 00:29:08 brian Exp $
*
*/
#include <sys/types.h>
@@ -296,7 +296,7 @@ ShellCommand(struct cmdtab const * cmdlist, int argc, char **argv, int bg)
p = getpid();
if (daemon(1, 1) == -1) {
- LogPrintf(LogERROR, "%d: daemon: %s", p, strerror(errno));
+ LogPrintf(LogERROR, "%d: daemon: %s\n", p, strerror(errno));
exit(1);
}
}
diff --git a/usr.sbin/ppp/filter.c b/usr.sbin/ppp/filter.c
index 30b13a6..bb24304 100644
--- a/usr.sbin/ppp/filter.c
+++ b/usr.sbin/ppp/filter.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: filter.c,v 1.12 1997/07/27 23:26:23 brian Exp $
+ * $Id: filter.c,v 1.13 1997/08/25 00:29:11 brian Exp $
*
* TODO: Shoud send ICMP error message when we discard packets.
*/
@@ -351,9 +351,9 @@ Parse(int argc, char **argv, struct filterent * ofp)
break;
}
- LogPrintf(LogDEBUG, "Parse: Src: %s", inet_ntoa(fp->saddr));
- LogPrintf(LogDEBUG, "Parse: Src mask: %s ", inet_ntoa(fp->smask));
- LogPrintf(LogDEBUG, "Parse: Dst: %s", inet_ntoa(fp->daddr));
+ LogPrintf(LogDEBUG, "Parse: Src: %s\n", inet_ntoa(fp->saddr));
+ LogPrintf(LogDEBUG, "Parse: Src mask: %s\n", inet_ntoa(fp->smask));
+ LogPrintf(LogDEBUG, "Parse: Dst: %s\n", inet_ntoa(fp->daddr));
LogPrintf(LogDEBUG, "Parse: Dst mask: %s\n", inet_ntoa(fp->dmask));
LogPrintf(LogDEBUG, "Parse: Proto = %d\n", proto);
diff --git a/usr.sbin/ppp/fsm.c b/usr.sbin/ppp/fsm.c
index 8ad1cfb..c951086 100644
--- a/usr.sbin/ppp/fsm.c
+++ b/usr.sbin/ppp/fsm.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: fsm.c,v 1.15 1997/08/20 23:47:42 brian Exp $
+ * $Id: fsm.c,v 1.16 1997/08/25 00:29:12 brian Exp $
*
* TODO:
* o Refer loglevel for log output
@@ -324,7 +324,8 @@ FsmRecvConfigReq(struct fsm * fp, struct fsmheader * lhp, struct mbuf * bp)
plen = plength(bp);
flen = ntohs(lhp->length) - sizeof(*lhp);
if (plen < flen) {
- LogPrintf(LogERROR, "FsmRecvConfigReq: plen (%d) < flen (%d)", plen, flen);
+ LogPrintf(LogERROR, "FsmRecvConfigReq: plen (%d) < flen (%d)\n",
+ plen, flen);
pfree(bp);
return;
}
diff --git a/usr.sbin/ppp/ipcp.c b/usr.sbin/ppp/ipcp.c
index 3ee1a59..ebdf521 100644
--- a/usr.sbin/ppp/ipcp.c
+++ b/usr.sbin/ppp/ipcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ipcp.c,v 1.25 1997/08/20 23:47:44 brian Exp $
+ * $Id: ipcp.c,v 1.26 1997/08/25 00:29:14 brian Exp $
*
* TODO:
* o More RFC1772 backwoard compatibility
@@ -302,8 +302,8 @@ IpcpOpen()
static int
AcceptableAddr(struct in_range * prange, struct in_addr ipaddr)
{
- LogPrintf(LogDEBUG, "requested = %x ", htonl(ipaddr.s_addr));
- LogPrintf(LogDEBUG, "range = %x", htonl(prange->ipaddr.s_addr));
+ LogPrintf(LogDEBUG, "requested = %x\n", htonl(ipaddr.s_addr));
+ LogPrintf(LogDEBUG, "range = %x\n", htonl(prange->ipaddr.s_addr));
LogPrintf(LogDEBUG, "/%x\n", htonl(prange->mask.s_addr));
LogPrintf(LogDEBUG, "%x, %x\n", htonl(prange->ipaddr.s_addr & prange->
mask.s_addr), htonl(ipaddr.s_addr & prange->mask.s_addr));
@@ -326,8 +326,6 @@ IpcpDecodeConfig(u_char * cp, int plen, int mode)
rejp = RejBuff;
while (plen >= sizeof(struct fsmconfig)) {
- if (plen < 0)
- break;
type = *cp;
length = cp[1];
if (type <= TY_IPADDR)
@@ -344,7 +342,6 @@ IpcpDecodeConfig(u_char * cp, int plen, int mode)
switch (mode) {
case MODE_REQ:
if (!AcceptableAddr(&DefHisAddress, ipaddr)) {
-
/*
* If destination address is not acceptable, insist to use what we
* want to use.
@@ -353,7 +350,6 @@ IpcpDecodeConfig(u_char * cp, int plen, int mode)
bcopy(&IpcpInfo.his_ipaddr.s_addr, nakp + 2, length);
nakp += length;
break;
-
}
IpcpInfo.his_ipaddr = ipaddr;
bcopy(cp, ackp, length);
@@ -365,7 +361,8 @@ IpcpDecodeConfig(u_char * cp, int plen, int mode)
/*
* Use address suggested by peer.
*/
- snprintf(tbuff2, sizeof(tbuff2), "%s changing address: %s ", tbuff, inet_ntoa(IpcpInfo.want_ipaddr));
+ snprintf(tbuff2, sizeof(tbuff2), "%s changing address: %s ", tbuff,
+ inet_ntoa(IpcpInfo.want_ipaddr));
LogPrintf(LogIPCP, "%s --> %s\n", tbuff2, inet_ntoa(ipaddr));
IpcpInfo.want_ipaddr = ipaddr;
}
@@ -440,8 +437,8 @@ IpcpDecodeConfig(u_char * cp, int plen, int mode)
ipaddr.s_addr = *lp;
lp = (u_long *) (cp + 6);
dstipaddr.s_addr = *lp;
- LogPrintf(LogIPCP, "%s %s, ", tbuff, inet_ntoa(ipaddr));
- LogPrintf(LogIPCP, "%s\n", inet_ntoa(dstipaddr));
+ snprintf(tbuff2, sizeof(tbuff2), "%s %s,", tbuff, inet_ntoa(ipaddr));
+ LogPrintf(LogIPCP, "%s %s\n", tbuff2, inet_ntoa(dstipaddr));
switch (mode) {
case MODE_REQ:
@@ -451,9 +448,9 @@ IpcpDecodeConfig(u_char * cp, int plen, int mode)
ackp += length;
break;
case MODE_NAK:
- LogPrintf(LogIPCP, "%s changing address: %s ",
- tbuff, inet_ntoa(IpcpInfo.want_ipaddr));
- LogPrintf(LogIPCP, "--> %s\n", inet_ntoa(ipaddr));
+ snprintf(tbuff2, sizeof(tbuff2), "%s changing address: %s", tbuff,
+ inet_ntoa(IpcpInfo.want_ipaddr));
+ LogPrintf(LogIPCP, "%s --> %s\n", tbuff2, inet_ntoa(ipaddr));
IpcpInfo.want_ipaddr = ipaddr;
IpcpInfo.his_ipaddr = dstipaddr;
break;
@@ -486,7 +483,7 @@ IpcpDecodeConfig(u_char * cp, int plen, int mode)
/*
* So the client has got the DNS stuff wrong (first request) so
- * well tell 'em how it is
+ * we'll tell 'em how it is
*/
bcopy(cp, nakp, 2); /* copy first two (type/length) */
LogPrintf(LogIPCP, "MS NS req %d:%s->%s - nak\n",
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c
index a2d6485..1538b46 100644
--- a/usr.sbin/ppp/lcp.c
+++ b/usr.sbin/ppp/lcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: lcp.c,v 1.26 1997/08/20 23:47:45 brian Exp $
+ * $Id: lcp.c,v 1.27 1997/08/25 00:29:15 brian Exp $
*
* TODO:
* o Validate magic number received from peer.
@@ -140,7 +140,7 @@ LcpReportTime()
time_t t;
time(&t);
- LogPrintf(LogDEBUG, "LcpReportTime: %s", ctime(&t));
+ LogPrintf(LogDEBUG, "LcpReportTime: %s\n", ctime(&t));
}
StopTimer(&LcpReportTimer);
LcpReportTimer.state = TIMER_STOPPED;
diff --git a/usr.sbin/ppp/loadalias.c b/usr.sbin/ppp/loadalias.c
index c811e83..d806c4f 100644
--- a/usr.sbin/ppp/loadalias.c
+++ b/usr.sbin/ppp/loadalias.c
@@ -49,8 +49,7 @@ loadAliasHandlers(struct aliasHandlers * h)
if (OrigUid() == 0)
path = env;
else
- LogPrintf(LogALERT, "Ignoring environment _PATH_ALIAS value (%s)",
- env);
+ LogPrintf(LogALERT, "Ignoring environment _PATH_ALIAS value (%s)\n", env);
dl = dlopen(path, RTLD_LAZY);
if (dl == (void *) 0) {
diff --git a/usr.sbin/ppp/lqr.c b/usr.sbin/ppp/lqr.c
index 9cd17ff..2d758ef 100644
--- a/usr.sbin/ppp/lqr.c
+++ b/usr.sbin/ppp/lqr.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: lqr.c,v 1.16 1997/07/02 19:18:42 phk Exp $
+ * $Id: lqr.c,v 1.17 1997/08/25 00:29:18 brian Exp $
*
* o LQR based on RFC1333
*
@@ -243,7 +243,7 @@ void
LqrDump(char *message, struct lqrdata * lqr)
{
if (LogIsKept(LogLQM)) {
- LogPrintf(LogLQM, "%s:", message);
+ LogPrintf(LogLQM, "%s:\n", message);
LogPrintf(LogLQM, " Magic: %08x LastOutLQRs: %08x\n",
lqr->MagicNumber, lqr->LastOutLQRs);
LogPrintf(LogLQM, " LastOutPackets: %08x LastOutOctets: %08x\n",
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index 0f29e64..dfcf5f6 100644
--- a/usr.sbin/ppp/main.c
+++ b/usr.sbin/ppp/main.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: main.c,v 1.74 1997/08/27 20:11:16 brian Exp $
+ * $Id: main.c,v 1.75 1997/08/31 20:07:02 brian Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@@ -418,7 +418,7 @@ main(int argc, char **argv)
if (!(mode & MODE_INTER)) {
if (mode & MODE_BACKGROUND) {
if (pipe(BGFiledes)) {
- LogPrintf(LogERROR, "pipe: %s", strerror(errno));
+ LogPrintf(LogERROR, "pipe: %s\n", strerror(errno));
Cleanup(EX_SOCK);
}
}
@@ -431,7 +431,7 @@ main(int argc, char **argv)
bgpid = fork();
if (bgpid == -1) {
- LogPrintf(LogERROR, "fork: %s", strerror(errno));
+ LogPrintf(LogERROR, "fork: %s\n", strerror(errno));
Cleanup(EX_SOCK);
}
if (bgpid) {
@@ -585,7 +585,7 @@ ReadTty()
* We are in terminal mode, decode special sequences
*/
n = read(fileno(VarTerm), &ch, 1);
- LogPrintf(LogDEBUG, "Got %d bytes (reading from the terminal)", n);
+ LogPrintf(LogDEBUG, "Got %d bytes (reading from the terminal)\n", n);
if (n > 0) {
switch (ttystate) {
@@ -910,7 +910,7 @@ DoLoop()
handle_signals();
continue;
}
- LogPrintf(LogERROR, "select: %s", strerror(errno));
+ LogPrintf(LogERROR, "DoLoop: select(): %s\n", strerror(errno));
break;
}
if ((netfd >= 0 && FD_ISSET(netfd, &efds)) || (modem >= 0 && FD_ISSET(modem, &efds))) {
@@ -921,7 +921,7 @@ DoLoop()
LogPrintf(LogPHASE, "connected to client.\n");
wfd = accept(server, (struct sockaddr *) & hisaddr, &ssize);
if (wfd < 0) {
- LogPrintf(LogERROR, "accept: %s", strerror(errno));
+ LogPrintf(LogERROR, "DoLoop: accept(): %s\n", strerror(errno));
continue;
}
if (netfd >= 0) {
@@ -998,7 +998,7 @@ DoLoop()
* from tun */
n = read(tun_in, rbuff, sizeof(rbuff));
if (n < 0) {
- LogPrintf(LogERROR, "read from tun: %s", strerror(errno));
+ LogPrintf(LogERROR, "read from tun: %s\n", strerror(errno));
continue;
}
if (((struct ip *) rbuff)->ip_dst.s_addr == IpcpInfo.want_ipaddr.s_addr) {
diff --git a/usr.sbin/ppp/modem.c b/usr.sbin/ppp/modem.c
index 528eb08..a5b7883 100644
--- a/usr.sbin/ppp/modem.c
+++ b/usr.sbin/ppp/modem.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: modem.c,v 1.48 1997/08/23 23:14:23 brian Exp $
+ * $Id: modem.c,v 1.49 1997/08/25 00:29:21 brian Exp $
*
* TODO:
*/
@@ -757,7 +757,7 @@ ModemStartOutput(int fd)
}
} else if (nw < 0) {
if (errno != EAGAIN) {
- LogPrintf(LogERROR, "modem write (%d): %s", modem, strerror(errno));
+ LogPrintf(LogERROR, "modem write (%d): %s\n", modem, strerror(errno));
reconnect(RECON_TRUE);
DownConnection();
}
diff --git a/usr.sbin/ppp/os.c b/usr.sbin/ppp/os.c
index 6f9073c..9cd9e75 100644
--- a/usr.sbin/ppp/os.c
+++ b/usr.sbin/ppp/os.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: os.c,v 1.23 1997/06/13 02:07:30 brian Exp $
+ * $Id: os.c,v 1.24 1997/08/25 00:29:23 brian Exp $
*
*/
#include "fsm.h"
@@ -72,7 +72,7 @@ SetIpDevice(struct in_addr myaddr,
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
- LogPrintf(LogERROR, "socket: %s", strerror(errno));
+ LogPrintf(LogERROR, "SetIpDevice: socket(): %s\n", strerror(errno));
return (-1);
}
if (updown == 0) {
@@ -86,7 +86,8 @@ SetIpDevice(struct in_addr myaddr,
bzero(&ifra.ifra_broadaddr, sizeof(ifra.ifra_addr));
bzero(&ifra.ifra_mask, sizeof(ifra.ifra_addr));
if (ioctl(s, SIOCDIFADDR, &ifra) < 0) {
- LogPrintf(LogERROR, "ioctl(SIOCDIFADDR): %s", strerror(errno));
+ LogPrintf(LogERROR, "SetIpDevice: ioctl(SIOCDIFADDR): %s\n",
+ strerror(errno));
close(s);
return (-1);
}
@@ -152,17 +153,21 @@ SetIpDevice(struct in_addr myaddr,
*/
bcopy(&ifra.ifra_addr, &ifrq.ifr_addr, sizeof(struct sockaddr));
if (ioctl(s, SIOCSIFADDR, &ifra) < 0)
- LogPrintf(LogERROR, "ioctl(SIFADDR): %s", strerror(errno));
+ LogPrintf(LogERROR, "SetIpDevice: ioctl(SIFADDR): %s\n",
+ strerror(errno));
bcopy(&ifra.ifra_broadaddr, &ifrq.ifr_dstaddr, sizeof(struct sockaddr));
if (ioctl(s, SIOCSIFDSTADDR, &ifrq) < 0)
- LogPrintf(LogERROR, "ioctl(SIFDSTADDR): %s", strerror(errno));
+ LogPrintf(LogERROR, "SetIpDevice: ioctl(SIFDSTADDR): %s\n",
+ strerror(errno));
#ifdef notdef
bcopy(&ifra.ifra_mask, &ifrq.ifr_broadaddr, sizeof(struct sockaddr));
if (ioctl(s, SIOCSIFBRDADDR, &ifrq) < 0)
- LogPrintf(LogERROR, "ioctl(SIFBRDADDR): %s", strerror(errno));
+ LogPrintf(LogERROR, "SetIpDevice: ioctl(SIFBRDADDR): %s\n",
+ strerror(errno));
#endif
} else if (ioctl(s, SIOCAIFADDR, &ifra) < 0) {
- LogPrintf(LogERROR, "ioctl(SIOCAIFADDR): %s", strerror(errno));
+ LogPrintf(LogERROR, "SetIpDevice: ioctl(SIOCAIFADDR): %s\n",
+ strerror(errno));
close(s);
return (-1);
}
@@ -255,12 +260,13 @@ OsInterfaceDown(int final)
return (0);
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
- LogPrintf(LogERROR, "socket: %s", strerror(errno));
+ LogPrintf(LogERROR, "OsInterfaceDown: socket: %s\n", strerror(errno));
return (-1);
}
ifrq.ifr_flags &= ~IFF_UP;
if (ioctl(s, SIOCSIFFLAGS, &ifrq) < 0) {
- LogPrintf(LogERROR, "ioctl(SIOCSIFFLAGS): %s", strerror(errno));
+ LogPrintf(LogERROR, "OsInterfaceDown: ioctl(SIOCSIFFLAGS): %s\n",
+ strerror(errno));
close(s);
return (-1);
}
@@ -282,7 +288,8 @@ OsSetInterfaceParams(int type, int mtu, int speed)
info.mtu = VarPrefMTU;
info.baudrate = speed;
if (ioctl(tun_out, TUNSIFINFO, &info) < 0)
- LogPrintf(LogERROR, "ioctl(TUNSIFINFO): %s", strerror(errno));
+ LogPrintf(LogERROR, "OsSetInterfaceParams: ioctl(TUNSIFINFO): %s\n",
+ strerror(errno));
}
/*
@@ -341,7 +348,7 @@ OpenTunnel(int *ptun)
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
- LogPrintf(LogERROR, "socket: %s", strerror(errno));
+ LogPrintf(LogERROR, "OpenTunnel: socket(): %s\n", strerror(errno));
return (-1);
}
@@ -349,13 +356,15 @@ OpenTunnel(int *ptun)
* Now, bring up the interface.
*/
if (ioctl(s, SIOCGIFFLAGS, &ifrq) < 0) {
- LogPrintf(LogERROR, "ioctl(SIOCGIFFLAGS): %s", strerror(errno));
+ LogPrintf(LogERROR, "OpenTunnel: ioctl(SIOCGIFFLAGS): %s\n",
+ strerror(errno));
close(s);
return (-1);
}
ifrq.ifr_flags |= IFF_UP;
if (ioctl(s, SIOCSIFFLAGS, &ifrq) < 0) {
- LogPrintf(LogERROR, "ioctl(SIOCSIFFLAGS): %s", strerror(errno));
+ LogPrintf(LogERROR, "OpenTunnel: ioctl(SIOCSIFFLAGS): %s\n",
+ strerror(errno));
close(s);
return (-1);
}
diff --git a/usr.sbin/ppp/route.c b/usr.sbin/ppp/route.c
index 2f2f57f..276e035 100644
--- a/usr.sbin/ppp/route.c
+++ b/usr.sbin/ppp/route.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: route.c,v 1.17 1997/07/28 01:02:27 brian Exp $
+ * $Id: route.c,v 1.18 1997/08/25 00:29:26 brian Exp $
*
*/
#include <sys/types.h>
@@ -67,7 +67,7 @@ OsSetRoute(int cmd,
s = socket(PF_ROUTE, SOCK_RAW, 0);
if (s < 0) {
- LogPrintf(LogERROR, "OsSetRoute: socket: %s", strerror(errno));
+ LogPrintf(LogERROR, "OsSetRoute: socket(): %s\n", strerror(errno));
return;
}
bzero(&rtmes, sizeof(rtmes));
@@ -218,7 +218,7 @@ ShowRoute()
mib[4] = NET_RT_DUMP;
mib[5] = 0;
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) {
- LogPrintf(LogERROR, "sysctl: estimate: %s", strerror(errno));
+ LogPrintf(LogERROR, "ShowRoute: sysctl: estimate: %s\n", strerror(errno));
return (1);
}
if (needed < 0)
@@ -227,7 +227,7 @@ ShowRoute()
if (sp == NULL)
return (1);
if (sysctl(mib, 6, sp, &needed, NULL, 0) < 0) {
- LogPrintf(LogERROR, "sysctl: getroute: %s", strerror(errno));
+ LogPrintf(LogERROR, "ShowRoute: sysctl: getroute: %s\n", strerror(errno));
free(sp);
return (1);
}
@@ -248,7 +248,7 @@ ShowRoute()
p_sockaddr(sa, 18);
lp = (int *) (sa->sa_len + (char *) sa);
if ((char *) lp < (char *) wp && *lp) {
- LogPrintf(LogDEBUG, " flag = %x, rest = %d", rtm->rtm_flags, *lp);
+ LogPrintf(LogDEBUG, " flag = %x, rest = %d\n", rtm->rtm_flags, *lp);
wp = (u_char *) (lp + 1);
mask = 0;
for (nb = *(char *) lp; nb > 4; nb--) {
@@ -292,7 +292,8 @@ DeleteIfRoutes(int all)
mib[4] = NET_RT_DUMP;
mib[5] = 0;
if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) {
- LogPrintf(LogERROR, "sysctl: estimate: %s", strerror(errno));
+ LogPrintf(LogERROR, "DeleteIfRoutes: sysctl: estimate: %s\n",
+ strerror(errno));
return;
}
if (needed < 0)
@@ -303,7 +304,8 @@ DeleteIfRoutes(int all)
return;
if (sysctl(mib, 6, sp, &needed, NULL, 0) < 0) {
- LogPrintf(LogERROR, "sysctl: getroute: %s", strerror(errno));
+ LogPrintf(LogERROR, "DeleteIfRoutes: sysctl: getroute: %s\n",
+ strerror(errno));
free(sp);
return;
}
@@ -329,7 +331,7 @@ DeleteIfRoutes(int all)
lp = (int *) (sa->sa_len + (char *) sa);
mask = 0;
if ((char *) lp < (char *) wp && *lp) {
- LogPrintf(LogDEBUG, "DeleteIfRoutes: flag = %x, rest = %d",
+ LogPrintf(LogDEBUG, "DeleteIfRoutes: flag = %x, rest = %d\n",
rtm->rtm_flags, *lp);
wp = (u_char *) (lp + 1);
for (nb = *lp; nb > 4; nb--) {
@@ -368,7 +370,7 @@ GetIfIndex(char *name)
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
- LogPrintf(LogERROR, "GetIfIndex: socket: %s", strerror(errno));
+ LogPrintf(LogERROR, "GetIfIndex: socket(): %s\n", strerror(errno));
return (-1);
}
buffer = malloc(bufsize); /* allocate first buffer */
@@ -386,7 +388,8 @@ GetIfIndex(char *name)
ifconfs.ifc_len = bufsize;
ifconfs.ifc_buf = buffer;
if (ioctl(s, SIOCGIFCONF, &ifconfs) < 0) {
- LogPrintf(LogERROR, "ioctl(SIOCGIFCONF): %s", strerror(errno));
+ LogPrintf(LogERROR, "GetIfIndex: ioctl(SIOCGIFCONF): %s\n",
+ strerror(errno));
close(s);
free(buffer);
return (-1);
diff --git a/usr.sbin/ppp/systems.c b/usr.sbin/ppp/systems.c
index 3693cda..e5e8046 100644
--- a/usr.sbin/ppp/systems.c
+++ b/usr.sbin/ppp/systems.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: systems.c,v 1.13 1997/06/25 19:30:05 brian Exp $
+ * $Id: systems.c,v 1.14 1997/08/25 00:29:29 brian Exp $
*
* TODO:
*/
@@ -177,7 +177,7 @@ SelectSystem(char *name, char *file)
if (*cp == ' ' || *cp == '\t') {
n = strspn(cp, " \t");
cp += n;
- LogPrintf(LogCOMMAND, "%s: %s", name, cp);
+ LogPrintf(LogCOMMAND, "%s: %s\n", name, cp);
SetPppId();
olauth = VarLocalAuth;
VarLocalAuth = LOCAL_AUTH;
OpenPOWER on IntegriCloud