X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fchap-new.c;h=10e4507386e277fbdb6413e46bdd80f61a0b783f;hb=c4d488788a3ed8fba3e75c9ddd632d1f98e9ac77;hp=ad2f5eb975de779f2b8f707c73fe77d40153aeb0;hpb=14c1a77816e837852138e87a4adccfd66030b2c3;p=ppp.git diff --git a/pppd/chap-new.c b/pppd/chap-new.c index ad2f5eb..10e4507 100644 --- a/pppd/chap-new.c +++ b/pppd/chap-new.c @@ -171,11 +171,11 @@ chap_register_digest(struct chap_digest_type *dp) */ struct chap_digest_type * chap_find_digest(int digest_code) { - struct chap_digest_type *dp = NULL; + struct chap_digest_type *dp = NULL; for (dp = chap_digests; dp != NULL; dp = dp->next) if (dp->code == digest_code) break; - return dp; + return dp; } /* @@ -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);