X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;ds=sidebyside;f=pppd%2Fipv6cp.c;h=38cb22bbb5f60bf7585d5cd1c3dcfaebfc79578a;hb=2e53641535da26bf8c3c424172758ed81d908581;hp=bb7d9a18665e50490ec9032d4538af495344a706;hpb=a8c240d24e1b254284c06b06de06a66828eeec57;p=ppp.git diff --git a/pppd/ipv6cp.c b/pppd/ipv6cp.c index bb7d9a1..38cb22b 100644 --- a/pppd/ipv6cp.c +++ b/pppd/ipv6cp.c @@ -21,16 +21,14 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: ipv6cp.c,v 1.1 1999/08/13 01:58:43 paulus Exp $ + * $Id: ipv6cp.c,v 1.3 1999/08/24 05:31:09 paulus Exp $ * * * Original version by Inria (www.inria.fr) * Modified to match RFC2472 by Tommi Komulainen */ -#ifndef lint -static char rcsid[]="$Id: ipv6cp.c,v 1.1 1999/08/13 01:58:43 paulus Exp $"; -#endif +#define RCSID "$Id: ipv6cp.c,v 1.3 1999/08/24 05:31:09 paulus Exp $" /* * TODO: @@ -48,6 +46,7 @@ static char rcsid[]="$Id: ipv6cp.c,v 1.1 1999/08/13 01:58:43 paulus Exp $"; #include #include #include +#include #include "pppd.h" #include "fsm.h" @@ -56,6 +55,8 @@ static char rcsid[]="$Id: ipv6cp.c,v 1.1 1999/08/13 01:58:43 paulus Exp $"; #include "magic.h" #include "pathnames.h" +static const char rcsid[] = RCSID; + /* global vars */ ipv6cp_options ipv6cp_wantoptions[NUM_PPP]; /* Options that we want to request */ ipv6cp_options ipv6cp_gotoptions[NUM_PPP]; /* Options that peer ack'd */ @@ -202,8 +203,8 @@ setifaceid(arg) ipv6cp_options *wo = &ipv6cp_wantoptions[0]; struct in6_addr addr; -#define VALIDID(a) ( ((a).s6_addr64[0] == 0) && \ - ((a).s6_addr64[1] != 0) ) +#define VALIDID(a) ( (((a).s6_addr32[0] == 0) && ((a).s6_addr32[1] == 0)) && \ + (((a).s6_addr32[2] != 0) || ((a).s6_addr32[3] != 0)) ) if ((comma = strchr(arg, ',')) == NULL) comma = arg + strlen(arg); @@ -955,13 +956,13 @@ ipv6_demand_conf(u) ipv6cp_options *wo = &ipv6cp_wantoptions[u]; #if defined(__linux__) || (defined(SVR4) && (defined(SNI) || defined(__USLC__))) - if (!sifup(u, PPP_IPV6)) + if (!sifup(u)) return 0; #endif if (!sif6addr(u, wo->ourid, wo->hisid)) return 0; #if !defined(__linux__) && !(defined(SVR4) && (defined(SNI) || defined(__USLC__))) - if (!sifup(u, PPP_IPV6)) + if (!sifup(u)) return 0; #endif if (!sifnpmode(u, PPP_IPV6, NPMODE_QUEUE)) @@ -1063,7 +1064,7 @@ ipv6cp_up(f) #endif /* bring the interface up for IPv6 */ - if (!sifup(f->unit, PPP_IPV6)) { + if (!sifup(f->unit)) { if (debug) warn("sif6up failed"); ipv6cp_close(f->unit, "Interface configuration failed"); @@ -1126,11 +1127,12 @@ ipv6cp_down(f) sifnpmode(f->unit, PPP_IPV6, NPMODE_QUEUE); } else { #if !defined(__linux__) && !(defined(SVR4) && (defined(SNI) || defined(__USLC))) - sifdown(f->unit, PPP_IPV6); + sifnpmode(f->unit, PPP_IPV6, NPMODE_DROP); + sifdown(f->unit); #endif ipv6cp_clear_addrs(f->unit); #if defined(__linux__) || (defined(SVR4) && (defined(SNI) || defined(__USLC))) - sifdown(f->unit, PPP_IPV6); + sifdown(f->unit); #endif }