a7b456
From 95b743d5b0e207ecbe92252757100641b5e13d35 Mon Sep 17 00:00:00 2001
a7b456
From: yiwenchen <yiwenchen@synology.com>
a7b456
Date: Wed, 14 Feb 2018 22:26:54 +0000
a7b456
Subject: [PATCH] Fix boundary for test introduced in
a7b456
 3e3f1029c9ec6c63e430ff51063a6301d4b2262
a7b456
a7b456
This fixes breakage of  DHCPv6 relay.
a7b456
a7b456
(cherry picked from commit 499d8dde2b1a216eab9252ee500cc31b8c2b2974)
a7b456
---
a7b456
 src/rfc3315.c | 4 ++--
a7b456
 1 file changed, 2 insertions(+), 2 deletions(-)
a7b456
a7b456
diff --git a/src/rfc3315.c b/src/rfc3315.c
a7b456
index 1e85c5c..42c7a0e 100644
a7b456
--- a/src/rfc3315.c
a7b456
+++ b/src/rfc3315.c
a7b456
@@ -216,9 +216,9 @@ static int dhcp6_maybe_relay(struct state *state, void *inbuff, size_t sz,
a7b456
   
a7b456
   for (opt = opts; opt; opt = opt6_next(opt, end))
a7b456
     {
a7b456
-      if (opt6_ptr(opt, 0) + opt6_len(opt) >= end) {
a7b456
+      if (opt6_ptr(opt, 0) + opt6_len(opt) > end) 
a7b456
         return 0;
a7b456
-      }
a7b456
+     
a7b456
       int o = new_opt6(opt6_type(opt));
a7b456
       if (opt6_type(opt) == OPTION6_RELAY_MSG)
a7b456
 	{
a7b456
-- 
a7b456
2.21.1
a7b456