summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_divert.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-02-02 16:33:12 +0000
committerbrian <brian@FreeBSD.org>1997-02-02 16:33:12 +0000
commiteada59b88e87dabb8beab546a26940053e20412c (patch)
tree3b22b36bda43c1116542d4ffb813de6522f42a08 /sys/netinet/ip_divert.c
parentf96247a1302a72652b4c3f778b17e8f227d3e15f (diff)
downloadFreeBSD-src-eada59b88e87dabb8beab546a26940053e20412c.zip
FreeBSD-src-eada59b88e87dabb8beab546a26940053e20412c.tar.gz
Reset ip_divert_ignore to zero immediately after use - also,
set it in the first place, independent of whether sin->sin_port is set. The result is that diverted packets that are being forwarded will be diverted once and only once on the way in (ip_input()) and again, once and only once on the way out (ip_output()) - twice in total. ICMP packets that don't contain a port will now also be diverted.
Diffstat (limited to 'sys/netinet/ip_divert.c')
-rw-r--r--sys/netinet/ip_divert.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index c35b2ca..fc25b70 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -206,8 +206,7 @@ div_output(so, m, addr, control)
sin = mtod(addr, struct sockaddr_in *);
/* Loopback avoidance option */
- if (sin && sin->sin_port)
- ip_divert_ignore = ntohs(inp->inp_lport);
+ ip_divert_ignore = ntohs(inp->inp_lport);
/* Reinject packet into the system as incoming or outgoing */
if (!sin || sin->sin_addr.s_addr == 0) {
OpenPOWER on IntegriCloud