From 8e1e3e913868390334fddc71a903cc48ec17e296 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Thu, 25 Jan 2018 12:52:10 +0300 Subject: ipoe: use DHCP-Server-Identifier attribute as siaddr if DHCP-Server-IP-Address is not supplied --- accel-pppd/ctrl/ipoe/ipoe.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'accel-pppd/ctrl') diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 9e0b9eae..35f97d83 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -2195,6 +2195,7 @@ static void ev_radius_access_accept(struct ev_radius_t *ev) struct ipoe_session *ses = container_of(ev->ses, typeof(*ses), ses); struct rad_attr_t *attr; int lease_time_set = 0, renew_time_set = 0, has_dhcp = 0; + in_addr_t server_id = 0; if (ev->ses->ctrl->type != CTRL_TYPE_IPOE) return; @@ -2226,6 +2227,9 @@ static void ev_radius_access_accept(struct ev_radius_t *ev) ses->renew_time = attr->val.integer; renew_time_set = 1; break; + case DHCP_DHCP_Server_Identifier: + server_id = attr->val.ipaddr; + break; } continue; @@ -2271,6 +2275,9 @@ static void ev_radius_access_accept(struct ev_radius_t *ev) ses->renew_time = ses->lease_time / 2; } + if (!ses->siaddr) + ses->siaddr = server_id; + if (has_dhcp) ses->dhcpv4_relay_reply = dhcpv4_clone_radius(ev->reply); } -- cgit v1.2.3