diff options
| author | Michael Adam <obnox@samba.org> | 2014-05-30 13:21:00 +0200 |
|---|---|---|
| committer | Michael Adam <obnox@samba.org> | 2014-06-01 10:03:17 +0200 |
| commit | f04ea324f6079e74532ee1ae085945097073a305 (patch) | |
| tree | 3811f4d75573e17b01cb5a34ec3502aba65c94ea /src | |
| parent | 97a65a132d1b14cbfd539f327f260237c1afff3d (diff) | |
| download | socket_wrapper-f04ea324f6079e74532ee1ae085945097073a305.tar.gz socket_wrapper-f04ea324f6079e74532ee1ae085945097073a305.tar.xz socket_wrapper-f04ea324f6079e74532ee1ae085945097073a305.zip | |
swrap: fix AF_UNSPEC special case in swrap_bind()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/socket_wrapper.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 0303b21..b66b951 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -1309,6 +1309,26 @@ static int sockaddr_convert_to_un(struct socket_info *si, #endif switch (in_addr->sa_family) { + case AF_UNSPEC: { + struct sockaddr_in *sin; + if (si->family != AF_INET) { + break; + } + if (in_len < sizeof(struct sockaddr_in)) { + break; + } + sin = (struct sockaddr_in *)in_addr; + if(sin->sin_addr.s_addr != htonl(INADDR_ANY)) { + break; + } + + /* + * Note: in the special case of AF_UNSPEC and INADDR_ANY, + * AF_UNSPEC is mapped to AF_INET and must be treated here. + */ + + /* FALL THROUGH */ + } case AF_INET: #ifdef HAVE_IPV6 case AF_INET6: |
