From: Tijs Van Buggenhout Date: Mon, 4 Jan 2021 22:57:13 +0000 (+0100) Subject: pppd: (Re)use chap_find_digest in chap_auth_peer X-Git-Tag: ppp-2.5.0~88^2~2 X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=6103878d4751a16075759091b73cf61d97687c25;p=ppp.git pppd: (Re)use chap_find_digest in chap_auth_peer Code duplication. Signed-off-by: Tijs Van Buggenhout --- diff --git a/pppd/chap-new.c b/pppd/chap-new.c index 15206f6..10e4507 100644 --- a/pppd/chap-new.c +++ b/pppd/chap-new.c @@ -222,9 +222,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);