Simplify the reverse PCB lookup logic. The PF_TAG_TRANSLATE_LOCALHOST
authorbluhm <bluhm@openbsd.org>
Fri, 1 Dec 2017 10:33:33 +0000 (10:33 +0000)
committerbluhm <bluhm@openbsd.org>
Fri, 1 Dec 2017 10:33:33 +0000 (10:33 +0000)
commit511f7f2b9e32699a40c156421e4e666b2b62108e
tree34c46270cbb88b70b59c1b85a8d862a77ea6ee3c
parentda83dccb6a4fe2525e742b5766d8e12b06e1eac1
Simplify the reverse PCB lookup logic.  The PF_TAG_TRANSLATE_LOCALHOST
security check prevents that the user accidentally configures
redirect where a divert-to would be appropriate.  Instead of spreading
the logic into tcp and udp input, check the flag during PCB listen
lookup.  This also reduces parameters of in_pcblookup_listen().
OK visa@
sys/net/pf.c
sys/netinet/in_pcb.c
sys/netinet/in_pcb.h
sys/netinet/tcp_input.c
sys/netinet/tcp_usrreq.c
sys/netinet/udp_usrreq.c