Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pppd/fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,12 +762,13 @@ void
fsm_sdata(fsm *f, int code, int id, u_char *data, int datalen)
{
u_char *outp;
int outlen;
int outlen, mtu;

/* Adjust length to be smaller than MTU */
outp = outpacket_buf;
if (datalen > peer_mru[f->unit] - HEADERLEN)
datalen = peer_mru[f->unit] - HEADERLEN;
mtu = MIN(peer_mru[f->unit], PPP_MRU) - HEADERLEN;
if (datalen > mtu)
datalen = mtu;
if (datalen && data != outp + PPP_HDRLEN + HEADERLEN)
BCOPY(data, outp + PPP_HDRLEN + HEADERLEN, datalen);
outlen = datalen + HEADERLEN;
Expand Down
5 changes: 3 additions & 2 deletions pppd/ipcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1709,13 +1709,14 @@ ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree)
/*
* If we aren't rejecting this packet, and we want to negotiate
* their address, and they didn't send their address, then we
* send a NAK with a CI_ADDR option appended. We assume the
* send a NAK with a CI_ADDR option appended. We check that the
* input buffer is long enough that we can append the extra
* option safely.
*/
if (rc != CONFREJ && !ho->neg_addr && !ho->old_addrs &&
wo->req_addr && !reject_if_disagree &&
((wo->hisaddr && !wo->accept_remote) || !noremoteip)) {
((wo->hisaddr && !wo->accept_remote) || !noremoteip) &&
(rc == CONFACK || ucp + CILEN_ADDR <= inp + PPP_MRU - HEADERLEN)) {
if (rc == CONFACK) {
rc = CONFNAK;
ucp = inp; /* reset pointer */
Expand Down
Loading