On Sat, 4 Feb 2017, jungle boogie wrote:
> On 02/04/2017 05:45 PM, Philip Guenther wrote:
> > On Sat, 4 Feb 2017, jungle boogie wrote:
> > > What's happening here?
> > >
> > > $ doas pkg_add -u
> > > Error from http://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/amd64/
> > > ftp: connect: Invalid argument
> >
> > Running that under ktrace -i might help see the problem, ala
> > doas ktrace -i pkg_add -u
> >
> > then kdump | less and look for a failed connect call. Should be able to
> > search for "connect -1 errno" and then go backwards to see the connect()
> > call and the sockaddr passed to it.
> >
>
> Is this it?
>
> "Trying 129.128.5.191...
...
> 80377 ftp CALL connect(3,0xaf766dd0bf0,16)
> 80377 ftp STRU struct sockaddr { AF_INET, 129.128.5.191:80 }
> 80377 ftp RET connect -1 errno 22 Invalid argument
It dumped the sockaddr and didn't complain about it being invalid, so it
made it into soconnect(). That puts the problem somewhere in the network
stack or network config. To quote connect(2):
[EINVAL] A TCP connection with a local broadcast, the all-ones
or a multicast address as the peer was attempted.
Double/triple check your network configuration, routing table, etc. Good
luck!
Philip Guenther