summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/ipoe
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2018-01-25 12:52:10 +0300
committerDmitry Kozlov <xeb@mail.ru>2018-01-25 12:52:10 +0300
commit8e1e3e913868390334fddc71a903cc48ec17e296 (patch)
treec220dee30fa699d2d2b872e6841b4ff4d983260a /accel-pppd/ctrl/ipoe
parent01c7b7c8e9cb16a3ac1d18049e687856b552b57c (diff)
downloadaccel-ppp-8e1e3e913868390334fddc71a903cc48ec17e296.tar.gz
accel-ppp-8e1e3e913868390334fddc71a903cc48ec17e296.zip
ipoe: use DHCP-Server-Identifier attribute as siaddr if DHCP-Server-IP-Address is not supplied
Diffstat (limited to 'accel-pppd/ctrl/ipoe')
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index 9e0b9ea..35f97d8 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);
}