+ ut.ut_type = USER_PROCESS;
+ ut.ut_pid = mypid;
+
+ /* Insert the host name if one is supplied */
+ if (*host)
+ strncpy (ut.ut_host, host, sizeof(ut.ut_host));
+
+ /* Insert the IP address of the remote system if IP is enabled */
+ if (ipcp_protent.enabled_flag && ipcp_hisoptions[0].neg_addr)
+ memcpy(&ut.ut_addr, (char *) &ipcp_hisoptions[0].hisaddr,
+ sizeof(ut.ut_addr));
+
+ /* CL: Makes sure that the logout works */
+ if (*host == 0 && *name==0)
+ ut.ut_host[0]=0;
+
+ pututline(&ut);
+ endutent();
+/*
+ * Update the wtmp file.
+ */
+#if __GLIBC__ >= 2
+ updwtmp(_PATH_WTMP, &ut);
+#else
+ wtmp = open(_PATH_WTMP, O_APPEND|O_WRONLY);
+ if (wtmp >= 0) {
+ flock(wtmp, LOCK_EX);
+
+ if (write (wtmp, (char *)&ut, sizeof(ut)) != sizeof(ut))
+ warn("error writing %s: %m", _PATH_WTMP);
+
+ flock(wtmp, LOCK_UN);
+
+ close (wtmp);
+ }
+#endif
+}
+
+
+/********************************************************************
+ *
+ * sifvjcomp - config tcp header compression
+ */
+
+int sifvjcomp (int u, int vjcomp, int cidcomp, int maxcid)
+{
+ u_int x = get_flags(ppp_dev_fd);
+
+ if (vjcomp) {
+ if (ioctl (ppp_dev_fd, PPPIOCSMAXCID, (caddr_t) &maxcid) < 0) {
+ if (! ok_error (errno))
+ error("ioctl(PPPIOCSMAXCID): %m(%d)", errno);
+ vjcomp = 0;
+ }
+ }
+
+ x = vjcomp ? x | SC_COMP_TCP : x &~ SC_COMP_TCP;
+ x = cidcomp ? x & ~SC_NO_TCP_CCID : x | SC_NO_TCP_CCID;
+ set_flags (ppp_dev_fd, x);
+
+ return 1;
+}
+
+/********************************************************************
+ *
+ * sifup - Config the interface up and enable IP packets to pass.
+ */
+
+int sifup(int u)
+{
+ struct ifreq ifr;
+
+ memset (&ifr, '\0', sizeof (ifr));
+ strlcpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ if (ioctl(sock_fd, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) {
+ if (! ok_error (errno))
+ error("ioctl (SIOCGIFFLAGS): %m(%d)", errno);
+ return 0;
+ }
+
+ ifr.ifr_flags |= (IFF_UP | IFF_POINTOPOINT);
+ if (ioctl(sock_fd, SIOCSIFFLAGS, (caddr_t) &ifr) < 0) {
+ if (! ok_error (errno))
+ error("ioctl(SIOCSIFFLAGS): %m(%d)", errno);
+ return 0;