diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2011-10-10 10:12:38 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2011-10-10 10:12:38 +0400 |
commit | 676a6f6eccf98df6ccd3feb31ddd4313a8659811 (patch) | |
tree | 20e4cd46dbdac99c871fe56f35340b7d3c9b15d7 /accel-pppd/ppp/ppp_ipv6cp.c | |
parent | 2405fd6ba52618f07c0fa11d85c0f039653678bc (diff) | |
download | accel-ppp-676a6f6eccf98df6ccd3feb31ddd4313a8659811.tar.gz accel-ppp-676a6f6eccf98df6ccd3feb31ddd4313a8659811.zip |
Revert "ppp: options header sanity check"
This reverts commit 2405fd6ba52618f07c0fa11d85c0f039653678bc.
Diffstat (limited to 'accel-pppd/ppp/ppp_ipv6cp.c')
-rw-r--r-- | accel-pppd/ppp/ppp_ipv6cp.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/accel-pppd/ppp/ppp_ipv6cp.c b/accel-pppd/ppp/ppp_ipv6cp.c index 5479f316..a984e43a 100644 --- a/accel-pppd/ppp/ppp_ipv6cp.c +++ b/accel-pppd/ppp/ppp_ipv6cp.c @@ -392,12 +392,13 @@ static int ipv6cp_recv_conf_req(struct ppp_ipv6cp_t *ipv6cp, uint8_t *data, int while (size > 0) { hdr = (struct ipv6cp_opt_hdr_t *)data; - if (!hdr->len || hdr->len > size) - break; - ropt = _malloc(sizeof(*ropt)); memset(ropt, 0, sizeof(*ropt)); + if (hdr->len > size) + ropt->len = size; + else + ropt->len = hdr->len; ropt->hdr = hdr; ropt->state = IPV6CP_OPT_NONE; list_add_tail(&ropt->entry, &ipv6cp->ropt_list); @@ -503,9 +504,6 @@ static int ipv6cp_recv_conf_rej(struct ppp_ipv6cp_t *ipv6cp, uint8_t *data, int while (size > 0) { hdr = (struct ipv6cp_opt_hdr_t *)data; - if (!hdr->len || hdr->len > size) - break; - list_for_each_entry(lopt, &ipv6cp->options, entry) { if (lopt->id == hdr->id) { if (!lopt->h->recv_conf_rej) @@ -544,9 +542,6 @@ static int ipv6cp_recv_conf_nak(struct ppp_ipv6cp_t *ipv6cp, uint8_t *data, int while (size > 0) { hdr = (struct ipv6cp_opt_hdr_t *)data; - if (!hdr->len || hdr->len > size) - break; - list_for_each_entry(lopt, &ipv6cp->options, entry) { if (lopt->id == hdr->id) { if (conf_ppp_verbose) { @@ -587,9 +582,6 @@ static int ipv6cp_recv_conf_ack(struct ppp_ipv6cp_t *ipv6cp, uint8_t *data, int while (size > 0) { hdr = (struct ipv6cp_opt_hdr_t *)data; - if (!hdr->len || hdr->len > size) - break; - list_for_each_entry(lopt, &ipv6cp->options, entry) { if (lopt->id == hdr->id) { if (conf_ppp_verbose) { |