diff options
author | xebd <xeb@mail.ru> | 2020-03-10 13:35:32 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-10 13:35:32 +0300 |
commit | 5db4429c75352b636cb8bb441216c4816ee8421f (patch) | |
tree | d53e97f9e59703329c7fb5648063609275628d39 | |
parent | c6496ef1bc9b305f7821f20183a8d99dc432950f (diff) | |
parent | 985cb9f9940d247df91550ab66dce3b8a5a28ca9 (diff) | |
download | accel-ppp-5db4429c75352b636cb8bb441216c4816ee8421f.tar.gz accel-ppp-5db4429c75352b636cb8bb441216c4816ee8421f.zip |
Merge pull request #117 from themiron/echo-opt82
ipoe: dhcpv4: echo back opt82 if sent by client/relay per rfc3046
-rw-r--r-- | accel-pppd/ctrl/ipoe/dhcpv4.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/ipoe/dhcpv4.c b/accel-pppd/ctrl/ipoe/dhcpv4.c index 76ad7c2..a822627 100644 --- a/accel-pppd/ctrl/ipoe/dhcpv4.c +++ b/accel-pppd/ctrl/ipoe/dhcpv4.c @@ -748,7 +748,8 @@ 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 == 58 || 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) || opt->type == 82) continue; else if (opt->type == 6) dns_avail = 1; @@ -777,6 +778,9 @@ int dhcpv4_send_reply(int msg_type, struct dhcpv4_serv *serv, struct dhcpv4_pack goto out_err; } + if (req->relay_agent && dhcpv4_packet_add_opt(pack, 82, req->relay_agent->data, req->relay_agent->len)) + goto out_err; + *pack->ptr++ = 255; if (conf_verbose) { @@ -824,6 +828,9 @@ int dhcpv4_send_nak(struct dhcpv4_serv *serv, struct dhcpv4_packet *req) if (dhcpv4_packet_add_opt(pack, 53, &val, 1)) goto out_err; + if (req->relay_agent && dhcpv4_packet_add_opt(pack, 82, req->relay_agent->data, req->relay_agent->len)) + goto out_err; + *pack->ptr++ = 255; if (conf_verbose) { |