aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2018-09-05 10:38:09 +0800
committerKhem Raj <raj.khem@gmail.com>2018-09-05 13:59:15 -0700
commit2212e6ea8ed8ae0813f33d6304393f8e734dab87 (patch)
tree86f3bd85fd6779d4d0f25c05eb9ad7bb7162ce30
parente874880813715dbb0a630252881e3a09b59be79d (diff)
downloadmeta-openembedded-contrib-2212e6ea8ed8ae0813f33d6304393f8e734dab87.tar.gz
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@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-networking/recipes-protocols/openl2tp/openl2tp/0002-user-ipv6-structures.patch7
1 files 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 3f8bcaa483..bd9bcb8f27 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@gmail.com>
+
+Update for ipv6 address compare
+Signed-off-by: Changqing Li <changqing.li@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) {