diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2015-04-20 14:08:45 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2015-04-20 14:08:45 +0300 |
commit | b8b91d8b087312c91a9941dacd11a98692679ec8 (patch) | |
tree | 8932a68f23b4f6b4db23078d9d4879138dc51144 | |
parent | 25da2e7fe4d11f909bc738bee31a14de26bfc21c (diff) | |
download | accel-ppp-b8b91d8b087312c91a9941dacd11a98692679ec8.tar.gz accel-ppp-b8b91d8b087312c91a9941dacd11a98692679ec8.zip |
ipoe: changed behavior of agent-remote-id option
Before this patch if agent-remote-id is not specified in config it get default value "accel-pppd".
Now if agent-remote-id is not specified then accel-ppp will not insert his Option 82 into relayed DHCP requests
-rw-r--r-- | accel-pppd/ctrl/ipoe/dhcpv4.c | 4 | ||||
-rw-r--r-- | accel-pppd/ctrl/ipoe/ipoe.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/accel-pppd/ctrl/ipoe/dhcpv4.c b/accel-pppd/ctrl/ipoe/dhcpv4.c index 330038f..21a62f5 100644 --- a/accel-pppd/ctrl/ipoe/dhcpv4.c +++ b/accel-pppd/ctrl/ipoe/dhcpv4.c @@ -957,7 +957,7 @@ int dhcpv4_relay_send(struct dhcpv4_relay *relay, struct dhcpv4_packet *request, struct dhcpv4_option *opt = NULL; uint32_t _server_id; - if (!request->relay_agent && dhcpv4_packet_insert_opt82(request, agent_circuit_id, agent_remote_id)) + if (!request->relay_agent && agent_remote_id && dhcpv4_packet_insert_opt82(request, agent_circuit_id, agent_remote_id)) return -1; request->hdr->giaddr = relay->giaddr; @@ -1022,7 +1022,7 @@ int dhcpv4_relay_send_release(struct dhcpv4_relay *relay, uint8_t *chaddr, uint3 if (relay_agent && dhcpv4_packet_add_opt(pack, 82, relay_agent->data, relay_agent->len)) goto out_err; - else if (!relay_agent) { + else if (!relay_agent && agent_remote_id) { pack->ptr++; if (dhcpv4_packet_insert_opt82(pack, agent_circuit_id, agent_remote_id)) goto out_err; diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c index 0e59614..765996f 100644 --- a/accel-pppd/ctrl/ipoe/ipoe.c +++ b/accel-pppd/ctrl/ipoe/ipoe.c @@ -3203,7 +3203,7 @@ static void load_config(void) if (opt) conf_agent_remote_id = opt; else - conf_agent_remote_id = "accel-pppd"; + conf_agent_remote_id = NULL; opt = conf_get_opt("ipoe", "ipv6"); if (opt) |