]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/chap-new.c
Fix include paths for plugins to use the public API of pppd
[ppp.git] / pppd / chap-new.c
index 15206f63df1166e9b49875a2b1b9572d200a8c3a..565713f2cfa7bf2ed060c1211260673a46a29e60 100644 (file)
 
 #define RCSID  "$Id: chap-new.c,v 1.9 2007/06/19 02:08:35 carlsonj Exp $"
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 #include "pppd.h"
@@ -37,7 +41,7 @@
 #include "chap-new.h"
 #include "chap-md5.h"
 
-#ifdef CHAPMS
+#ifdef PPP_WITH_CHAPMS
 #include "chap_ms.h"
 #define MDTYPE_ALL (MDTYPE_MICROSOFT_V2 | MDTYPE_MICROSOFT | MDTYPE_MD5)
 #else
@@ -151,7 +155,7 @@ chap_init(int unit)
        memset(&server, 0, sizeof(server));
 
        chap_md5_init();
-#ifdef CHAPMS
+#ifdef PPP_WITH_CHAPMS
        chapms_init();
 #endif
 }
@@ -222,9 +226,8 @@ chap_auth_peer(int unit, char *our_name, int digest_code)
                error("CHAP: peer authentication already started!");
                return;
        }
-       for (dp = chap_digests; dp != NULL; dp = dp->next)
-               if (dp->code == digest_code)
-                       break;
+
+       dp = chap_find_digest(digest_code);
        if (dp == NULL)
                fatal("CHAP digest 0x%x requested but not available",
                      digest_code);