summaryrefslogtreecommitdiff
path: root/accel-pppd/ppp
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2015-02-27 22:04:44 +0300
committerDmitry Kozlov <xeb@mail.ru>2015-02-27 22:04:44 +0300
commit26a89d0fc3c2c015f68c80bddfdcbda963396271 (patch)
tree4ea571e7da025dd2a148bedffa17f6868154f981 /accel-pppd/ppp
parenta803c38139fc3e2bb218ea73afa00df9b33cbc14 (diff)
downloadaccel-ppp-26a89d0fc3c2c015f68c80bddfdcbda963396271.tar.gz
accel-ppp-26a89d0fc3c2c015f68c80bddfdcbda963396271.zip
ppp: set interface's ifndex after unit creating
Diffstat (limited to 'accel-pppd/ppp')
-rw-r--r--accel-pppd/ppp/ppp.c9
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;