diff options
author | François Cachereul <f.cachereul@alphalink.fr> | 2015-01-27 12:06:58 +0100 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2015-02-20 11:21:41 +0300 |
commit | 44d70d146370ba2bb88ab0c8d2fad60deca696ab (patch) | |
tree | 913e1444dfa35ad1a847e137fda5d56b696fb2f7 /accel-pppd/ppp/ppp.c | |
parent | bb92e3829330860b75ce6a5882bf10930da9ba52 (diff) | |
download | accel-ppp-44d70d146370ba2bb88ab0c8d2fad60deca696ab.tar.gz accel-ppp-44d70d146370ba2bb88ab0c8d2fad60deca696ab.zip |
ppp: set mtu and mru after unit creation
In the following patch PPP unit will be created after MRU negotation.
Signed-off-by: François Cachereul <f.cachereul@alphalink.fr>
Diffstat (limited to 'accel-pppd/ppp/ppp.c')
-rw-r--r-- | accel-pppd/ppp/ppp.c | 12 |
1 files changed, 12 insertions, 0 deletions
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)) { |