From 31e4b6ae1348c6ae6bcc4c3470608d9479ae22e3 Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Fri, 25 Jan 2013 19:59:28 +0400 Subject: ipoe: properly insert option 82 before END --- accel-pppd/ctrl/ipoe/dhcpv4.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'accel-pppd/ctrl/ipoe') diff --git a/accel-pppd/ctrl/ipoe/dhcpv4.c b/accel-pppd/ctrl/ipoe/dhcpv4.c index e842f38f..0c43b944 100644 --- a/accel-pppd/ctrl/ipoe/dhcpv4.c +++ b/accel-pppd/ctrl/ipoe/dhcpv4.c @@ -442,6 +442,8 @@ int dhcpv4_packet_insert_opt82(struct dhcpv4_packet *pack, const char *agent_cir uint8_t *ptr = data; int r; + pack->ptr--; + *ptr++ = 1; *ptr++ = len1; memcpy(ptr, agent_circuit_id, len1); ptr += len1; @@ -452,6 +454,8 @@ int dhcpv4_packet_insert_opt82(struct dhcpv4_packet *pack, const char *agent_cir r = dhcpv4_packet_add_opt(pack, 82, data, 4 + len1 + len2); _free(data); + + *pack->ptr++ = 255; return r; } -- cgit v1.2.3