summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-10-06 22:37:42 +0000
committerJeremy Allison <jra@samba.org>2000-10-06 22:37:42 +0000
commit9c6acf4595d14cb0fc0c9bf17ce02de73af127cd (patch)
tree29cbb9e3454b5ec044c3f27730467df96a7d2a35
parent81275cbcf705b675650ca803f8c98cdb7a167fa7 (diff)
downloadsamba-9c6acf4595d14cb0fc0c9bf17ce02de73af127cd.tar.gz
samba-9c6acf4595d14cb0fc0c9bf17ce02de73af127cd.tar.bz2
samba-9c6acf4595d14cb0fc0c9bf17ce02de73af127cd.zip
Fix from RFritz@lbl.gov for Linux ECONREFUSED async errors on Linux.
Jeremy. (This used to be commit dd804fdb96ff49645647787c197a61a6515a474d)
-rw-r--r--source3/libsmb/nmblib.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c
index e290ee5d4f..01c4001f4c 100644
--- a/source3/libsmb/nmblib.c
+++ b/source3/libsmb/nmblib.c
@@ -750,6 +750,7 @@ struct packet_struct *read_packet(int fd,enum packet_type packet_type)
static BOOL send_udp(int fd,char *buf,int len,struct in_addr ip,int port)
{
BOOL ret;
+ int i;
struct sockaddr_in sock_out;
/* set the address and port */
@@ -760,9 +761,16 @@ static BOOL send_udp(int fd,char *buf,int len,struct in_addr ip,int port)
DEBUG( 5, ( "Sending a packet of len %d to (%s) on port %d\n",
len, inet_ntoa(ip), port ) );
+
+ /*
+ * Patch to fix asynch error notifications from Linux kernel.
+ */
- ret = (sendto(fd,buf,len,0,(struct sockaddr *)&sock_out,
- sizeof(sock_out)) >= 0);
+ for (i = 0; i < 5; i++) {
+ ret = (sendto(fd,buf,len,0,(struct sockaddr *)&sock_out, sizeof(sock_out)) >= 0);
+ if (ret || errno != ECONNREFUSED)
+ break;
+ }
if (!ret)
DEBUG(0,("Packet send failed to %s(%d) ERRNO=%s\n",