[package] update ppp to v2.4.4 (#5102)
[openwrt/svn-archive/archive.git] / package / ppp / patches / 108-debian_pppatm_fix_mtu.patch
1 diff -Naur ppp-2.4.4.orig/pppd/plugins/pppoatm/pppoatm.c ppp-2.4.4/pppd/plugins/pppoatm/pppoatm.c
2 --- ppp-2.4.4.orig/pppd/plugins/pppoatm/pppoatm.c 2009-05-07 16:23:41.000000000 -0400
3 +++ ppp-2.4.4/pppd/plugins/pppoatm/pppoatm.c 2009-05-07 16:23:57.000000000 -0400
4 @@ -179,8 +179,11 @@
5 int sock;
6 struct ifreq ifr;
7
8 - if (mtu > pppoatm_max_mtu)
9 - error("Couldn't increase MTU to %d", mtu);
10 + if (pppoatm_max_mtu && mtu > pppoatm_max_mtu) {
11 + warn("Couldn't increase MTU to %d. Using %d",
12 + mtu, pppoatm_max_mtu);
13 + mtu = pppoatm_max_mtu;
14 + }
15
16 sock = socket(AF_INET, SOCK_DGRAM, 0);
17 if (sock < 0)
18 @@ -198,8 +201,11 @@
19 int pcomp,
20 int accomp)
21 {
22 - if (mru > pppoatm_max_mru)
23 - error("Couldn't increase MRU to %d", mru);
24 + if (pppoatm_max_mru && mru > pppoatm_max_mru) {
25 + warn("Couldn't increase MRU to %d. Using %d",
26 + mru, pppoatm_max_mru);
27 + mru = pppoatm_max_mru;
28 + }
29 }
30
31 void plugin_init(void)
32 diff -Naur ppp-2.4.4.orig/pppd/plugins/pppoatm/pppoatm.c ppp-2.4.4/pppd/plugins/pppoatm/pppoatm.c
33 --- ppp-2.4.4.orig/pppd/plugins/pppoatm/pppoatm.c 2009-05-07 16:23:41.000000000 -0400
34 +++ ppp-2.4.4/pppd/plugins/pppoatm/pppoatm.c 2009-05-07 16:23:57.000000000 -0400
35 @@ -179,8 +179,11 @@
36 int sock;
37 struct ifreq ifr;
38
39 - if (mtu > pppoatm_max_mtu)
40 - error("Couldn't increase MTU to %d", mtu);
41 + if (pppoatm_max_mtu && mtu > pppoatm_max_mtu) {
42 + warn("Couldn't increase MTU to %d. Using %d",
43 + mtu, pppoatm_max_mtu);
44 + mtu = pppoatm_max_mtu;
45 + }
46
47 sock = socket(AF_INET, SOCK_DGRAM, 0);
48 if (sock < 0)
49 @@ -198,8 +201,11 @@
50 int pcomp,
51 int accomp)
52 {
53 - if (mru > pppoatm_max_mru)
54 - error("Couldn't increase MRU to %d", mru);
55 + if (pppoatm_max_mru && mru > pppoatm_max_mru) {
56 + warn("Couldn't increase MRU to %d. Using %d",
57 + mru, pppoatm_max_mru);
58 + mru = pppoatm_max_mru;
59 + }
60 }
61
62 void plugin_init(void)