mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-23 19:20:52 +00:00
ppp_settings.remote_name is now a compile time option
This commit is contained in:
parent
111a1cef52
commit
ff2a737094
@ -435,9 +435,11 @@ static void chap_respond(ppp_pcb *pcb, int id,
|
||||
/* Null terminate and clean remote name. */
|
||||
slprintf(rname, sizeof(rname), "%.*v", nlen, pkt + clen + 1);
|
||||
|
||||
#if PPP_REMOTENAME
|
||||
/* Microsoft doesn't send their name back in the PPP packet */
|
||||
if (pcb->settings.explicit_remote || (pcb->settings.remote_name[0] != 0 && rname[0] == 0))
|
||||
strlcpy(rname, pcb->settings.remote_name, sizeof(rname));
|
||||
#endif /* PPP_REMOTENAME */
|
||||
|
||||
/* get secret for authenticating ourselves with the specified host */
|
||||
if (!get_secret(pcb, pcb->chap_client.name, rname, secret, &secret_len, 0)) {
|
||||
|
@ -1444,10 +1444,12 @@ static void eap_request(ppp_pcb *pcb, u_char *inp, int id, int len) {
|
||||
rhostname[len - vallen] = '\0';
|
||||
}
|
||||
|
||||
#if PPP_REMOTENAME
|
||||
/* In case the remote doesn't give us his name. */
|
||||
if (pcb->settings.explicit_remote ||
|
||||
(pcb->settings.remote_name[0] != '\0' && vallen == len))
|
||||
strlcpy(rhostname, pcb->settings.remote_name, sizeof (rhostname));
|
||||
#endif /* PPP_REMOTENAME */
|
||||
|
||||
/*
|
||||
* Get the secret for authenticating ourselves with
|
||||
|
@ -153,7 +153,9 @@ typedef struct ppp_settings_s {
|
||||
|
||||
u_int disable_defaultip : 1; /* Don't use hostname for default IP addrs */
|
||||
u_int auth_required : 1; /* Peer is required to authenticate */
|
||||
#if PPP_REMOTENAME
|
||||
u_int explicit_remote : 1; /* remote_name specified with remotename opt */
|
||||
#endif /* PPP_REMOTENAME */
|
||||
#if PAP_SUPPORT
|
||||
u_int refuse_pap : 1; /* Don't wanna auth. ourselves with PAP */
|
||||
#endif /* PAP_SUPPORT */
|
||||
@ -189,8 +191,9 @@ typedef struct ppp_settings_s {
|
||||
#if PPP_SERVER
|
||||
char our_name [MAXNAMELEN + 1]; /* Our name for authentication purposes */
|
||||
#endif /* PPP_SERVER */
|
||||
/* FIXME: make it a compile time option */
|
||||
#if PPP_REMOTENAME
|
||||
char remote_name[MAXNAMELEN + 1]; /* Peer's name for authentication */
|
||||
#endif /* PPP_REMOTENAME */
|
||||
|
||||
#if CHAP_SUPPORT
|
||||
int chap_timeout_time;
|
||||
|
Loading…
x
Reference in New Issue
Block a user