Subject: Re: sendto(2) EINVAL / pacing problem
To: None <tech-net@NetBSD.org>
From: Christoph Kaegi <kgc@zhwin.ch>
List: tech-net
Date: 02/11/2004 12:51:36
On 11.02-04:32, der Mouse wrote:
> 
> For AF_LOCAL, sys/kern/uipc_proto.c (the initialization of unixsw[]).
> Looks to me as though you want uipc_usrreq().
> 

Diving deeper, my EINVAL seems to come from:

- sendit()
- sosend()
- uipc_usrreq()
- unp_output()

-------------------------------------- 8< --------------------------------------
int
unp_output(m, control, unp, p)

  ...

  if (sbappendaddr(&so2->so_rcv, (struct sockaddr *)sun, m, control) == 0) {
    m_freem(control);
    m_freem(m);
    return (EINVAL);
  }

  ...

-------------------------------------- 8< --------------------------------------


Looking at sbappendaddr(), this seems to mean that
there's no space in sockbuf available or there are
not enough mbufs available. (after what the comment 
at the start of sbappendaddr() says)

I've found PR 21088 which seems to address this or a similar
issue. I see that this is fixed in current and so I fixed it
on my 1.6.1 machine also (returning ENOBUFS instead of EINVAL).

Now, I still have the same problem as before, my query client
still times out, just with another error message.

What reason could prevent the socket getting ready to be written 
to for 5 seconds?

Thanks
Chris


-- 
----------------------------------------------------------------------
Christoph Kaegi                                           kgc@zhwin.ch
----------------------------------------------------------------------