rtsock: Fix !SO_USELOOPBACK support in route_output()
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 31 Jan 2009 04:07:32 +0000 (12:07 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 17 Feb 2009 10:35:51 +0000 (18:35 +0800)
commitd16fa20132ea6d21b9bd26cc09246c12134ba6ee
treefb30a470b3fdfcfd7c41b155741548a5d08ac705
parentec69a2954dd19bef219e6bd0890d3e5215840c5a
rtsock: Fix !SO_USELOOPBACK support in route_output()

Old BSD code assumes that rts_input() is synchronous, so clear/set
sp_family could be used to skip the current rawcb.  However, our
rts_input() is asynchronous, thus the clear/set sp_family trick no
longer takes any effect.

Reimplement the rawcb skipping in the following way:
- Record the address of rawcb to be skipped in netmsg.
- Extend raw_input() interface to accept a 'skip' argument.  At the
  beginning of the rawcb list iteration, check the address of the
  current rawcb against the 'skip'.
sys/net/raw_cb.h
sys/net/raw_usrreq.c
sys/net/rtsock.c