From 44d70d146370ba2bb88ab0c8d2fad60deca696ab Mon Sep 17 00:00:00 2001 From: François Cachereul Date: Tue, 27 Jan 2015 12:06:58 +0100 Subject: ppp: set mtu and mru after unit creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the following patch PPP unit will be created after MRU negotation. Signed-off-by: François Cachereul --- accel-pppd/ppp/ppp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'accel-pppd/ppp/ppp.c') diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c index 9772b84..2bc0ab3 100644 --- a/accel-pppd/ppp/ppp.c +++ b/accel-pppd/ppp/ppp.c @@ -77,6 +77,7 @@ void __export ppp_init(struct ppp_t *ppp) int __export establish_ppp(struct ppp_t *ppp) { struct pppunit_cache *uc = NULL; + struct ifreq ifr; if (ap_shutdown) return -1; @@ -149,6 +150,17 @@ int __export establish_ppp(struct ppp_t *ppp) log_ppp_info1("connect: %s <--> %s(%s)\n", ppp->ses.ifname, ppp->ses.ctrl->name, ppp->ses.chan_name); + ifr.ifr_mtu = ppp->mtu; + strcpy(ifr.ifr_name, ppp->ses.ifname); + if (ioctl(sock_fd, SIOCSIFMTU, &ifr)) { + log_ppp_error("failed to set MTU: %s\n", strerror(errno)); + goto exit_close_unit; + } + if (ioctl(ppp->unit_fd, PPPIOCSMRU, &ppp->mru)) { + log_ppp_error("failed to set MRU: %s\n", strerror(errno)); + goto exit_close_unit; + } + init_layers(ppp); if (list_empty(&ppp->layers)) { -- cgit v1.2.3