mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-01 01:30:23 +00:00
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>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user