From 074d3dd2b18cb88452eae099c5175d7d644357ff Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Fri, 22 Jun 2012 19:27:03 +0200 Subject: [PATCH] moved ipv6cp global variables to ppp_pcb --- src/netif/ppp/ipv6cp.c | 16 +++++++++------- src/netif/ppp/ppp.h | 6 +++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/netif/ppp/ipv6cp.c b/src/netif/ppp/ipv6cp.c index 593649ce..68b38ff8 100644 --- a/src/netif/ppp/ipv6cp.c +++ b/src/netif/ppp/ipv6cp.c @@ -169,12 +169,10 @@ #include "ipv6cp.h" #include "magic.h" -/* FIXME: clean that */ /* global vars */ +#if 0 /* UNUSED */ int no_ifaceid_neg = 0; - -/* local vars */ -static int ipv6cp_is_up; +#endif /* UNUSED */ /* * Callbacks for fsm code. (CI = Configuration Information) @@ -1150,7 +1148,9 @@ static void ipv6cp_up(fsm *f) { if (!ho->neg_ifaceid) ho->hisid = wo->hisid; +#if 0 /* UNUSED */ if(!no_ifaceid_neg) { +#endif /* UNUSED */ if (eui64_iszero(ho->hisid)) { error("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"); return; } +#if 0 /* UNUSED */ } +#endif /* UNUSED */ #if 0 /* UNUSED */ script_setenv("LLLOCAL", llv6_ntoa(go->ourid), 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); - ipv6cp_is_up = 1; + pcb->ipv6cp_is_up = 1; #if 0 /* UNUSED */ /* @@ -1281,8 +1283,8 @@ static void ipv6cp_down(fsm *f) { #if PPP_STATS_SUPPORT update_link_stats(f->unit); #endif /* PPP_STATS_SUPPORT */ - if (ipv6cp_is_up) { - ipv6cp_is_up = 0; + if (pcb->ipv6cp_is_up) { + pcb->ipv6cp_is_up = 0; np_down(f->pcb, PPP_IPV6); } #ifdef IPV6CP_COMP diff --git a/src/netif/ppp/ppp.h b/src/netif/ppp/ppp.h index 0c2a3cda..e1fb3239 100644 --- a/src/netif/ppp/ppp.h +++ b/src/netif/ppp/ppp.h @@ -192,6 +192,7 @@ typedef struct ppp_settings_s { u_int lcp_echo_adaptive : 1; /* request echo only if the link was idle */ #endif + u16_t listen_time; /* time to listen first (ms), waiting for peer to send LCP packet */ #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 proxy_arp_set :1; /* Have created proxy arp entry */ 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 lcp_echo_timer_running :1; /* set if a timer is running */ #if PPPOS_SUPPORT && VJ_SUPPORT