diff options
author | brian <brian@FreeBSD.org> | 2000-05-22 08:23:35 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-05-22 08:23:35 +0000 |
commit | 7bd588a76bb726eab7cea842145da63184b13761 (patch) | |
tree | f11372347662517232b7a28946435656556196ed /usr.sbin/ppp | |
parent | 4e4578620b262ec1cb43f46726217b256ec5bf8b (diff) | |
download | FreeBSD-src-7bd588a76bb726eab7cea842145da63184b13761.zip FreeBSD-src-7bd588a76bb726eab7cea842145da63184b13761.tar.gz |
Return -2 when tcp_OpenConnection() fails so that ppp doesn't
report that the device name is of an invalid format.
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/tcp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/ppp/tcp.c b/usr.sbin/ppp/tcp.c index 20ab45b..72d6eb1 100644 --- a/usr.sbin/ppp/tcp.c +++ b/usr.sbin/ppp/tcp.c @@ -69,7 +69,7 @@ tcp_OpenConnection(const char *name, char *host, char *port) dest.sin_addr = GetIpAddr(host); if (dest.sin_addr.s_addr == INADDR_NONE) { log_Printf(LogWARN, "%s: %s: unknown host\n", name, host); - return -1; + return -2; } dest.sin_port = htons(atoi(port)); if (dest.sin_port == 0) { @@ -78,19 +78,19 @@ tcp_OpenConnection(const char *name, char *host, char *port) dest.sin_port = sp->s_port; else { log_Printf(LogWARN, "%s: %s: unknown service\n", name, port); - return -1; + return -2; } } log_Printf(LogPHASE, "%s: Connecting to %s:%s/tcp\n", name, host, port); sock = socket(PF_INET, SOCK_STREAM, 0); if (sock < 0) - return sock; + return -2; if (connect(sock, (struct sockaddr *)&dest, sizeof dest) < 0) { log_Printf(LogWARN, "%s: connect: %s\n", name, strerror(errno)); close(sock); - return -1; + return -2; } return sock; |