ref: 5c945a0b4891a20deeb023b3bd40dee5dda1aaff
parent: cff1ab5fdf116183845581953ee4d8e2665770d4
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Aug 27 16:58:48 EDT 2018
devip: fix router adv/sol options validation (options padded to 8 bytes)
--- a/sys/src/9/ip/icmp6.c
+++ b/sys/src/9/ip/icmp6.c
@@ -617,7 +617,7 @@
goto err;
}
sz = IPICMPSZ + 8;
- while (sz+1 < pktsz) {
+ while (sz+8 <= pktsz) {
osz = packet[sz+1];
if(osz <= 0) {
ipriv->stats[OptlenErrs6]++;
@@ -634,7 +634,7 @@
}
unsp = (ipcmp(p->src, v6Unspecified) == 0);
sz = IPICMPSZ + 8;
- while (sz+1 < pktsz) {
+ while (sz+8 <= pktsz) {
osz = packet[sz+1];
if(osz <= 0 ||
(unsp && packet[sz] == SRC_LLADDR)) {