[oe-commits] [meta-openembedded] 17/77: openl2tp: fix ipv6 address compare problem

git at git.openembedded.org git at git.openembedded.org
Mon Sep 10 05:08:27 UTC 2018


This is an automated email from the git hooks/post-receive script.

khem pushed a commit to branch master-next
in repository meta-openembedded.

commit 2212e6ea8ed8ae0813f33d6304393f8e734dab87
Author: Changqing Li <changqing.li at windriver.com>
AuthorDate: Wed Sep 5 10:38:09 2018 +0800

    openl2tp: fix ipv6 address compare problem
    
    Ipv6 address type is "u_int8_t  s6_addr[16]", so
    compare use memcmp. htonl is for ipv4, and return uint32_t.
    
    Signed-off-by: Changqing Li <changqing.li at windriver.com>
    Signed-off-by: Khem Raj <raj.khem at gmail.com>
---
 .../openl2tp/openl2tp/0002-user-ipv6-structures.patch              | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch b/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch
index 3f8bcaa..bd9bcb8 100644
--- a/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch
+++ b/meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch
@@ -4,6 +4,9 @@ Date: Tue, 28 Mar 2017 18:09:58 -0700
 Subject: [PATCH 2/2] user ipv6 structures
 
 Signed-off-by: Khem Raj <raj.khem at gmail.com>
+
+Update for ipv6 address compare
+Signed-off-by: Changqing Li <changqing.li at windriver.com>
 ---
  l2tp_api.c | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)
@@ -18,8 +21,8 @@ index 9d6f60a..f0946fd 100644
  	if ((!l2tp_opt_remote_rpc) &&
 -	    ((xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)) &&
 -	     (xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_ANY)))) {
-+	    ((xprt->xp_raddr.sin6_addr.s6_addr != htonl(INADDR_LOOPBACK)) &&
-+	     (xprt->xp_raddr.sin6_addr.s6_addr != htonl(INADDR_ANY)))) {
++	    ((memcmp(&xprt->xp_raddr.sin6_addr, &in6addr_loopback, sizeof(struct in6_addr)) != 0) &&
++	     (memcmp(&xprt->xp_raddr.sin6_addr, &in6addr_any, sizeof(struct in6_addr)) != 0))) {
 +		char straddr[INET6_ADDRSTRLEN];
 +		inet_ntop(AF_INET6, &xprt->xp_raddr.sin6_addr, straddr, sizeof(straddr));
  		if (l2tp_opt_trace_flags & L2TP_DEBUG_API) {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list