]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/ipv6cp.c
pppd: Separate IPv6 handling for sifup/sifdown
[ppp.git] / pppd / ipv6cp.c
index 4421d99bd920f9477904d49e8e8dbabecdf7b9b8..7e760732d42db32507b4032bdf2e71b88dbecfa1 100644 (file)
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <netdb.h>
@@ -1130,7 +1131,7 @@ ipv6_check_options()
 
     if (demand && (eui64_iszero(wo->ourid) || eui64_iszero(wo->hisid))) {
        option_error("local/remote LL address required for demand-dialling\n");
-       exit(1);
+       exit(EXIT_OPTION_ERROR);
     }
 }
 
@@ -1146,13 +1147,13 @@ ipv6_demand_conf(u)
     ipv6cp_options *wo = &ipv6cp_wantoptions[u];
 
 #if defined(__linux__) || defined(SOL2) || (defined(SVR4) && (defined(SNI) || defined(__USLC__)))
-#if defined(SOL2)
+#if defined(SOL2) || defined(__linux__)
     if (!sif6up(u))
        return 0;
 #else
     if (!sifup(u))
        return 0;
-#endif /* defined(SOL2) */
+#endif /* defined(SOL2) || defined(__linux__) */
 #endif    
     if (!sif6addr(u, wo->ourid, wo->hisid))
        return 0;
@@ -1259,10 +1260,10 @@ ipv6cp_up(f)
 #endif
 
        /* bring the interface up for IPv6 */
-#if defined(SOL2)
+#if defined(SOL2) || defined(__linux__)
        if (!sif6up(f->unit)) {
            if (debug)
-               warn("sifup failed (IPV6)");
+               warn("sif6up failed (IPV6)");
            ipv6cp_close(f->unit, "Interface configuration failed");
            return;
        }
@@ -1273,7 +1274,7 @@ ipv6cp_up(f)
            ipv6cp_close(f->unit, "Interface configuration failed");
            return;
        }
-#endif /* defined(SOL2) */
+#endif /* defined(SOL2) || defined(__linux__) */
 
 #if defined(__linux__) || defined(SOL2) || (defined(SVR4) && (defined(SNI) || defined(__USLC__)))
        if (!sif6addr(f->unit, go->ourid, ho->hisid)) {
@@ -1348,7 +1349,9 @@ ipv6cp_down(f)
        ipv6cp_clear_addrs(f->unit, 
                           ipv6cp_gotoptions[f->unit].ourid,
                           ipv6cp_hisoptions[f->unit].hisid);
-#if defined(__linux__) || (defined(SVR4) && (defined(SNI) || defined(__USLC)))
+#if defined(__linux__)
+       sif6down(f->unit);
+#elif defined(SVR4) && (defined(SNI) || defined(__USLC))
        sifdown(f->unit);
 #endif
     }