Add mp_mrru option

Some equipments seem not able to actually put options in Configure-Reject
messages, so we then have to disable MRRU by hand.
This commit is contained in:
Samuel Thibault 2022-11-03 13:27:51 +01:00
parent b3b5fc5c59
commit 8e7bfa9a77
6 changed files with 29 additions and 4 deletions

View file

@ -129,6 +129,7 @@ config_descriptt config_values[] = {
CONFIG("random_device", random_device, STRING),
CONFIG("l2tp_secret", l2tp_secret, STRING),
CONFIG("l2tp_mtu", l2tp_mtu, INT),
CONFIG("mp_mrru", mp_mrru, INT),
CONFIG("ppp_restart_time", ppp_restart_time, INT),
CONFIG("ppp_max_configure", ppp_max_configure, INT),
CONFIG("ppp_max_failure", ppp_max_failure, INT),
@ -3285,8 +3286,11 @@ void processudp(uint8_t *buf, int len, struct sockaddr_in *addr, uint16_t indexu
sess_local[s].ppp_mru = MRU;
// Set multilink options before sending initial LCP packet
sess_local[s].mp_mrru = 1614;
sess_local[s].mp_epdis = ntohl(config->iftun_address ? config->iftun_address : my_address);
sess_local[s].mp_mrru = config->mp_mrru;
if (config->mp_mrru)
sess_local[s].mp_epdis = ntohl(config->iftun_address ? config->iftun_address : my_address);
else
sess_local[s].mp_epdis = 0;
sendlcp(s, t);
change_state(s, lcp, RequestSent);
@ -5393,6 +5397,8 @@ static void update_config()
else if (config->l2tp_mtu < MINMTU) config->l2tp_mtu = MINMTU;
else if (config->l2tp_mtu > MAXMTU) config->l2tp_mtu = MAXMTU;
if (config->mp_mrru < 0) config->mp_mrru = 1614; // default
// reset MRU/MSS globals
MRU = config->l2tp_mtu - L2TP_HDRS;
if (MRU > PPPoE_MRU)