From b8b91d8b087312c91a9941dacd11a98692679ec8 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Mon, 20 Apr 2015 14:08:45 +0300 Subject: 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 --- accel-pppd/ctrl/ipoe/dhcpv4.c | 4 ++-- accel-pppd/ctrl/ipoe/ipoe.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'accel-pppd') diff --git a/accel-pppd/ctrl/ipoe/dhcpv4.c b/accel-pppd/ctrl/ipoe/dhcpv4.c index 330038fe..21a62f58 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 0e596147..765996f7 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) -- cgit v1.2.3