talk: talk into account sa_len field in sockaddr.
authorDan Cross <cross@gajendra.net>
Fri, 15 Jan 2021 03:16:17 +0000 (03:16 +0000)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 16 Jan 2021 00:45:03 +0000 (16:45 -0800)
commit1f28d7d499446ade79662f31f364fecb67f7c06d
tree936c9998fc8fd0d63aa20417a1d213007634b049
parentdb6b8d4157e549affe815c2df252839eca8adb61
talk: talk into account sa_len field in sockaddr.

`osockaddr` predates the introduction of the sa_len
field in `struct sockaddr`.  The family has moved to
the second field in the structure, but `talk` didn't
account for this when it constructs a `sockaddr_in`
to send data to another system.

The failure case was kind of odd: one could `talk`
to a user on, say, a Linux machine, the remote user
could respond, and things would work as expected.
However, the inverse case, where a user on Linux
tried to `talk` to a user on Dragonfly failed: the
talk announcement would be made, but an attempt to
respond would fail with a protocol error since the
`sin_family` field would be zero.

Signed-off-by: Dan Cross <cross@gajendra.net>
usr.bin/talk/look_up.c