summaryrefslogtreecommitdiff
path: root/accel-pppd/ifcfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pppd/ifcfg.c')
-rw-r--r--accel-pppd/ifcfg.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/accel-pppd/ifcfg.c b/accel-pppd/ifcfg.c
index 127d776..ea1ac2f 100644
--- a/accel-pppd/ifcfg.c
+++ b/accel-pppd/ifcfg.c
@@ -70,11 +70,21 @@ void ap_session_ifup(struct ap_session *ses)
triton_event_fire(EV_SES_PRE_UP, ses);
if (ses->stop_time)
return;
+
+ memset(&ifr, 0, sizeof(ifr));
+ strcpy(ifr.ifr_name, ses->ifname);
- if (!ses->ctrl->dont_ifcfg) {
- memset(&ifr, 0, sizeof(ifr));
- strcpy(ifr.ifr_name, ses->ifname);
+ if (ses->ctrl->dont_ifcfg) {
+ if (ioctl(sock_fd, SIOCGIFFLAGS, &ifr))
+ log_ppp_error("failed to get interface flags: %s\n", strerror(errno));
+
+ if (!(ifr.ifr_flags & IFF_UP)) {
+ ifr.ifr_flags |= IFF_UP;
+ if (ioctl(sock_fd, SIOCSIFFLAGS, &ifr))
+ log_ppp_error("failed to set interface flags: %s\n", strerror(errno));
+ }
+ } else {
#ifdef USE_BACKUP
if (!ses->backup || !ses->backup->internal) {
#endif