summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/i4b.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-11-28 15:50:23 +0000
committerbrian <brian@FreeBSD.org>1999-11-28 15:50:23 +0000
commit8181bafa69722265a1b66b045458c1ed3ba9511c (patch)
tree50013a6b8335e9ab5793485e4504342a6dc7e4ed /usr.sbin/ppp/i4b.c
parent08e4eaabf2d6188141c3ef36a4a5250ae7ac2782 (diff)
downloadFreeBSD-src-8181bafa69722265a1b66b045458c1ed3ba9511c.zip
FreeBSD-src-8181bafa69722265a1b66b045458c1ed3ba9511c.tar.gz
Don't try to do a DIALOUT in -direct mode or if there's no phone
numbers set.
Diffstat (limited to 'usr.sbin/ppp/i4b.c')
-rw-r--r--usr.sbin/ppp/i4b.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.sbin/ppp/i4b.c b/usr.sbin/ppp/i4b.c
index 8046a45..cdaad51 100644
--- a/usr.sbin/ppp/i4b.c
+++ b/usr.sbin/ppp/i4b.c
@@ -339,7 +339,7 @@ struct device *
i4b_Create(struct physical *p)
{
struct i4bdevice *dev;
- int oldflag;
+ int oldflag, dial;
msg_vr_req_t req;
telno_t number;
@@ -357,9 +357,12 @@ i4b_Create(struct physical *p)
log_Printf(LogDEBUG, "%s: Input is an i4b version %d.%d.%d isdn "
"device (%s)\n", p->link.name, req.version, req.release,
req.step, p->name.full);
- } else
+ dial = 0;
+ } else {
log_Printf(LogDEBUG, "%s: Opened %s (i4b version %d.%d.%d)\n",
p->link.name, p->name.full, req.version, req.release, req.step);
+ dial = 1;
+ }
/* We're gonna return an i4bdevice (unless something goes horribly wrong) */
@@ -402,9 +405,13 @@ i4b_Create(struct physical *p)
} else
fcntl(p->fd, F_SETFL, oldflag & ~O_NONBLOCK);
- strncpy(number, datalink_ChoosePhoneNumber(p->dl), sizeof number - 1);
- number[sizeof number - 1] = '\0';
- if (ioctl(p->fd, I4B_RBCH_DIALOUT, number) == -1) {
+ if (dial) {
+ strncpy(number, datalink_ChoosePhoneNumber(p->dl), sizeof number - 1);
+ number[sizeof number - 1] = '\0';
+ if (number[0] == '\0')
+ dial = 0;
+ }
+ if (dial && ioctl(p->fd, I4B_RBCH_DIALOUT, number) == -1) {
/* Complete failure - parent doesn't continue trying to ``create'' */
log_Printf(LogWARN, "%s: ioctl(I4B_RBCH_DIALOUT): %s\n",
OpenPOWER on IntegriCloud