From eca7a11ed288f7c56686302c3369c6fadeb6c9cc Mon Sep 17 00:00:00 2001
From: Maxime Bizon <mbizon@freebox.fr>
Date: Thu, 16 Jan 2020 01:01:17 +0100
Subject: [PATCH 06/12] 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 0779c46..c38fc7e 100644
--- a/pppd/auth.c
+++ b/pppd/auth.c
@@ -1870,7 +1870,7 @@ get_secret(int unit, char *client, char *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.34.1

