auth |= UPAP_WITHPEER;
auth |= PAP_WITHPEER;
link_established(unit)    int unit;{    int auth;    lcp_options *wo = &lcp_wantoptions[unit];    lcp_options *go = &lcp_gotoptions[unit];    lcp_options *ho = &lcp_hisoptions[unit];    int i;    struct protent *protp;    /*     * Tell higher-level protocols that LCP is up.     */    for (i = 0; (protp = protocols[i]) != NULL; ++i)        if (protp->protocol != PPP_LCP && protp->enabled_flag	    && protp->lowerup != NULL)	    (*protp->lowerup)(unit);    if (auth_required && !(go->neg_chap || go->neg_upap)) {	/*	 * We wanted the peer to authenticate itself, and it refused:	 * treat it as though it authenticated with PAP using a username	 * of "" and a password of "".  If that's not OK, boot it out.	 */	if (!wo->neg_upap || !null_login(unit)) {	    syslog(LOG_WARNING, "peer refused to authenticate");	    lcp_close(unit, "peer refused to authenticate");	    phase = PHASE_TERMINATE;	    return;	}    }    phase = PHASE_AUTHENTICATE;    auth = 0;    if (go->neg_chap) {	ChapAuthPeer(unit, our_name, go->chap_mdtype);	auth |= CHAP_PEER;    } else if (go->neg_upap) {	upap_authpeer(unit);	auth |= UPAP_PEER;    }    if (ho->neg_chap) {	ChapAuthWithPeer(unit, our_name, ho->chap_mdtype);	auth |= CHAP_WITHPEER;    } else if (ho->neg_upap) {        if (passwd[0] == 0) {            passwd_from_file = 1;            if (!get_upap_passwd(passwd))                syslog(LOG_ERR, "No secret found for PAP login");        }	upap_authwithpeer(unit, user, passwd);	auth |= UPAP_WITHPEER;    }    auth_pending[unit] = auth;    if (!auth)	network_phase(unit);}