diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2021-01-10 14:25:00 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2021-01-10 14:25:00 +0300 |
commit | 49ef6cf969f662c44f4be2b82b101273c8c6de71 (patch) | |
tree | 15ec151cb82f15ca0609ac00469c1f27d296f38c /accel-pppd/ctrl/ipoe | |
parent | 588965eaf3fa90531482c5bcf1c145bce0e9a169 (diff) | |
download | accel-ppp-49ef6cf969f662c44f4be2b82b101273c8c6de71.tar.gz accel-ppp-49ef6cf969f662c44f4be2b82b101273c8c6de71.zip |
ipoe: add option 54 (server-id) to DHCPNAK
Diffstat (limited to 'accel-pppd/ctrl/ipoe')
-rw-r--r-- | accel-pppd/ctrl/ipoe/dhcpv4.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/ipoe/dhcpv4.c b/accel-pppd/ctrl/ipoe/dhcpv4.c index bc2ecad..167f9fd 100644 --- a/accel-pppd/ctrl/ipoe/dhcpv4.c +++ b/accel-pppd/ctrl/ipoe/dhcpv4.c @@ -822,6 +822,7 @@ int dhcpv4_send_nak(struct dhcpv4_serv *serv, struct dhcpv4_packet *req, const c { struct dhcpv4_packet *pack; int val, r; + uint32_t server_id = req->server_id ? req->server_id : req->hdr->siaddr; pack = dhcpv4_packet_alloc(); if (!pack) { @@ -841,6 +842,9 @@ int dhcpv4_send_nak(struct dhcpv4_serv *serv, struct dhcpv4_packet *req, const c if (dhcpv4_packet_add_opt(pack, 53, &val, 1)) goto out_err; + if (server_id && dhcpv4_packet_add_opt(pack, 54, &server_id, 4)) + goto out_err; + if (req->relay_agent && dhcpv4_packet_add_opt(pack, 82, req->relay_agent->data, req->relay_agent->len)) goto out_err; |