summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-protocols
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 /meta-networking/recipes-protocols
parente874880813715dbb0a630252881e3a09b59be79d (diff)
downloadmeta-openembedded-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>
Diffstat (limited to 'meta-networking/recipes-protocols')
-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 3f8bcaa48..bd9bcb8f2 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
4Subject: [PATCH 2/2] user ipv6 structures 4Subject: [PATCH 2/2] user ipv6 structures
5 5
6Signed-off-by: Khem Raj <raj.khem@gmail.com> 6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7
8Update for ipv6 address compare
9Signed-off-by: Changqing Li <changqing.li@windriver.com>
7--- 10---
8 l2tp_api.c | 8 +++++--- 11 l2tp_api.c | 8 +++++---
9 1 file changed, 5 insertions(+), 3 deletions(-) 12 1 file changed, 5 insertions(+), 3 deletions(-)
@@ -18,8 +21,8 @@ index 9d6f60a..f0946fd 100644
18 if ((!l2tp_opt_remote_rpc) && 21 if ((!l2tp_opt_remote_rpc) &&
19- ((xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)) && 22- ((xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)) &&
20- (xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_ANY)))) { 23- (xprt->xp_raddr.sin_addr.s_addr != htonl(INADDR_ANY)))) {
21+ ((xprt->xp_raddr.sin6_addr.s6_addr != htonl(INADDR_LOOPBACK)) && 24+ ((memcmp(&xprt->xp_raddr.sin6_addr, &in6addr_loopback, sizeof(struct in6_addr)) != 0) &&
22+ (xprt->xp_raddr.sin6_addr.s6_addr != htonl(INADDR_ANY)))) { 25+ (memcmp(&xprt->xp_raddr.sin6_addr, &in6addr_any, sizeof(struct in6_addr)) != 0))) {
23+ char straddr[INET6_ADDRSTRLEN]; 26+ char straddr[INET6_ADDRSTRLEN];
24+ inet_ntop(AF_INET6, &xprt->xp_raddr.sin6_addr, straddr, sizeof(straddr)); 27+ inet_ntop(AF_INET6, &xprt->xp_raddr.sin6_addr, straddr, sizeof(straddr));
25 if (l2tp_opt_trace_flags & L2TP_DEBUG_API) { 28 if (l2tp_opt_trace_flags & L2TP_DEBUG_API) {