diff options
author | Jeremy Allison <jra@samba.org> | 2000-10-06 22:37:42 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-10-06 22:37:42 +0000 |
commit | dd804fdb96ff49645647787c197a61a6515a474d (patch) | |
tree | 101280b6b4ccb6949ab6dc85900a0a2f3f2fd7a2 /source/libsmb | |
parent | c18d6f8701c8e6ca03f9fff79cf28c842b3b5ff9 (diff) | |
download | samba-dd804fdb96ff49645647787c197a61a6515a474d.tar.gz samba-dd804fdb96ff49645647787c197a61a6515a474d.tar.xz samba-dd804fdb96ff49645647787c197a61a6515a474d.zip |
Fix from RFritz@lbl.gov for Linux ECONREFUSED async errors on Linux.
Jeremy.
Diffstat (limited to 'source/libsmb')
-rw-r--r-- | source/libsmb/nmblib.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/libsmb/nmblib.c b/source/libsmb/nmblib.c index e290ee5d4f0..01c4001f4cf 100644 --- a/source/libsmb/nmblib.c +++ b/source/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", |