Re: [Hampshire] Are UDP responses allowed from a different s…

Top Page

Reply to this message
Author: Nick Chalk
Date:  
To: hampshire
Subject: Re: [Hampshire] Are UDP responses allowed from a different source port?
Chris Sykes <chris@???> wrote:
> I believe that if you call connect() on a UDP
> socket, then you will only receive datagrams
> from the IP/port that you have "connected" to so
> it could be that is what your monitoring program
> is doing.


Thanks Chris.

connect(2) says:

If the socket sockfd is of type SOCK_DGRAM
then addr is the address to which datagrams are
sent by default, and the only address from
which datagrams are received.

I haven't yet worked out if the struct sockaddr
contains the port number as well. If it does, then
it sounds like this is the cause of the problem -
the Linux box is opening a socket that will only
accept responses from the address and port that it
sent the datagram to.

I'll see if I can find an option to turn this
behaviour off.

> An strace (or the source if you have it) should
> be able to confirm this.


It's just ldirectord, so the Perl source is
available. Sounds like I need to find out what
ldirectord and Perl are doing with the socket.

Nick.

--
Nick Chalk ................. once a Radio Designer
Confidence is failing to understand the problem.