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/lcp_opt_mru.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/lcp_opt_mru.c')
-rw-r--r-- | accel-pppd/ppp/lcp_opt_mru.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/accel-pppd/ppp/lcp_opt_mru.c b/accel-pppd/ppp/lcp_opt_mru.c index c944331..9a28817 100644 --- a/accel-pppd/ppp/lcp_opt_mru.c +++ b/accel-pppd/ppp/lcp_opt_mru.c @@ -111,27 +111,20 @@ static int mru_recv_conf_req(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, ui return LCP_OPT_NAK; mru_opt->mtu = ntohs(opt16->val); + lcp->ppp->mtu = mru_opt->mtu; + return LCP_OPT_ACK; } static int mru_recv_conf_ack(struct ppp_lcp_t *lcp, struct lcp_option_t *opt, uint8_t *ptr) { struct mru_option_t *mru_opt = container_of(opt,typeof(*mru_opt), opt); - struct ifreq ifr = { - .ifr_mtu = mru_opt->mtu, - }; - - strcpy(ifr.ifr_name, lcp->ppp->ses.ifname); if (ioctl(lcp->ppp->chan_fd, PPPIOCSMRU, &mru_opt->mru) && errno != EIO && errno != ENOTTY) log_ppp_error("lcp:mru: failed to set channel MRU: %s\n", strerror(errno)); - if (ioctl(lcp->ppp->unit_fd, PPPIOCSMRU, &mru_opt->mru)) - log_ppp_error("lcp:mru: failed to set MRU: %s\n", strerror(errno)); - - if (ioctl(sock_fd, SIOCSIFMTU, &ifr)) - log_ppp_error("lcp:mru: failed to set MTU: %s\n", strerror(errno)); + lcp->ppp->mru = mru_opt->mru; return 0; } |