diff options
author | Vladislav Grishenko <themiron@mail.ru> | 2020-02-16 04:04:43 +0500 |
---|---|---|
committer | Vladislav Grishenko <themiron@mail.ru> | 2020-02-16 05:16:40 +0500 |
commit | 985cb9f9940d247df91550ab66dce3b8a5a28ca9 (patch) | |
tree | 2ba34d3893228672b3fbae67d0386b572c226cac /accel-pppd | |
parent | c0daaf1597bf88d425149e7e2207e3c29b32d5c8 (diff) | |
download | accel-ppp-985cb9f9940d247df91550ab66dce3b8a5a28ca9.tar.gz accel-ppp-985cb9f9940d247df91550ab66dce3b8a5a28ca9.zip |
ipoe: dhcpv4: echo back opt82 if sent by client/unknown relay per rfc3046
Diffstat (limited to 'accel-pppd')
-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 9427e14..a39463d 100644 --- a/accel-pppd/ctrl/ipoe/dhcpv4.c +++ b/accel-pppd/ctrl/ipoe/dhcpv4.c @@ -741,7 +741,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; @@ -770,6 +771,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) { @@ -817,6 +821,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) { |