summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl/ipoe/dhcpv4.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2015-11-17 23:05:11 +0300
committerDmitry Kozlov <xeb@mail.ru>2015-11-17 23:05:11 +0300
commit74c00bfc521a6136d4ee0d776f8d1717014b2bfc (patch)
tree3961e354f67fdf37ceed303fa9d2ab4dec4a3df2 /accel-pppd/ctrl/ipoe/dhcpv4.c
parentb498b81ebc4eee1f75ff1ef87d65d8f223c31ba6 (diff)
downloadaccel-ppp-74c00bfc521a6136d4ee0d776f8d1717014b2bfc.tar.gz
accel-ppp-74c00bfc521a6136d4ee0d776f8d1717014b2bfc.zip
ipoe: implemented dhcp option 58
Diffstat (limited to 'accel-pppd/ctrl/ipoe/dhcpv4.c')
-rw-r--r--accel-pppd/ctrl/ipoe/dhcpv4.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/accel-pppd/ctrl/ipoe/dhcpv4.c b/accel-pppd/ctrl/ipoe/dhcpv4.c
index f58a49a7..94d39175 100644
--- a/accel-pppd/ctrl/ipoe/dhcpv4.c
+++ b/accel-pppd/ctrl/ipoe/dhcpv4.c
@@ -692,7 +692,7 @@ int dhcpv4_packet_add_opt(struct dhcpv4_packet *pack, int type, const void *data
return 0;
}
-int dhcpv4_send_reply(int msg_type, struct dhcpv4_serv *serv, struct dhcpv4_packet *req, uint32_t yiaddr, uint32_t siaddr, uint32_t router, uint32_t mask, int lease_time, struct dhcpv4_packet *relay)
+int dhcpv4_send_reply(int msg_type, struct dhcpv4_serv *serv, struct dhcpv4_packet *req, uint32_t yiaddr, uint32_t siaddr, uint32_t router, uint32_t mask, int lease_time, int renew_time, struct dhcpv4_packet *relay)
{
struct dhcpv4_packet *pack;
int val, r;
@@ -730,6 +730,12 @@ int dhcpv4_send_reply(int msg_type, struct dhcpv4_serv *serv, struct dhcpv4_pack
if (dhcpv4_packet_add_opt(pack, 51, &val, 4))
goto out_err;
+ val = ntohl(renew_time);
+ if (val > 0){
+ if (dhcpv4_packet_add_opt(pack, 58, &val, 4))
+ goto out_err;
+ }
+
if (router && dhcpv4_packet_add_opt(pack, 3, &router, 4))
goto out_err;
@@ -739,7 +745,7 @@ int dhcpv4_send_reply(int msg_type, struct dhcpv4_serv *serv, struct dhcpv4_pack
if (relay) {
list_for_each_entry(opt, &relay->options, entry) {
- if (opt->type == 53 || opt->type == 54 || opt->type == 51 || opt->type == 1 || (opt->type == 3 && router))
+ if (opt->type == 53 || opt->type == 54 || opt->type == 51 || opt->type == 58 || opt->type == 1 || (opt->type == 3 && router))
continue;
if (opt->type == 6)
dns_avail = 1;