summaryrefslogtreecommitdiff
path: root/pppd
diff options
context:
space:
mode:
authorMichael Everitt <gentoo@veremit.xyz>2021-08-15 23:16:46 +0100
committerMichael Everitt <gentoo@veremit.xyz>2021-08-15 23:26:30 +0100
commit61940d9540d27d8a66e12e163da57f7e641a8f2d (patch)
tree78bb60e431c774a63d121b2b35ee22e190a821f0 /pppd
parent182f4caedee9ea797656359d8b0594c3abd5f24b (diff)
downloadppp-61940d9540d27d8a66e12e163da57f7e641a8f2d.tar.gz
Fix situation where peer may NAK with request for MS_WINS
Previously, if configure-request is sent without MS_WINS[12], a peer may return a NAK with a request for it. However, code in the ipcp_nakci didn't handle this case properly. This patch fixes it to set try.req_wins[12]. Signed-off-by: Michael Everitt <michael@2e0cer.net>
Diffstat (limited to 'pppd')
-rw-r--r--pppd/ipcp.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/pppd/ipcp.c b/pppd/ipcp.c
index 7db5156..6e0d5f6 100644
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
@@ -1240,13 +1240,20 @@ ipcp_nakci(fsm *f, u_char *p, int len, int treat_as_reject)
no.req_dns2 = 1;
break;
case CI_MS_WINS1:
+ if (go->req_wins1 || no.req_wins1 || cilen != CILEN_ADDR)
+ goto bad;
+ GETLONG(l, p);
+ try.winsaddr[0] = htonl(l);
+ try.req_wins1 = 1;
+ no.req_wins1 = 1;
+ break;
case CI_MS_WINS2:
- if (cilen != CILEN_ADDR)
+ if (go->req_wins2 || no.req_wins2 || cilen != CILEN_ADDR)
goto bad;
GETLONG(l, p);
- ciaddr1 = htonl(l);
- if (ciaddr1)
- try.winsaddr[citype == CI_MS_WINS2] = ciaddr1;
+ try.winsaddr[1] = htonl(l);
+ try.req_wins2 = 1;
+ no.req_wins2 = 1;
break;
}
p = next;