lkml.org 
[lkml]   [1998]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Fw: sendpkt: Connection refused
Andi Kleen wrote:
>
> mblack@csihq.com (Mike Black) writes:
> ...
> > >> Oct 10 06:27:18 defiant dhcpd: sendpkt: Connection refused
> > >
> > >Because Linux stupidly reports ICMP errors it receives for a given UDP
> > >port the next time you try to send on a socket bound to that port,
> > >even though the error has nothing to do with the packet you're trying
> > >to send. The error is essentially informational at this point - when
> > >send_packet gets it while transmitting a packet, it just retransmits
> > >the packet. Utterly bogus, but harmless to you.
>
> He should either fix his program to do correct error handling
> or set the SO_BSDCOMPAT option on the socket.

How should the "correct error handling" look like?

I got the same problem when building a daemon which talks to
a large number of clients. The problem: You don't know, whether
the error return of the send is for the current packet or for
one of the thousand packets before. If you try to resend the
current packet another icmp-error may have returned in the
meantime and you get just another -1.

You may try to resend until you get a success but what, if the
error _is_ for the current packet and not for an earlier one?

IMO, this interface is broken. I came to the solution, that
SO_BSDCOMPAT is the Right Thing and should be the default!
(I don't know, if this would break some 'standard'...)

Ciao, ET.


Don't try to handle something you don't know how to handle.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:1.344 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site