diff options
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index ecf1b8a9..5db66577 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -2125,7 +2125,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; + int lease_time_set = 0, renew_time_set = 0, has_dhcp = 0; if (ev->ses->ctrl->type != CTRL_TYPE_IPOE) return; @@ -2134,7 +2134,7 @@ static void ev_radius_access_accept(struct ev_radius_t *ev) int vendor_id = attr->vendor ? attr->vendor->id : 0; if (vendor_id == VENDOR_DHCP) { - ses->dhcpv4_relay_reply = dhcpv4_clone_radius(ev->reply); + has_dhcp = 1; switch (attr->attr->id) { case DHCP_Your_IP_Address: @@ -2201,6 +2201,9 @@ static void ev_radius_access_accept(struct ev_radius_t *ev) log_ppp_warn("ipoe: overriding renew time\n"); ses->renew_time = ses->lease_time / 2; } + + if (has_dhcp) + ses->dhcpv4_relay_reply = dhcpv4_clone_radius(ev->reply); } static void ev_radius_coa(struct ev_radius_t *ev) |