| 99 |
/* |
/* |
| 100 |
* Definitions for other, as yet unsupported, compression methods. |
* Definitions for other, as yet unsupported, compression methods. |
| 101 |
*/ |
*/ |
| 102 |
diff -ruN ppp-2.4.3.orig/pppd/ccp.c ppp-2.4.3/pppd/ccp.c |
--- ppp-2.4.4/pppd/ccp.c.orig 2005-07-09 02:23:05.000000000 +0200 |
| 103 |
--- ppp-2.4.3.orig/pppd/ccp.c 2004-11-13 03:28:15.000000000 +0100 |
+++ ppp-2.4.4/pppd/ccp.c 2006-07-21 23:34:12.121546000 +0200 |
|
+++ ppp-2.4.3/pppd/ccp.c 2004-11-21 13:54:09.000000000 +0100 |
|
| 104 |
@@ -62,12 +62,10 @@ |
@@ -62,12 +62,10 @@ |
| 105 |
static char bsd_value[8]; |
static char bsd_value[8]; |
| 106 |
static char deflate_value[8]; |
static char deflate_value[8]; |
| 716 |
*/ |
*/ |
| 717 |
static int |
static int |
| 718 |
ccp_nakci(f, p, len, treat_as_reject) |
ccp_nakci(f, p, len, treat_as_reject) |
| 719 |
@@ -900,6 +1079,8 @@ |
@@ -901,6 +1080,8 @@ |
| 720 |
int len; |
int treat_as_reject; |
| 721 |
{ |
{ |
| 722 |
ccp_options *go = &ccp_gotoptions[f->unit]; |
ccp_options *go = &ccp_gotoptions[f->unit]; |
| 723 |
+ ccp_options *ao = &ccp_allowoptions[f->unit]; |
+ ccp_options *ao = &ccp_allowoptions[f->unit]; |
| 725 |
ccp_options no; /* options we've seen already */ |
ccp_options no; /* options we've seen already */ |
| 726 |
ccp_options try; /* options to ask for next time */ |
ccp_options try; /* options to ask for next time */ |
| 727 |
|
|
| 728 |
@@ -907,28 +1088,100 @@ |
@@ -908,28 +1089,100 @@ |
| 729 |
try = *go; |
try = *go; |
| 730 |
|
|
| 731 |
#ifdef MPPE |
#ifdef MPPE |
| 844 |
if (go->deflate && len >= CILEN_DEFLATE |
if (go->deflate && len >= CILEN_DEFLATE |
| 845 |
&& p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) |
&& p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) |
| 846 |
&& p[1] == CILEN_DEFLATE) { |
&& p[1] == CILEN_DEFLATE) { |
| 847 |
@@ -1001,14 +1254,50 @@ |
@@ -1002,14 +1255,50 @@ |
| 848 |
return -1; |
return -1; |
| 849 |
|
|
| 850 |
#ifdef MPPE |
#ifdef MPPE |
| 899 |
if (go->deflate_correct && len >= CILEN_DEFLATE |
if (go->deflate_correct && len >= CILEN_DEFLATE |
| 900 |
&& p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { |
&& p[0] == CI_DEFLATE && p[1] == CILEN_DEFLATE) { |
| 901 |
if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) |
if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) |
| 902 |
@@ -1072,14 +1361,15 @@ |
@@ -1073,14 +1362,15 @@ |
| 903 |
int dont_nak; |
int dont_nak; |
| 904 |
{ |
{ |
| 905 |
int ret, newret, res; |
int ret, newret, res; |
| 919 |
|
|
| 920 |
ret = CONFACK; |
ret = CONFACK; |
| 921 |
retp = p0 = p; |
retp = p0 = p; |
| 922 |
@@ -1102,103 +1392,305 @@ |
@@ -1103,106 +1393,307 @@ |
| 923 |
switch (type) { |
switch (type) { |
| 924 |
#ifdef MPPE |
#ifdef MPPE |
| 925 |
case CI_MPPE: |
case CI_MPPE: |
| 1181 |
} |
} |
| 1182 |
} else { |
} else { |
| 1183 |
- /* Neither are set. */ |
- /* Neither are set. */ |
| 1184 |
|
- /* We cannot accept this. */ |
| 1185 |
+ /* MPPE is not compatible with other compression types */ |
+ /* MPPE is not compatible with other compression types */ |
| 1186 |
+ if (wo->mppe) { |
+ if (wo->mppe) { |
| 1187 |
+ ao->bsd_compress = 0; |
+ ao->bsd_compress = 0; |
| 1194 |
+ if ((!ho->mppc || !ao->mppc) && !ho->mppe) { |
+ if ((!ho->mppc || !ao->mppc) && !ho->mppe) { |
| 1195 |
+ p[2] = p2; |
+ p[2] = p2; |
| 1196 |
+ p[5] = p5; |
+ p[5] = p5; |
| 1197 |
newret = CONFREJ; |
newret = CONFNAK; |
| 1198 |
break; |
/* Give the peer our idea of what can be used, |
| 1199 |
|
so it can choose and confirm */ |
| 1200 |
|
ho->mppe = ao->mppe; |
| 1201 |
} |
} |
| 1202 |
|
|
| 1203 |
- /* rebuild the opts */ |
- /* rebuild the opts */ |
| 1300 |
case CI_DEFLATE: |
case CI_DEFLATE: |
| 1301 |
case CI_DEFLATE_DRAFT: |
case CI_DEFLATE_DRAFT: |
| 1302 |
if (!ao->deflate || clen != CILEN_DEFLATE |
if (!ao->deflate || clen != CILEN_DEFLATE |
| 1303 |
@@ -1340,12 +1832,6 @@ |
@@ -1344,12 +1835,6 @@ |
| 1304 |
else |
else |
| 1305 |
*lenp = retp - p0; |
*lenp = retp - p0; |
| 1306 |
} |
} |
| 1313 |
return ret; |
return ret; |
| 1314 |
} |
} |
| 1315 |
|
|
| 1316 |
@@ -1367,24 +1853,35 @@ |
@@ -1371,24 +1856,35 @@ |
| 1317 |
char *p = result; |
char *p = result; |
| 1318 |
char *q = result + sizeof(result); /* 1 past result */ |
char *q = result + sizeof(result); /* 1 past result */ |
| 1319 |
|
|
| 1365 |
case CI_DEFLATE: |
case CI_DEFLATE: |
| 1366 |
case CI_DEFLATE_DRAFT: |
case CI_DEFLATE_DRAFT: |
| 1367 |
if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) |
if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) |
| 1368 |
@@ -1440,12 +1937,12 @@ |
@@ -1444,12 +1940,12 @@ |
| 1369 |
} else if (ANY_COMPRESS(*ho)) |
} else if (ANY_COMPRESS(*ho)) |
| 1370 |
notice("%s transmit compression enabled", method_name(ho, NULL)); |
notice("%s transmit compression enabled", method_name(ho, NULL)); |
| 1371 |
#ifdef MPPE |
#ifdef MPPE |
| 1380 |
} |
} |
| 1381 |
|
|
| 1382 |
/* |
/* |
| 1383 |
@@ -1468,7 +1965,7 @@ |
@@ -1472,7 +1968,7 @@ |
| 1384 |
lcp_close(f->unit, "MPPE disabled"); |
lcp_close(f->unit, "MPPE disabled"); |
| 1385 |
} |
} |
| 1386 |
} |
} |
| 1389 |
} |
} |
| 1390 |
|
|
| 1391 |
/* |
/* |
| 1392 |
@@ -1528,24 +2025,28 @@ |
@@ -1532,24 +2028,28 @@ |
| 1393 |
#ifdef MPPE |
#ifdef MPPE |
| 1394 |
case CI_MPPE: |
case CI_MPPE: |
| 1395 |
if (optlen >= CILEN_MPPE) { |
if (optlen >= CILEN_MPPE) { |
| 1430 |
case CI_DEFLATE: |
case CI_DEFLATE: |
| 1431 |
case CI_DEFLATE_DRAFT: |
case CI_DEFLATE_DRAFT: |
| 1432 |
if (optlen >= CILEN_DEFLATE) { |
if (optlen >= CILEN_DEFLATE) { |
| 1433 |
@@ -1631,6 +2132,7 @@ |
@@ -1635,6 +2135,7 @@ |
| 1434 |
error("Lost compression sync: disabling compression"); |
error("Lost compression sync: disabling compression"); |
| 1435 |
ccp_close(unit, "Lost compression sync"); |
ccp_close(unit, "Lost compression sync"); |
| 1436 |
#ifdef MPPE |
#ifdef MPPE |
| 1438 |
/* |
/* |
| 1439 |
* If we were doing MPPE, we must also take the link down. |
* If we were doing MPPE, we must also take the link down. |
| 1440 |
*/ |
*/ |
| 1441 |
@@ -1638,9 +2140,18 @@ |
@@ -1642,9 +2143,18 @@ |
| 1442 |
error("Too many MPPE errors, closing LCP"); |
error("Too many MPPE errors, closing LCP"); |
| 1443 |
lcp_close(unit, "Too many MPPE errors"); |
lcp_close(unit, "Too many MPPE errors"); |
| 1444 |
} |
} |
| 1458 |
* Send a reset-request to reset the peer's compressor. |
* Send a reset-request to reset the peer's compressor. |
| 1459 |
* We don't do that if we are still waiting for an |
* We don't do that if we are still waiting for an |
| 1460 |
* acknowledgement to a previous reset-request. |
* acknowledgement to a previous reset-request. |
| 1461 |
@@ -1671,4 +2182,3 @@ |
@@ -1675,4 +2185,3 @@ |
| 1462 |
} else |
} else |
| 1463 |
ccp_localstate[f->unit] &= ~RACK_PENDING; |
ccp_localstate[f->unit] &= ~RACK_PENDING; |
| 1464 |
} |
} |