9977f0193d6a6c11b9ea8f17432a69a9a665568d
[openwrt/svn-archive/archive.git] / package / ppp / patches / 207-lcp_mtu_max.patch
1 diff -Naur ppp-2.4.4.orig/pppd/lcp.c ppp-2.4.4/pppd/lcp.c
2 --- ppp-2.4.4.orig/pppd/lcp.c 2009-05-07 22:24:09.000000000 -0400
3 +++ ppp-2.4.4/pppd/lcp.c 2009-05-07 22:26:57.000000000 -0400
4 @@ -1904,12 +1904,12 @@
5 * the interface MTU is set to the lowest of that, the
6 * MTU we want to use, and our link MRU.
7 */
8 - mtu = ho->neg_mru? ho->mru: PPP_MRU;
9 + mtu = MIN(ho->neg_mru? ho->mru: PPP_MRU, ao->mru);
10 mru = go->neg_mru? MAX(wo->mru, go->mru): PPP_MRU;
11 #ifdef HAVE_MULTILINK
12 if (!(multilink && go->neg_mrru && ho->neg_mrru))
13 #endif /* HAVE_MULTILINK */
14 - netif_set_mtu(f->unit, MIN(MIN(mtu, mru), ao->mru));
15 + netif_set_mtu(f->unit, MIN(mtu, mru));
16 ppp_send_config(f->unit, mtu,
17 (ho->neg_asyncmap? ho->asyncmap: 0xffffffff),
18 ho->neg_pcompression, ho->neg_accompression);
19 diff -Naur ppp-2.4.4.orig/pppd/lcp.c ppp-2.4.4/pppd/lcp.c
20 --- ppp-2.4.4.orig/pppd/lcp.c 2009-05-07 22:24:09.000000000 -0400
21 +++ ppp-2.4.4/pppd/lcp.c 2009-05-07 22:26:57.000000000 -0400
22 @@ -1904,12 +1904,12 @@
23 * the interface MTU is set to the lowest of that, the
24 * MTU we want to use, and our link MRU.
25 */
26 - mtu = ho->neg_mru? ho->mru: PPP_MRU;
27 + mtu = MIN(ho->neg_mru? ho->mru: PPP_MRU, ao->mru);
28 mru = go->neg_mru? MAX(wo->mru, go->mru): PPP_MRU;
29 #ifdef HAVE_MULTILINK
30 if (!(multilink && go->neg_mrru && ho->neg_mrru))
31 #endif /* HAVE_MULTILINK */
32 - netif_set_mtu(f->unit, MIN(MIN(mtu, mru), ao->mru));
33 + netif_set_mtu(f->unit, MIN(mtu, mru));
34 ppp_send_config(f->unit, mtu,
35 (ho->neg_asyncmap? ho->asyncmap: 0xffffffff),
36 ho->neg_pcompression, ho->neg_accompression);