diff options
-rw-r--r-- | accel-pppd/ppp/ppp.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/accel-pppd/ppp/ppp.c b/accel-pppd/ppp/ppp.c index fec330ff..bed84ab6 100644 --- a/accel-pppd/ppp/ppp.c +++ b/accel-pppd/ppp/ppp.c @@ -189,11 +189,20 @@ int __export connect_ppp_channel(struct ppp_t *ppp) 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; } + if (ioctl(sock_fd, SIOCGIFINDEX, &ifr)) { + log_ppp_error("ioctl(SIOCGIFINDEX): %s\n", strerror(errno)); + goto exit_close_unit; + } + ppp->ses.ifindex = ifr.ifr_ifindex; + + ap_session_set_ifindex(&ppp->ses); + ppp->unit_hnd.fd = ppp->unit_fd; ppp->unit_hnd.read = ppp_unit_read; |