* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
-#define RCSID "$Id: auth.c,v 1.78 2002/07/13 06:24:36 kad Exp $"
+#define RCSID "$Id: auth.c,v 1.83 2002/09/15 12:51:05 paulus Exp $"
#include <stdio.h>
#include <stddef.h>
{ "auth", o_bool, &auth_required,
"Require authentication from peer", OPT_PRIO | 1 },
{ "noauth", o_bool, &auth_required,
- "Don't require peer to authenticate", OPT_PRIOSUB | OPT_PRIV | OPT_A2COPY,
+ "Don't require peer to authenticate", OPT_PRIOSUB | OPT_PRIV,
&allow_any_ip },
{ "require-pap", o_bool, &lcp_wantoptions[0].neg_upap,
"Require PAP authentication from peer",
- OPT_PRIOSUB | OPT_A2COPY | 1, &auth_required },
+ OPT_PRIOSUB | 1, &auth_required },
{ "+pap", o_bool, &lcp_wantoptions[0].neg_upap,
"Require PAP authentication from peer",
- OPT_ALIAS | OPT_PRIOSUB | OPT_A2COPY | 1, &auth_required },
+ OPT_ALIAS | OPT_PRIOSUB | 1, &auth_required },
{ "require-chap", o_bool, &lcp_wantoptions[0].neg_chap,
"Require CHAP authentication from peer",
OPT_PRIOSUB | OPT_A2COPY | OPT_A3OR | MDTYPE_MD5,
start_networks(unit)
int unit;
{
- static int started = 0;
int i;
struct protent *protp;
int ecp_required, mppe_required;
- if (!started) {
- started = 1;
- new_phase(PHASE_NETWORK);
+ new_phase(PHASE_NETWORK);
#ifdef HAVE_MULTILINK
- if (multilink) {
- if (mp_join_bundle()) {
- if (updetach && !nodetach)
- detach();
- return;
- }
+ if (multilink) {
+ if (mp_join_bundle()) {
+ if (updetach && !nodetach)
+ detach();
+ return;
}
+ }
#endif /* HAVE_MULTILINK */
#ifdef PPP_FILTER
- if (!demand)
- set_filters(&pass_filter, &active_filter);
+ if (!demand)
+ set_filters(&pass_filter, &active_filter);
#endif
- /* Start CCP and ECP */
- for (i = 0; (protp = protocols[i]) != NULL; ++i)
- if ((protp->protocol == PPP_ECP || protp->protocol == PPP_CCP)
- && protp->enabled_flag && protp->open != NULL)
- (*protp->open)(0);
- }
+ /* Start CCP and ECP */
+ for (i = 0; (protp = protocols[i]) != NULL; ++i)
+ if ((protp->protocol == PPP_ECP || protp->protocol == PPP_CCP)
+ && protp->enabled_flag && protp->open != NULL)
+ (*protp->open)(0);
/*
- * Bring up other network protocols after encryption has completed.
- * OPENED here merely means that negotiation has completed. It is
- * up to the protocol to correctly terminate or disable LCP/NCP
- * based on the result of the negotiation.
+ * Bring up other network protocols iff encryption is not required.
*/
ecp_required = ecp_gotoptions[unit].required;
mppe_required = ccp_gotoptions[unit].mppe;
- if ((!ecp_required && !mppe_required)
- || (ecp_required && ecp_fsm[unit].state == OPENED)
- || (mppe_required && ccp_fsm[unit].state == OPENED)) {
- for (i = 0; (protp = protocols[i]) != NULL; ++i)
- if (protp->protocol < 0xC000
- && protp->protocol != PPP_CCP && protp->protocol != PPP_ECP
- && protp->enabled_flag && protp->open != NULL) {
- (*protp->open)(0);
- ++num_np_open;
- }
+ if (!ecp_required && !mppe_required)
+ continue_networks(unit);
+}
- if (num_np_open == 0)
- /* nothing to do */
- lcp_close(0, "No network protocols running");
- }
+void
+continue_networks(unit)
+ int unit;
+{
+ int i;
+ struct protent *protp;
+
+ /*
+ * Start the "real" network protocols.
+ */
+ for (i = 0; (protp = protocols[i]) != NULL; ++i)
+ if (protp->protocol < 0xC000
+ && protp->protocol != PPP_CCP && protp->protocol != PPP_ECP
+ && protp->enabled_flag && protp->open != NULL) {
+ (*protp->open)(0);
+ ++num_np_open;
+ }
+
+ if (num_np_open == 0)
+ /* nothing to do */
+ lcp_close(0, "No network protocols running");
}
/*
case PPP_OCTETS_DIRECTION_OUT:
used = link_stats.bytes_out;
break;
- case PPP_OCTETS_DIRECTION_MAX:
+ case PPP_OCTETS_DIRECTION_MAXOVERAL:
+ case PPP_OCTETS_DIRECTION_MAXSESSION:
used = (link_stats.bytes_in > link_stats.bytes_out) ? link_stats.bytes_in : link_stats.bytes_out;
break;
default:
tty = devnam;
if (strncmp(tty, "/dev/", 5) == 0)
tty += 5;
- logwtmp(tty, user, remote_name); /* Add wtmp login entry */
+ logwtmp(tty, user, ifname); /* Add wtmp login entry */
#if defined(_PATH_LASTLOG) && !defined(USE_PAM)
if (pw != (struct passwd *)NULL) {