X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/4caf4199d170130c6c9eb4665629604ec67a9d98..c2c2dfbe65d1e5a718fe8c8ce8d89dbf795fa7b4:/ppp.c?ds=sidebyside diff --git a/ppp.c b/ppp.c index d2411a6..d7770e5 100644 --- a/ppp.c +++ b/ppp.c @@ -1,6 +1,6 @@ // L2TPNS PPP Stuff -char const *cvs_id_ppp = "$Id: ppp.c,v 1.85 2005/11/04 14:41:50 bodea Exp $"; +char const *cvs_id_ppp = "$Id: ppp.c,v 1.87 2005/12/04 13:06:50 bodea Exp $"; #include #include @@ -575,7 +575,18 @@ void processlcp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l) switch (type) { case 1: // Maximum-Receive-Unit - session[s].mru = ntohs(*(uint16_t *)(o + 2)); + { + uint16_t mru = ntohs(*(uint16_t *)(o + 2)); + if (mru >= 576) + { + session[s].mru = mru; + break; + } + + LOG(3, s, t, " Remote requesting MRU of %u. Rejecting.\n", mru); + mru = htons(MRU); + q = ppp_conf_nak(s, b, sizeof(b), PPPLCP, &response, q, p, o, (uint8_t *) &mru, sizeof(mru)); + } break; case 2: // Async-Control-Character-Map @@ -1026,7 +1037,7 @@ void processipcp(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l) case 131: // secondary DNS if (o[1] != 6 || o[1] > length) return; - addr = htonl(session[s].dns1); + addr = htonl(session[s].dns2); if (memcmp(o + 2, &addr, sizeof(addr))) { q = ppp_conf_nak(s, b, sizeof(b), PPPIPCP, &response, q, p, o, (uint8_t *) &addr, sizeof(addr));