1 pppd: Cap MTU to the user configured value
3 This patchs caps the calculated MTU value in lcp.c to the user specified "mru"
4 option value. Without this patch pppd would advertise a different MTU value
5 compared to what is set on the local interface in some cases.
7 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
11 @@ -1917,12 +1917,12 @@ lcp_up(f)
12 * the interface MTU is set to the lowest of that, the
13 * MTU we want to use, and our link MRU.
15 - mtu = ho->neg_mru? ho->mru: PPP_MRU;
16 + mtu = MIN(ho->neg_mru? ho->mru: PPP_MRU, ao->mru);
17 mru = go->neg_mru? MAX(wo->mru, go->mru): PPP_MRU;
19 if (!(multilink && go->neg_mrru && ho->neg_mrru))
20 #endif /* HAVE_MULTILINK */
21 - netif_set_mtu(f->unit, MIN(MIN(mtu, mru), ao->mru));
22 + netif_set_mtu(f->unit, MIN(mtu, mru));
23 ppp_send_config(f->unit, mtu,
24 (ho->neg_asyncmap? ho->asyncmap: 0xffffffff),
25 ho->neg_pcompression, ho->neg_accompression);