diff options
author | brian <brian@FreeBSD.org> | 1999-10-21 01:19:23 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-10-21 01:19:23 +0000 |
commit | e9a7ac15d7e3ee5d48f309246529addb58f6b944 (patch) | |
tree | f2cf625eef8a4a9ba2b89a56093f53716e5f5106 | |
parent | 113b2d57884c5cd03bfc704ac94da6a27fa39255 (diff) | |
download | FreeBSD-src-e9a7ac15d7e3ee5d48f309246529addb58f6b944.zip FreeBSD-src-e9a7ac15d7e3ee5d48f309246529addb58f6b944.tar.gz |
If we're running ppp -direct over a tcp or udp connection,
record the IP number in the `from' slot and not the tty slot.
We put ``ppp'' in the tty slot - in line with what ftp (and
probably others) does.
-rw-r--r-- | usr.sbin/ppp/physical.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/ppp/physical.c b/usr.sbin/ppp/physical.c index 89ccad8..04de982 100644 --- a/usr.sbin/ppp/physical.c +++ b/usr.sbin/ppp/physical.c @@ -831,11 +831,20 @@ physical_Login(struct physical *p, const char *name) if (p->type == PHYS_DIRECT && *p->name.base && !p->Utmp) { struct utmp ut; const char *connstr; + char *colon; memset(&ut, 0, sizeof ut); time(&ut.ut_time); strncpy(ut.ut_name, name, sizeof ut.ut_name); - strncpy(ut.ut_line, p->name.base, sizeof ut.ut_line); + if (p->handler && (p->handler->type == TCP_DEVICE || + p->handler->type == UDP_DEVICE)) { + strncpy(ut.ut_line, "ppp", sizeof ut.ut_line); + strncpy(ut.ut_host, p->name.base, sizeof ut.ut_host); + colon = memchr(ut.ut_host, ':', sizeof ut.ut_host); + if (colon) + *colon = '\0'; + } else + strncpy(ut.ut_line, p->name.base, sizeof ut.ut_line); if ((connstr = getenv("CONNECT"))) /* mgetty sets this to the connection speed */ strncpy(ut.ut_host, connstr, sizeof ut.ut_host); |