diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2013-04-22 20:53:38 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2013-04-22 20:53:38 +0400 |
commit | fc503382df18bf579375ee22d78184d7dcfaea9e (patch) | |
tree | 151c4872214c7b328f684da7ff8718eef99e6caa /accel-pppd/ifcfg.c | |
parent | 2a2012bec51d58b05f508f0c79819d48392824ea (diff) | |
download | accel-ppp-fc503382df18bf579375ee22d78184d7dcfaea9e.tar.gz accel-ppp-fc503382df18bf579375ee22d78184d7dcfaea9e.zip |
ipoe: start dhcp socket on ipoe interfaces for unicast dhcp messages
Diffstat (limited to 'accel-pppd/ifcfg.c')
-rw-r--r-- | accel-pppd/ifcfg.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/accel-pppd/ifcfg.c b/accel-pppd/ifcfg.c index 127d776d..ea1ac2f9 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 |