diff options
author | brian <brian@FreeBSD.org> | 1997-02-02 16:33:12 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-02-02 16:33:12 +0000 |
commit | eada59b88e87dabb8beab546a26940053e20412c (patch) | |
tree | 3b22b36bda43c1116542d4ffb813de6522f42a08 /sys/netinet/ip_divert.c | |
parent | f96247a1302a72652b4c3f778b17e8f227d3e15f (diff) | |
download | FreeBSD-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.c | 3 |
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) { |