summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/server.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1997-09-09 21:51:39 +0000
committerBrian Somers <brian@FreeBSD.org>1997-09-09 21:51:39 +0000
commitd40f8a5a61defc1e0aca287dc618eff3f78c6e89 (patch)
treec6f9149a9a766cbb9ec3cb2bde004a5ef397c27c /usr.sbin/ppp/server.c
parent506474c87a06bbd41e8b99287ba925ad83576992 (diff)
downloadsrc-test2-d40f8a5a61defc1e0aca287dc618eff3f78c6e89.tar.gz
src-test2-d40f8a5a61defc1e0aca287dc618eff3f78c6e89.zip
Notes
Diffstat (limited to 'usr.sbin/ppp/server.c')
-rw-r--r--usr.sbin/ppp/server.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/usr.sbin/ppp/server.c b/usr.sbin/ppp/server.c
index 7aab041688cc..c756d77ebe9d 100644
--- a/usr.sbin/ppp/server.c
+++ b/usr.sbin/ppp/server.c
@@ -15,6 +15,7 @@
#include "loadalias.h"
#include "vars.h"
#include "server.h"
+#include "defs.h"
int server = UNKNOWN_SERVER;
static struct sockaddr_un ifsun;
@@ -31,6 +32,11 @@ ServerLocalOpen(const char *name, mode_t mask)
return 1;
}
+ if (!(mode&(MODE_AUTO|MODE_DEDICATED|MODE_DIRECT))) {
+ LogPrintf(LogERROR, "Local: Can't open socket in interactive mode\n");
+ return 1;
+ }
+
ifsun.sun_len = strlen(name);
if (ifsun.sun_len > sizeof ifsun.sun_path - 1) {
LogPrintf(LogERROR, "Local: %s: Path too long\n", name);
@@ -80,6 +86,12 @@ ServerTcpOpen(int port)
"in ppp.secret\n", port);
return 6;
}
+
+ if (!(mode&(MODE_AUTO|MODE_DEDICATED|MODE_DIRECT))) {
+ LogPrintf(LogERROR, "Tcp: Can't open socket in interactive mode\n");
+ return 6;
+ }
+
s = socket(PF_INET, SOCK_STREAM, 0);
if (s < 0) {
LogPrintf(LogERROR, "Tcp: socket: %s\n", strerror(errno));