On Tue, 6 Sep 2016, Héctor Luis Gimbatti wrote: > I post this to .misc since some other (than ttcp) programs might not > work in recent versions of OBSD. > > In OBSD 5.6 I am able to run ttcp. > > $ uname -a > OpenBSD pez.etale.com.ar 5.6 GENERIC.MP#333 amd64 > $ ttcp -r -s > ttcp-r: buflen=8192, nbuf=2048, align=16384/0, port=5001 tcp > ttcp-r: socket > > In OBSD 5.9 and 6.0 I am not able to run it (sadly I do not have running > machines with 5.7 nor 5.8).
The change was in 5.9, with this commit to in_pcb.c: ---------------------------- revision 1.178 date: 2015/09/11 13:59:27; author: vgross; state: Exp; lines: +3 -7; commitid: NyNuX1q0M9Dwr560; Stricter checks on sockaddr content when binding PF_INET sockets. Ok mpi@ ---------------------------- Unless this is just the most recent in a series of similar reports, I doubt we'll back this out or revise the check; it's just old code, written in the slightly sloppy style of the time. > Looking at the code in ttcp.c the problem seems to be that the field > sin_family in the structure sockaddr_in (sinme) is not initialized. > > By adding sinme.sin_family = AF_INET; before bind(...) the program works > fine. No specific maintainer on the port, so I suggest you send your diff to po...@openbsd.org, so it can be included in ports and packages going forward. Philip Guenther