aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/physical.c
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>1999-10-21 01:19:23 +0000
committerBrian Somers <brian@FreeBSD.org>1999-10-21 01:19:23 +0000
commitf1b965c94b41ab872dffcb6dd442ed2b2c2d5be7 (patch)
treef2cf625eef8a4a9ba2b89a56093f53716e5f5106 /usr.sbin/ppp/physical.c
parent1b02dfb47ce83ef6723aa9da2002448d92199bef (diff)
downloadsrc-f1b965c94b41ab872dffcb6dd442ed2b2c2d5be7.tar.gz
src-f1b965c94b41ab872dffcb6dd442ed2b2c2d5be7.zip
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.
Notes
Notes: svn path=/head/; revision=52413
Diffstat (limited to 'usr.sbin/ppp/physical.c')
-rw-r--r--usr.sbin/ppp/physical.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/ppp/physical.c b/usr.sbin/ppp/physical.c
index 89ccad8ef440..04de982b0f94 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);