Skip to contentSkip to conversation

Fix the comparison of pull options hash on restart

PATCH In review Selva Nair 3 participants 3 messages Jun 4, 2016 – Jun 5, 2016

lore
Share & tools
lore

Selva Nair

author
#0 lore raw

PATCH 1/1 Fix the comparison of pull options hash on restart

---
 src/openvpn/init.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/init.c +1 -1
index 42baf97..4b044f4 100644
@@ -1717,7 +1717,7 @@ options_hash_changed_or_zero(const struct md5_digest *a,
 {
   const struct md5_digest zero = {{0}};
   return memcmp (a, b, sizeof(struct md5_digest)) ||
-      memcmp (a, &zero, sizeof(struct md5_digest));
+      !memcmp (a, &zero, sizeof(struct md5_digest));
 }
 #endif /* P2MP */
 
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 10 lines · Selva Nair
---
 src/openvpn/init.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/init.c +0 -0
index 42baf97..4b044f4 100644

src/openvpn/init.c options_hash_changed_or_zero(const struct md5_digest *a, · line 1722

Quoted 7 lines
src/openvpn/init.c +1 -1
@@ -1717,7 +1717,7 @@ options_hash_changed_or_zero(const struct md5_digest *a,
 {
   const struct md5_digest zero = {{0}};
   return memcmp (a, b, sizeof(struct md5_digest)) ||
-      memcmp (a, &zero, sizeof(struct md5_digest));
+      !memcmp (a, &zero, sizeof(struct md5_digest));
 }
 #endif /* P2MP */

ACK, this is clearly how it was intended, and how the code behaved before 827de237.

Sorry for breaking this. A clear example why we need more (unit) tests...

-Steffan

#2 lore raw
In reply to Selva Nair

Your patch has been applied to the master branch.

commit 1899393543caa3cd5191c96176e8ecaa8e690eeb

Author: Selva Nair
Date:   Sat Jun 4 00:57:43 2016 -0400
     Fix the comparison of pull options hash on restart

     Signed-off-by: Selva Nair <[email protected]...>
     Acked-by: Steffan Karger <[email protected]...>
     Message-Id: <[email protected]...>
     URL: http://article.gmane.org/gmane.network.openvpn.devel/11783
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering