From 1feb1dc8f930a8985080025eedd7f597fb5cd11a Mon Sep 17 00:00:00 2001
From: Maxime Bizon <mbizon@freebox.fr>
Date: Thu, 16 Jan 2020 01:01:17 +0100
Subject: [PATCH 07/18] pppd: allow chap hook in non server mode

---
 pppd/auth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pppd/auth.c b/pppd/auth.c
index fb69806..20808b1 100644
--- a/pppd/auth.c
+++ b/pppd/auth.c
@@ -1748,7 +1748,7 @@ get_secret(unit, client, server, secret, secret_len, am_server)
 
     if (!am_server && passwd[0] != 0) {
 	strlcpy(secbuf, passwd, sizeof(secbuf));
-    } else if (!am_server && chap_passwd_hook) {
+    } else if (chap_passwd_hook) {
 	if ( (*chap_passwd_hook)(client, secbuf) < 0) {
 	    error("Unable to obtain CHAP password for %s on %s from plugin",
 		  client, server);
-- 
2.17.1

