From 8e54530b52fd256137740107e9fdf000f00a7a30 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 10 Oct 2007 18:25:16 -0700 Subject: Add start of IPv6 implementation. Currently most of this is avoiding IPv6 in winbindd, but moves most of the socket functions that were wrongly in lib/util.c into lib/util_sock.c and provides generic IPv4/6 independent versions of most things. Still lots of work to do, but now I can see how I'll fix the access check code. Nasty part that remains is the name resolution code which is used to returning arrays of in_addr structs. Jeremy. (This used to be commit 3f6bd0e1ec5cc6670f3d08f76fc2cd94c9cd1a08) --- source3/smbd/server.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source3/smbd/server.c') 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) { -- cgit