summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/main.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-05-26 00:44:10 +0000
committerbrian <brian@FreeBSD.org>1997-05-26 00:44:10 +0000
commit12b254e3164dbf2f773ea486a20102fd4183173c (patch)
treef69d2306d93e872c8408a5c5f9931535f7ecf7b1 /usr.sbin/ppp/main.c
parent8089164d6fdd97167753a3a56afb162c5a6f699c (diff)
downloadFreeBSD-src-12b254e3164dbf2f773ea486a20102fd4183173c.zip
FreeBSD-src-12b254e3164dbf2f773ea486a20102fd4183173c.tar.gz
De-couple ppp from libalias. If libalias isn't there, the
alias commands simply won't work. Only root may specify the location of the alias lib (otherwise, it's hard-coded). Make logprintf silently fail if LogOpen hasn't been called. Suggested by: eivind
Diffstat (limited to 'usr.sbin/ppp/main.c')
-rw-r--r--usr.sbin/ppp/main.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index 1ff814d..cae2440 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.55 1997/05/23 05:22:48 brian Exp $
+ * $Id: main.c,v 1.56 1997/05/24 17:32:40 brian Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@@ -37,13 +37,13 @@
#include <arpa/inet.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
-#include <alias.h>
#include "modem.h"
#include "os.h"
#include "hdlc.h"
#include "ccp.h"
#include "lcp.h"
#include "ipcp.h"
+#include "loadalias.h"
#include "vars.h"
#include "auth.h"
#include "filter.h"
@@ -289,7 +289,10 @@ ProcessArgs(int argc, char **argv)
else if (strcmp(cp, "ddial") == 0)
mode |= MODE_DDIAL|MODE_AUTO;
else if (strcmp(cp, "alias") == 0) {
- mode |= MODE_ALIAS;
+ if (loadAliasHandlers(&VarAliasHandlers) == 0)
+ mode |= MODE_ALIAS;
+ else
+ printf("Cannot load alias library\n");
optc--; /* this option isn't exclusive */
}
else
@@ -330,7 +333,6 @@ char **argv;
Greetings();
GetUid();
IpcpDefAddress();
- InitPacketAlias();
if (SelectSystem("default", CONFFILE) < 0) {
fprintf(stderr, "Warning: No default entry is given in config file.\n");
@@ -1026,7 +1028,7 @@ DoLoop()
pri = PacketCheck(rbuff, n, FL_DIAL);
if (pri >= 0) {
if (mode & MODE_ALIAS) {
- PacketAliasOut(rbuff, sizeof rbuff);
+ VarPacketAliasOut(rbuff, sizeof rbuff);
n = ntohs(((struct ip *)rbuff)->ip_len);
}
IpEnqueue(pri, rbuff, n);
@@ -1037,7 +1039,7 @@ DoLoop()
pri = PacketCheck(rbuff, n, FL_OUT);
if (pri >= 0) {
if (mode & MODE_ALIAS) {
- PacketAliasOut(rbuff, sizeof rbuff);
+ VarPacketAliasOut(rbuff, sizeof rbuff);
n = ntohs(((struct ip *)rbuff)->ip_len);
}
IpEnqueue(pri, rbuff, n);
OpenPOWER on IntegriCloud