OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
Line 557... | Line 557... | |||
557 | } |
557 | } |
|
558 | -#endif |
558 | -#endif |
|
559 | if (go->bsd_compress) { |
559 | if (go->bsd_compress) { |
|
560 | opt_buf[0] = CI_BSD_COMPRESS; |
560 | opt_buf[0] = CI_BSD_COMPRESS; |
|
561 | opt_buf[1] = CILEN_BSD_COMPRESS; |
561 | opt_buf[1] = CILEN_BSD_COMPRESS; |
|
562 | @@ -680,7 +815,8 @@ ccp_cilen(f) |
562 | @@ -679,7 +814,8 @@ ccp_cilen(f) |
|
563 | + (go->deflate && go->deflate_draft? CILEN_DEFLATE: 0) |
563 | + (go->deflate? CILEN_DEFLATE: 0) |
|
564 | + (go->predictor_1? CILEN_PREDICTOR_1: 0) |
564 | + (go->predictor_1? CILEN_PREDICTOR_1: 0) |
|
565 | + (go->predictor_2? CILEN_PREDICTOR_2: 0) |
565 | + (go->predictor_2? CILEN_PREDICTOR_2: 0) |
|
566 | - + (go->mppe? CILEN_MPPE: 0); |
566 | - + (go->mppe? CILEN_MPPE: 0); |
|
567 | + + (go->lzs? CILEN_LZS: 0) |
567 | + + (go->lzs? CILEN_LZS: 0) |
|
568 | + + ((go->mppe || go->mppc)? CILEN_MPPE: 0); |
568 | + + ((go->mppe || go->mppc)? CILEN_MPPE: 0); |
|
569 | } |
569 | } |
|
Line 570... | Line 570... | |||
570 | |
570 | |
|
571 | /* |
571 | /* |
|
572 | @@ -694,6 +830,8 @@ ccp_addci(f, p, lenp) |
572 | @@ -693,6 +829,8 @@ ccp_addci(f, p, lenp) |
|
573 | { |
573 | { |
|
574 | int res; |
574 | int res; |
|
575 | ccp_options *go = &ccp_gotoptions[f->unit]; |
575 | ccp_options *go = &ccp_gotoptions[f->unit]; |
|
576 | + ccp_options *ao = &ccp_allowoptions[f->unit]; |
576 | + ccp_options *ao = &ccp_allowoptions[f->unit]; |
|
577 | + ccp_options *wo = &ccp_wantoptions[f->unit]; |
577 | + ccp_options *wo = &ccp_wantoptions[f->unit]; |
|
Line 578... | Line 578... | |||
578 | u_char *p0 = p; |
578 | u_char *p0 = p; |
|
579 | |
579 | |
|
580 | /* |
580 | /* |
|
581 | @@ -702,22 +840,43 @@ ccp_addci(f, p, lenp) |
581 | @@ -701,22 +839,43 @@ ccp_addci(f, p, lenp) |
|
582 | * in case it gets Acked. |
582 | * in case it gets Acked. |
|
583 | */ |
583 | */ |
|
584 | #ifdef MPPE |
584 | #ifdef MPPE |
|
Line 629... | Line 629... | |||
629 | } |
629 | } |
|
630 | -#endif |
630 | -#endif |
|
631 | if (go->deflate) { |
631 | if (go->deflate) { |
|
632 | p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT; |
632 | p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT; |
|
633 | p[1] = CILEN_DEFLATE; |
633 | p[1] = CILEN_DEFLATE; |
|
634 | @@ -803,7 +962,7 @@ ccp_addci(f, p, lenp) |
634 | @@ -802,7 +961,7 @@ ccp_addci(f, p, lenp) |
|
Line 635... | Line 635... | |||
635 | |
635 | |
|
636 | /* |
636 | /* |
|
637 | * ccp_ackci - process a received configure-ack, and return |
637 | * ccp_ackci - process a received configure-ack, and return |
|
638 | - * 1 iff the packet was OK. |
638 | - * 1 iff the packet was OK. |
|
639 | + * 1 if the packet was OK. |
639 | + * 1 if the packet was OK. |
|
640 | */ |
640 | */ |
|
641 | static int |
641 | static int |
|
642 | ccp_ackci(f, p, len) |
642 | ccp_ackci(f, p, len) |
|
643 | @@ -812,24 +971,44 @@ ccp_ackci(f, p, len) |
643 | @@ -811,24 +970,44 @@ ccp_ackci(f, p, len) |
|
644 | int len; |
644 | int len; |
|
645 | { |
645 | { |
|
646 | ccp_options *go = &ccp_gotoptions[f->unit]; |
646 | ccp_options *go = &ccp_gotoptions[f->unit]; |
|
647 | + ccp_options *ao = &ccp_allowoptions[f->unit]; |
647 | + ccp_options *ao = &ccp_allowoptions[f->unit]; |
|
Line 692... | Line 692... | |||
692 | } |
692 | } |
|
693 | -#endif |
693 | -#endif |
|
694 | if (go->deflate) { |
694 | if (go->deflate) { |
|
695 | if (len < CILEN_DEFLATE |
695 | if (len < CILEN_DEFLATE |
|
696 | || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) |
696 | || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) |
|
697 | @@ -902,6 +1081,8 @@ ccp_nakci(f, p, len, treat_as_reject) |
697 | @@ -901,6 +1080,8 @@ ccp_nakci(f, p, len, treat_as_reject) |
|
698 | int treat_as_reject; |
698 | int treat_as_reject; |
|
699 | { |
699 | { |
|
700 | ccp_options *go = &ccp_gotoptions[f->unit]; |
700 | ccp_options *go = &ccp_gotoptions[f->unit]; |
|
701 | + ccp_options *ao = &ccp_allowoptions[f->unit]; |
701 | + ccp_options *ao = &ccp_allowoptions[f->unit]; |
|
702 | + ccp_options *wo = &ccp_wantoptions[f->unit]; |
702 | + ccp_options *wo = &ccp_wantoptions[f->unit]; |
|
703 | ccp_options no; /* options we've seen already */ |
703 | ccp_options no; /* options we've seen already */ |
|
704 | ccp_options try; /* options to ask for next time */ |
704 | ccp_options try; /* options to ask for next time */ |
|
Line 705... | Line 705... | |||
705 | |
705 | |
|
706 | @@ -909,28 +1090,100 @@ ccp_nakci(f, p, len, treat_as_reject) |
706 | @@ -908,28 +1089,100 @@ ccp_nakci(f, p, len, treat_as_reject) |
|
Line 707... | Line 707... | |||
707 | try = *go; |
707 | try = *go; |
|
708 | |
708 | |
|
709 | #ifdef MPPE |
709 | #ifdef MPPE |
|
Line 820... | Line 820... | |||
820 | + } |
820 | + } |
|
821 | + |
821 | + |
|
822 | if (go->deflate && len >= CILEN_DEFLATE |
822 | if (go->deflate && len >= CILEN_DEFLATE |
|
823 | && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) |
823 | && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) |
|
824 | && p[1] == CILEN_DEFLATE) { |
824 | && p[1] == CILEN_DEFLATE) { |
|
825 | @@ -1003,14 +1256,50 @@ ccp_rejci(f, p, len) |
825 | @@ -1002,14 +1255,50 @@ ccp_rejci(f, p, len) |
|
826 | return -1; |
826 | return -1; |
|
Line 827... | Line 827... | |||
827 | |
827 | |
|
828 | #ifdef MPPE |
828 | #ifdef MPPE |
|
829 | - if (go->mppe && len >= CILEN_MPPE |
829 | - if (go->mppe && len >= CILEN_MPPE |
|
Line 875... | Line 875... | |||
875 | + len -= CILEN_LZS; |
875 | + len -= CILEN_LZS; |
|
876 | + } |
876 | + } |
|
877 | if (go->deflate_correct && len >= CILEN_DEFLATE |
877 | if (go->deflate_correct && len >= CILEN_DEFLATE |
|
878 | && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { |
878 | && p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { |
|
879 | if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) |
879 | if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) |
|
880 | @@ -1074,14 +1363,15 @@ ccp_reqci(f, p, lenp, dont_nak) |
880 | @@ -1073,14 +1362,15 @@ ccp_reqci(f, p, lenp, dont_nak) |
|
881 | int dont_nak; |
881 | int dont_nak; |
|
882 | { |
882 | { |
|
883 | int ret, newret, res; |
883 | int ret, newret, res; |
|
884 | - u_char *p0, *retp; |
884 | - u_char *p0, *retp; |
|
885 | + u_char *p0, *retp, p2, p5; |
885 | + u_char *p0, *retp, p2, p5; |
|
Line 895... | Line 895... | |||
895 | +/* int mtu; */ |
895 | +/* int mtu; */ |
|
896 | +#endif /* MPPE */ |
896 | +#endif /* MPPE */ |
|
Line 897... | Line 897... | |||
897 | |
897 | |
|
898 | ret = CONFACK; |
898 | ret = CONFACK; |
|
899 | retp = p0 = p; |
899 | retp = p0 = p; |
|
900 | @@ -1104,106 +1394,302 @@ ccp_reqci(f, p, lenp, dont_nak) |
900 | @@ -1103,106 +1393,302 @@ ccp_reqci(f, p, lenp, dont_nak) |
|
901 | switch (type) { |
901 | switch (type) { |
|
902 | #ifdef MPPE |
902 | #ifdef MPPE |
|
903 | case CI_MPPE: |
903 | case CI_MPPE: |
|
904 | - if (!ao->mppe || clen != CILEN_MPPE) { |
904 | - if (!ao->mppe || clen != CILEN_MPPE) { |
|
Line 1291... | Line 1291... | |||
1291 | + } |
1291 | + } |
|
1292 | + break; |
1292 | + break; |
|
1293 | case CI_DEFLATE: |
1293 | case CI_DEFLATE: |
|
1294 | case CI_DEFLATE_DRAFT: |
1294 | case CI_DEFLATE_DRAFT: |
|
1295 | if (!ao->deflate || clen != CILEN_DEFLATE |
1295 | if (!ao->deflate || clen != CILEN_DEFLATE |
|
1296 | @@ -1345,12 +1831,6 @@ ccp_reqci(f, p, lenp, dont_nak) |
1296 | @@ -1344,12 +1830,6 @@ ccp_reqci(f, p, lenp, dont_nak) |
|
1297 | else |
1297 | else |
|
1298 | *lenp = retp - p0; |
1298 | *lenp = retp - p0; |
|
1299 | } |
1299 | } |
|
1300 | -#ifdef MPPE |
1300 | -#ifdef MPPE |
|
1301 | - if (ret == CONFREJ && ao->mppe && rej_for_ci_mppe) { |
1301 | - if (ret == CONFREJ && ao->mppe && rej_for_ci_mppe) { |
|
Line 1304... | Line 1304... | |||
1304 | - } |
1304 | - } |
|
1305 | -#endif |
1305 | -#endif |
|
1306 | return ret; |
1306 | return ret; |
|
1307 | } |
1307 | } |
|
Line 1308... | Line 1308... | |||
1308 | |
1308 | |
|
1309 | @@ -1372,24 +1852,35 @@ method_name(opt, opt2) |
1309 | @@ -1371,24 +1851,35 @@ method_name(opt, opt2) |
|
1310 | char *p = result; |
1310 | char *p = result; |
|
Line 1311... | Line 1311... | |||
1311 | char *q = result + sizeof(result); /* 1 past result */ |
1311 | char *q = result + sizeof(result); /* 1 past result */ |
|
1312 | |
1312 | |
|
Line 1356... | Line 1356... | |||
1356 | + case CI_LZS: |
1356 | + case CI_LZS: |
|
1357 | + return "Stac LZS"; |
1357 | + return "Stac LZS"; |
|
1358 | case CI_DEFLATE: |
1358 | case CI_DEFLATE: |
|
1359 | case CI_DEFLATE_DRAFT: |
1359 | case CI_DEFLATE_DRAFT: |
|
1360 | if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) |
1360 | if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) |
|
1361 | @@ -1445,12 +1936,12 @@ ccp_up(f) |
1361 | @@ -1444,12 +1935,12 @@ ccp_up(f) |
|
1362 | } else if (ANY_COMPRESS(*ho)) |
1362 | } else if (ANY_COMPRESS(*ho)) |
|
1363 | notice("%s transmit compression enabled", method_name(ho, NULL)); |
1363 | notice("%s transmit compression enabled", method_name(ho, NULL)); |
|
1364 | #ifdef MPPE |
1364 | #ifdef MPPE |
|
1365 | - if (go->mppe) { |
1365 | - if (go->mppe) { |
|
1366 | + if (go->mppe || go->mppc) { |
1366 | + if (go->mppe || go->mppc) { |
|
Line 1371... | Line 1371... | |||
1371 | -#endif |
1371 | -#endif |
|
1372 | +#endif /* MPPE */ |
1372 | +#endif /* MPPE */ |
|
1373 | } |
1373 | } |
|
Line 1374... | Line 1374... | |||
1374 | |
1374 | |
|
1375 | /* |
1375 | /* |
|
1376 | @@ -1473,7 +1964,7 @@ ccp_down(f) |
1376 | @@ -1472,7 +1963,7 @@ ccp_down(f) |
|
1377 | lcp_close(f->unit, "MPPE disabled"); |
1377 | lcp_close(f->unit, "MPPE disabled"); |
|
1378 | } |
1378 | } |
|
1379 | } |
1379 | } |
|
1380 | -#endif |
1380 | -#endif |
|
1381 | +#endif /* MPPE */ |
1381 | +#endif /* MPPE */ |
|
Line 1382... | Line 1382... | |||
1382 | } |
1382 | } |
|
1383 | |
1383 | |
|
1384 | /* |
1384 | /* |
|
1385 | @@ -1533,24 +2024,28 @@ ccp_printpkt(p, plen, printer, arg) |
1385 | @@ -1532,24 +2023,28 @@ ccp_printpkt(p, plen, printer, arg) |
|
1386 | #ifdef MPPE |
1386 | #ifdef MPPE |
|
1387 | case CI_MPPE: |
1387 | case CI_MPPE: |
|
1388 | if (optlen >= CILEN_MPPE) { |
1388 | if (optlen >= CILEN_MPPE) { |
|
Line 1421... | Line 1421... | |||
1421 | + } |
1421 | + } |
|
1422 | + break; |
1422 | + break; |
|
1423 | case CI_DEFLATE: |
1423 | case CI_DEFLATE: |
|
1424 | case CI_DEFLATE_DRAFT: |
1424 | case CI_DEFLATE_DRAFT: |
|
1425 | if (optlen >= CILEN_DEFLATE) { |
1425 | if (optlen >= CILEN_DEFLATE) { |
|
1426 | @@ -1636,6 +2131,7 @@ ccp_datainput(unit, pkt, len) |
1426 | @@ -1635,6 +2130,7 @@ ccp_datainput(unit, pkt, len) |
|
1427 | error("Lost compression sync: disabling compression"); |
1427 | error("Lost compression sync: disabling compression"); |
|
1428 | ccp_close(unit, "Lost compression sync"); |
1428 | ccp_close(unit, "Lost compression sync"); |
|
1429 | #ifdef MPPE |
1429 | #ifdef MPPE |
|
1430 | + /* My module dosn't need this. J.D., 2003-07-06 */ |
1430 | + /* My module dosn't need this. J.D., 2003-07-06 */ |
|
1431 | /* |
1431 | /* |
|
1432 | * If we were doing MPPE, we must also take the link down. |
1432 | * If we were doing MPPE, we must also take the link down. |
|
1433 | */ |
1433 | */ |
|
1434 | @@ -1643,9 +2139,18 @@ ccp_datainput(unit, pkt, len) |
1434 | @@ -1642,9 +2138,18 @@ ccp_datainput(unit, pkt, len) |
|
1435 | error("Too many MPPE errors, closing LCP"); |
1435 | error("Too many MPPE errors, closing LCP"); |
|
1436 | lcp_close(unit, "Too many MPPE errors"); |
1436 | lcp_close(unit, "Too many MPPE errors"); |
|
1437 | } |
1437 | } |
|
1438 | -#endif |
1438 | -#endif |
|
1439 | +#endif /* MPPE */ |
1439 | +#endif /* MPPE */ |
|
Line 1457... | Line 1457... | |||
1457 | bool predictor_2; /* do Predictor-2? */ |
1457 | bool predictor_2; /* do Predictor-2? */ |
|
1458 | bool deflate_correct; /* use correct code for deflate? */ |
1458 | bool deflate_correct; /* use correct code for deflate? */ |
|
1459 | bool deflate_draft; /* use draft RFC code for deflate? */ |
1459 | bool deflate_draft; /* use draft RFC code for deflate? */ |
|
1460 | + bool lzs; /* do Stac LZS? */ |
1460 | + bool lzs; /* do Stac LZS? */ |
|
1461 | + bool mppc; /* do MPPC? */ |
1461 | + bool mppc; /* do MPPC? */ |
|
1462 | u_char mppe; /* MPPE bitfield */ |
1462 | bool mppe; /* do MPPE? */ |
|
1463 | + bool mppe_40; /* allow 40 bit encryption? */ |
1463 | + bool mppe_40; /* allow 40 bit encryption? */ |
|
1464 | + bool mppe_56; /* allow 56 bit encryption? */ |
1464 | + bool mppe_56; /* allow 56 bit encryption? */ |
|
1465 | + bool mppe_128; /* allow 128 bit encryption? */ |
1465 | + bool mppe_128; /* allow 128 bit encryption? */ |
|
1466 | + bool mppe_stateless; /* allow stateless encryption */ |
1466 | + bool mppe_stateless; /* allow stateless encryption */ |
|
1467 | u_short bsd_bits; /* # bits/code for BSD Compress */ |
1467 | u_short bsd_bits; /* # bits/code for BSD Compress */ |