diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2014-08-26 16:56:27 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2014-08-26 16:56:27 +0400 |
commit | ec9968885ed2f273c4d2c18297986c463fb9cf9b (patch) | |
tree | 4791da63b02cd99e34ed40b073ff069de20005e0 /accel-pppd/ctrl | |
parent | 35aea541e7a9069d9d18be5c9c2946e004d03e4a (diff) | |
download | accel-ppp-ec9968885ed2f273c4d2c18297986c463fb9cf9b.tar.gz accel-ppp-ec9968885ed2f273c4d2c18297986c463fb9cf9b.zip |
ipoe: introduced attr-dhcp-lease-time option to specify radius attribute to pass dhcp lease time (attribute must be integer)
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 6abfb305..5ee2d414 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -117,6 +117,7 @@ static int conf_noauth; static int conf_attr_dhcp_client_ip; static int conf_attr_dhcp_router_ip; static int conf_attr_dhcp_mask; +static int conf_attr_dhcp_lease_time; static int conf_attr_l4_redirect; #endif static int conf_l4_redirect_table; @@ -1709,7 +1710,8 @@ static void ev_radius_access_accept(struct ev_radius_t *ev) ses->l4_redirect = 1; } else if (attr->val.integer != 0) ses->l4_redirect = 1; - } + } else if (attr->attr->id == conf_attr_dhcp_lease_time) + ses->lease_time = attr->val.integer; } } @@ -1733,7 +1735,8 @@ static void ev_radius_coa(struct ev_radius_t *ev) } else if (strcmp(attr->attr->name, "Framed-IP-Address") == 0) { if (ses->ses.ipv4 && ses->ses.ipv4->peer_addr != attr->val.ipaddr) ipoe_change_addr(ses, attr->val.ipaddr); - } + } else if (attr->attr->id == conf_attr_dhcp_lease_time) + ses->lease_time = attr->val.integer; } //if (l4_redirect && !ses->l4_redirect) || (!l4_redirect && ses->l4_redirect)) @@ -2536,6 +2539,7 @@ static void load_radius_attrs(void) parse_conf_rad_attr("attr-dhcp-client-ip", &conf_attr_dhcp_client_ip); parse_conf_rad_attr("attr-dhcp-router-ip", &conf_attr_dhcp_router_ip); parse_conf_rad_attr("attr-dhcp-mask", &conf_attr_dhcp_mask); + parse_conf_rad_attr("attr-dhcp-lease-time", &conf_attr_dhcp_lease_time); parse_conf_rad_attr("attr-l4-redirect", &conf_attr_l4_redirect); } #endif |