Only use ifa_ifwithaddr() to check if the binding address is on the
authormpi <mpi@openbsd.org>
Wed, 4 Jun 2014 13:45:47 +0000 (13:45 +0000)
committermpi <mpi@openbsd.org>
Wed, 4 Jun 2014 13:45:47 +0000 (13:45 +0000)
commit6aa0b95f7d76cbecf7a9d0eb6f2b6dea31df2e1f
treead784a557c880302719e094176b405da5d1f81e4
parent61e927c2f7f379cdfd24e56592663a1df3ec6cfb
Only use ifa_ifwithaddr() to check if the binding address is on the
system.

Yes, this is ugly for the moment because OpenBSD prevents you from
binding a tcp socket to broadcast address and checking for a broadcast
address is... funny!  If you've ever wondered why would lead people to
write:

ina.s_addr != ia->ia_addr.sin_addr.s_addr

instead of:

ina.s_addr == ia->ia_broadaddr.sin_addr.s_addr

Well this is because all the IPv4 addresses belonging to your lo(4)
interfaces match the second idiom.  Hopefully we'll get rid of this
hack soon.

ok jca@, mikeb@
sys/netinet/in_pcb.c