diff options
author | julian <julian@FreeBSD.org> | 1998-05-25 07:41:23 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1998-05-25 07:41:23 +0000 |
commit | 32d95890269b32e2d6156063f80005fa857b2ce0 (patch) | |
tree | fd03121151316902a95e8cba11459000bce13530 /sys/netinet | |
parent | 538a48501430532406b95c8fba07528f2db29998 (diff) | |
download | FreeBSD-src-32d95890269b32e2d6156063f80005fa857b2ce0.zip FreeBSD-src-32d95890269b32e2d6156063f80005fa857b2ce0.tar.gz |
Take the user's "IGNORE_DIVERT" argument from where the user put it
and not from the PCB which HAPPENS to contain the same number most
of the time, but not always.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/ip_divert.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index ad214c7..3e7c6a3 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ip_divert.c,v 1.22 1998/03/28 10:18:23 bde Exp $ + * $Id: ip_divert.c,v 1.23 1998/05/15 20:11:33 wollman Exp $ */ #include "opt_inet.h" @@ -221,16 +221,18 @@ div_output(so, m, addr, control) { register struct inpcb *const inp = sotoinpcb(so); register struct ip *const ip = mtod(m, struct ip *); - struct sockaddr_in *sin = NULL; + struct sockaddr_in *sin = (struct sockaddr_in *)addr; int error = 0; if (control) m_freem(control); /* XXX */ - if (addr) - sin = (struct sockaddr_in *)addr; /* Loopback avoidance option */ - ip_divert_ignore = ntohs(inp->inp_lport); + if (sin) { + ip_divert_ignore = ntohs(sin->sin_port); + } else { + ip_divert_ignore = 0; + } /* Reinject packet into the system as incoming or outgoing */ if (!sin || sin->sin_addr.s_addr == 0) { |