strongswan.org
Wiki/Project Management
Downloads
Gitweb
projects
/
strongswan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
572a707
)
Don't use pointer to a union member in host_create_from_string_and_family()
author
Tobias Brunner
<tobias@strongswan.org>
Fri, 25 Jan 2013 12:18:50 +0000
(13:18 +0100)
committer
Tobias Brunner
<tobias@strongswan.org>
Fri, 25 Jan 2013 12:18:50 +0000
(13:18 +0100)
src/libstrongswan/networking/host.c
patch
|
blob
|
history
diff --git
a/src/libstrongswan/networking/host.c
b/src/libstrongswan/networking/host.c
index
81af1da
..
bffa960
100644
(file)
--- a/
src/libstrongswan/networking/host.c
+++ b/
src/libstrongswan/networking/host.c
@@
-362,7
+362,6
@@
host_t *host_create_from_string_and_family(char *string, int family,
u_int16_t port)
{
union {
u_int16_t port)
{
union {
- sockaddr_t sockaddr;
struct sockaddr_in v4;
struct sockaddr_in6 v6;
} addr;
struct sockaddr_in v4;
struct sockaddr_in6 v6;
} addr;
@@
-399,8
+398,8
@@
host_t *host_create_from_string_and_family(char *string, int family,
return NULL;
}
addr.v6.sin6_port = htons(port);
return NULL;
}
addr.v6.sin6_port = htons(port);
- addr.
sockaddr.sa
_family = AF_INET6;
- return host_create_from_sockaddr(
&addr.sock
addr);
+ addr.
v6.sin6
_family = AF_INET6;
+ return host_create_from_sockaddr(
(sockaddr_t*)&
addr);
case AF_INET:
if (strchr(string, ':'))
{ /* do not try to convert v6 addresses for v4 family */
case AF_INET:
if (strchr(string, ':'))
{ /* do not try to convert v6 addresses for v4 family */
@@
-412,8
+411,8
@@
host_t *host_create_from_string_and_family(char *string, int family,
return NULL;
}
addr.v4.sin_port = htons(port);
return NULL;
}
addr.v4.sin_port = htons(port);
- addr.
sockaddr.sa
_family = AF_INET;
- return host_create_from_sockaddr(
&addr.sock
addr);
+ addr.
v4.sin
_family = AF_INET;
+ return host_create_from_sockaddr(
(sockaddr_t*)&
addr);
default:
return NULL;
}
default:
return NULL;
}