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.
This commit is contained in:
Brian Somers 1999-10-21 01:19:23 +00:00
parent 1b02dfb47c
commit f1b965c94b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=52413

View File

@ -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);