diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-06-09 13:33:09 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-06-09 13:33:09 +1000 |
commit | 03dd06de9ae7b3692fd2ab141c0522abacbaec31 (patch) | |
tree | 86d68f0f030e492af0c65fbc7dc7598d4c006bef /lib | |
parent | 4b0658d4486d60c82c989ed0b6c806dfc45edbac (diff) | |
download | samba-03dd06de9ae7b3692fd2ab141c0522abacbaec31.tar.gz samba-03dd06de9ae7b3692fd2ab141c0522abacbaec31.tar.bz2 samba-03dd06de9ae7b3692fd2ab141c0522abacbaec31.zip |
fixed socket wrapper to determine family from the right structure
In convert_in_un_remote() the socket family can be accessed either as
si->family or inaddr->sa_family. We were using the si->family to
determine how to cast the inaddr structure, but if si->family !=
inaddr->sa_family then we will incorrectly be casting a in6 structure
as in4 or vice-versa.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/socket_wrapper/socket_wrapper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c index 071060c864..8563400dbd 100644 --- a/lib/socket_wrapper/socket_wrapper.c +++ b/lib/socket_wrapper/socket_wrapper.c @@ -348,7 +348,7 @@ static int convert_in_un_remote(struct socket_info *si, const struct sockaddr *i if (bcast) *bcast = 0; - switch (si->family) { + switch (inaddr->sa_family) { case AF_INET: { const struct sockaddr_in *in = (const struct sockaddr_in *)inaddr; |