summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-07-10 02:53:48 +0000
committerAndrew Tridgell <tridge@samba.org>2001-07-10 02:53:48 +0000
commit575e609c3ba3f6557b66935a9ad5538cf241b057 (patch)
tree7cc309c8f338ab3f894570873dcdfbcc2160c645 /source3
parent6baa40e3fe59a68046d31a93eb154237d7bd0837 (diff)
downloadsamba-575e609c3ba3f6557b66935a9ad5538cf241b057.tar.gz
samba-575e609c3ba3f6557b66935a9ad5538cf241b057.tar.bz2
samba-575e609c3ba3f6557b66935a9ad5538cf241b057.zip
much better handling of broken DNS servers
we no longer lookup our own name when we create a socket in open_socket_in(). That makes things work much better with the broken DNS server at VA (This used to be commit a83d506e5cd6cef23298211b2fe4e0e25c9e5f48)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util_sock.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 760ceceede..f18fa2e019 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -780,32 +780,18 @@ open a socket of the specified type, port and address for incoming data
int open_socket_in(int type, int port, int dlevel,uint32 socket_addr, BOOL rebind)
{
- struct hostent *hp;
struct sockaddr_in sock;
- pstring host_name;
int res;
- /* get my host name */
- if (gethostname(host_name, MAXHOSTNAMELEN) == -1)
- { DEBUG(0,("gethostname failed\n")); return -1; }
-
- /* get host info */
- if ((hp = sys_gethostbyname(host_name)) == 0)
- {
- DEBUG(0,( "sys_gethostbyname: Unknown host %s\n",host_name));
- return -1;
- }
-
memset((char *)&sock,'\0',sizeof(sock));
- memcpy((char *)&sock.sin_addr,(char *)hp->h_addr, hp->h_length);
#ifdef HAVE_SOCK_SIN_LEN
sock.sin_len = sizeof(sock);
#endif
sock.sin_port = htons( port );
- sock.sin_family = hp->h_addrtype;
+ sock.sin_family = AF_INET;
sock.sin_addr.s_addr = socket_addr;
- res = socket(hp->h_addrtype, type, 0);
+ res = socket(AF_INET, type, 0);
if (res == -1)
{ DEBUG(0,("socket failed\n")); return -1; }