diff options
Diffstat (limited to 'source3/smbd/server.c')
-rw-r--r-- | source3/smbd/server.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 0f47a550e9..8c92c91577 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -348,15 +348,24 @@ static BOOL open_sockets_smbd(BOOL is_daemon, BOOL interactive, const char *smb_ /* Now open a listen socket for each of the interfaces. */ for(i = 0; i < num_interfaces; i++) { - struct in_addr *ifip = iface_n_ip(i); + const struct sockaddr_storage *ifss = + iface_n_sockaddr_storage(i); + const struct in_addr *ifip; fstring tok; const char *ptr; - if(ifip == NULL) { + if (ifss == NULL) { DEBUG(0,("open_sockets_smbd: interface %d has NULL IP address !\n", i)); continue; } + /* For now only deal with IPv4. */ + if (ifss->ss_family != AF_INET) { + continue; + } + + ifip = &((const struct sockaddr_in *)ifss)->sin_addr; + for (ptr=ports; next_token(&ptr, tok, " \t,", sizeof(tok)); ) { unsigned port = atoi(tok); if (port == 0 || port > 0xffff) { |