moved ipv6cp global variables to ppp_pcb

This commit is contained in:
Sylvain Rochet 2012-06-22 19:27:03 +02:00
parent 807afbc879
commit 074d3dd2b1
2 changed files with 14 additions and 8 deletions

View File

@ -169,12 +169,10 @@
#include "ipv6cp.h" #include "ipv6cp.h"
#include "magic.h" #include "magic.h"
/* FIXME: clean that */
/* global vars */ /* global vars */
#if 0 /* UNUSED */
int no_ifaceid_neg = 0; int no_ifaceid_neg = 0;
#endif /* UNUSED */
/* local vars */
static int ipv6cp_is_up;
/* /*
* Callbacks for fsm code. (CI = Configuration Information) * Callbacks for fsm code. (CI = Configuration Information)
@ -1150,7 +1148,9 @@ static void ipv6cp_up(fsm *f) {
if (!ho->neg_ifaceid) if (!ho->neg_ifaceid)
ho->hisid = wo->hisid; ho->hisid = wo->hisid;
#if 0 /* UNUSED */
if(!no_ifaceid_neg) { if(!no_ifaceid_neg) {
#endif /* UNUSED */
if (eui64_iszero(ho->hisid)) { if (eui64_iszero(ho->hisid)) {
error("Could not determine remote LL address"); error("Could not determine remote LL address");
ipv6cp_close(f->pcb, "Could not determine remote LL address"); ipv6cp_close(f->pcb, "Could not determine remote LL address");
@ -1166,7 +1166,9 @@ static void ipv6cp_up(fsm *f) {
ipv6cp_close(f->pcb, "local and remote LL addresses are equal"); ipv6cp_close(f->pcb, "local and remote LL addresses are equal");
return; return;
} }
#if 0 /* UNUSED */
} }
#endif /* UNUSED */
#if 0 /* UNUSED */ #if 0 /* UNUSED */
script_setenv("LLLOCAL", llv6_ntoa(go->ourid), 0); script_setenv("LLLOCAL", llv6_ntoa(go->ourid), 0);
script_setenv("LLREMOTE", llv6_ntoa(ho->hisid), 0); script_setenv("LLREMOTE", llv6_ntoa(ho->hisid), 0);
@ -1251,7 +1253,7 @@ static void ipv6cp_up(fsm *f) {
} }
np_up(f->pcb, PPP_IPV6); np_up(f->pcb, PPP_IPV6);
ipv6cp_is_up = 1; pcb->ipv6cp_is_up = 1;
#if 0 /* UNUSED */ #if 0 /* UNUSED */
/* /*
@ -1281,8 +1283,8 @@ static void ipv6cp_down(fsm *f) {
#if PPP_STATS_SUPPORT #if PPP_STATS_SUPPORT
update_link_stats(f->unit); update_link_stats(f->unit);
#endif /* PPP_STATS_SUPPORT */ #endif /* PPP_STATS_SUPPORT */
if (ipv6cp_is_up) { if (pcb->ipv6cp_is_up) {
ipv6cp_is_up = 0; pcb->ipv6cp_is_up = 0;
np_down(f->pcb, PPP_IPV6); np_down(f->pcb, PPP_IPV6);
} }
#ifdef IPV6CP_COMP #ifdef IPV6CP_COMP

View File

@ -192,6 +192,7 @@ typedef struct ppp_settings_s {
u_int lcp_echo_adaptive : 1; /* request echo only if the link was idle */ u_int lcp_echo_adaptive : 1; /* request echo only if the link was idle */
#endif #endif
u16_t listen_time; /* time to listen first (ms), waiting for peer to send LCP packet */ u16_t listen_time; /* time to listen first (ms), waiting for peer to send LCP packet */
#if PPP_IDLETIMELIMIT #if PPP_IDLETIMELIMIT
@ -283,7 +284,10 @@ struct ppp_pcb_s {
u_int default_route_set :1; /* Have set up a default route */ u_int default_route_set :1; /* Have set up a default route */
u_int proxy_arp_set :1; /* Have created proxy arp entry */ u_int proxy_arp_set :1; /* Have created proxy arp entry */
u_int ipcp_is_open :1; /* haven't called np_finished() */ u_int ipcp_is_open :1; /* haven't called np_finished() */
u_int ipcp_is_up :1; /* have called np_up() */ u_int ipcp_is_up :1; /* have called ipcp_up() */
#if PPP_IPV6_SUPPORT
u_int ipv6cp_is_up :1; /* have called ip6cp_up() */
#endif /* PPP_IPV6_SUPPORT */
u_int ask_for_local :1; /* request our address from peer */ u_int ask_for_local :1; /* request our address from peer */
u_int lcp_echo_timer_running :1; /* set if a timer is running */ u_int lcp_echo_timer_running :1; /* set if a timer is running */
#if PPPOS_SUPPORT && VJ_SUPPORT #if PPPOS_SUPPORT && VJ_SUPPORT