|
|
@@ -296,7 +296,7 @@ int totemip_totemip_to_sockaddr_convert(struct totem_ip_address *ip_addr,
|
|
|
#endif
|
|
|
sin->sin6_family = ip_addr->family;
|
|
|
sin->sin6_port = ntohs(port);
|
|
|
- sin->sin6_scope_id = ip_addr->sin6_scope_id;
|
|
|
+ sin->sin6_scope_id = 2;
|
|
|
memcpy(&sin->sin6_addr, ip_addr->addr, sizeof(struct in6_addr));
|
|
|
|
|
|
*addrlen = sizeof(struct sockaddr_in6);
|
|
|
@@ -331,13 +331,10 @@ int totemip_parse(struct totem_ip_address *totemip, const char *addr, int family
|
|
|
sa6 = (struct sockaddr_in6 *)ainfo->ai_addr;
|
|
|
totemip->family = ainfo->ai_family;
|
|
|
|
|
|
- if (ainfo->ai_family == AF_INET) {
|
|
|
+ if (ainfo->ai_family == AF_INET)
|
|
|
memcpy(totemip->addr, &sa->sin_addr, sizeof(struct in_addr));
|
|
|
- totemip->sin6_scope_id = 0;
|
|
|
- } else {
|
|
|
+ else
|
|
|
memcpy(totemip->addr, &sa6->sin6_addr, sizeof(struct in6_addr));
|
|
|
- totemip->sin6_scope_id = sa6->sin6_scope_id;
|
|
|
- }
|
|
|
|
|
|
freeaddrinfo(ainfo);
|
|
|
return 0;
|
|
|
@@ -356,7 +353,6 @@ int totemip_sockaddr_to_totemip_convert(const struct sockaddr_storage *saddr,
|
|
|
const struct sockaddr_in *sin = (const struct sockaddr_in *)saddr;
|
|
|
|
|
|
memcpy(ip_addr->addr, &sin->sin_addr, sizeof(struct in_addr));
|
|
|
- ip_addr->sin6_scope_id = 0;
|
|
|
ret = 0;
|
|
|
}
|
|
|
|
|
|
@@ -365,7 +361,7 @@ int totemip_sockaddr_to_totemip_convert(const struct sockaddr_storage *saddr,
|
|
|
= (const struct sockaddr_in6 *)saddr;
|
|
|
|
|
|
memcpy(ip_addr->addr, &sin->sin6_addr, sizeof(struct in6_addr));
|
|
|
- ip_addr->sin6_scope_id = sin->sin6_scope_id;
|
|
|
+
|
|
|
ret = 0;
|
|
|
}
|
|
|
return ret;
|