summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/ipoe
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2013-06-13 22:21:32 +0400
committerDmitry Kozlov <xeb@mail.ru>2013-06-13 22:21:32 +0400
commitf94444646b54259c11dc7e8dbebdcf834a0250cc (patch)
tree87c3098b4a5d843de445228d0725adadfe2b0eb5 /accel-pppd/ctrl/ipoe
parent338e86560f0bb991852f977ff5376a2d9fb71b20 (diff)
downloadaccel-ppp-f94444646b54259c11dc7e8dbebdcf834a0250cc.tar.gz
accel-ppp-f94444646b54259c11dc7e8dbebdcf834a0250cc.zip
ipoe: introduced 'proto' option that will be used for inserted routes
Diffstat (limited to 'accel-pppd/ctrl/ipoe')
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index ac971c4..ce6a4cd 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -77,6 +77,7 @@ static int conf_lease_time = 600;
static int conf_lease_timeout = 660;
static int conf_verbose;
static const char *conf_agent_remote_id;
+static int conf_proto;
static unsigned int stat_starting;
static unsigned int stat_active;
@@ -624,9 +625,9 @@ static void ipoe_ifcfg_add(struct ipoe_session *ses)
log_ppp_warn("ipoe: failed to add addess to interface '%s'\n", serv->ifname);
pthread_mutex_unlock(&serv->lock);
}
- if (iproute_add(serv->ifindex, ses->serv->opt_src ? ses->serv->opt_src : ses->router, ses->yiaddr))
+ if (iproute_add(serv->ifindex, ses->serv->opt_src ? ses->serv->opt_src : ses->router, ses->yiaddr, conf_proto))
log_ppp_warn("ipoe: failed to add route to interface '%s'\n", serv->ifname);
- } else if (iproute_add(serv->ifindex, ses->serv->opt_src ? ses->serv->opt_src : ses->router, ses->yiaddr))
+ } else if (iproute_add(serv->ifindex, ses->serv->opt_src ? ses->serv->opt_src : ses->router, ses->yiaddr, conf_proto))
log_ppp_warn("ipoe: failed to add route to interface '%s'\n", serv->ifname);
ses->ifcfg = 1;
@@ -2091,6 +2092,12 @@ static void load_config(void)
if (!conf_dhcpv4 && !conf_up)
conf_dhcpv4 = 1;
+ opt = conf_get_opt("ipoe", "proto");
+ if (opt && atoi(opt) > 0)
+ conf_proto = atoi(opt);
+ else
+ conf_proto = 0;
+
#ifdef RADIUS
if (triton_module_loaded("radius"))
load_radius_attrs();