freebsd-dev/sys/netinet
Ruslan Ermilov 8bf82a92d5 Backout CSRG revision 7.22 to this file (if in_losing notices an
RTF_DYNAMIC route, it got freed twice).  I am not sure what was
the actual problem in 1992, but the current behavior is memory
leak if PCB holds a reference to a dynamically created/modified
routing table entry.  (rt_refcnt>0 and we don't call rtfree().)

My test bed was:

1.  Set net.inet.tcp.msl to a low value (for test purposes), e.g.,
    5 seconds, to speed up the transition of TCP connection to a
    "closed" state.
2.  Add a network route which causes ICMP redirect from the gateway.
3.  ping(8) host H that matches this route; this creates RTF_DYNAMIC
    RTF_HOST route to H.  (I was forced to use ICMP to cause gateway
    to generate ICMP host redirect, because gateway in question is a
    4.2-STABLE system vulnerable to a problem that was fixed later in
    ip_icmp.c,v 1.39.2.6, and TCP packets with DF bit set were
    triggering this bug.)
4.  telnet(1) to H
5.  Block access to H with ipfw(8)
6.  Send something in telnet(1) session; this causes EPERM, followed
    by an in_losing() call in a few seconds.
7.  Delete ipfw(8) rule blocking access to H, and wait for TCP
    connection moving to a CLOSED state; PCB is freed.
8.  Delete host route to H.
9.  Watch with netstat(1) that `rttrash' increased.
10. Repeat steps 3-9, and watch `rttrash' increases.

PR:		kern/25421
MFC after:	2 weeks
2001-06-29 12:07:29 +00:00
..
libalias Fixed the brain-o in rev. 1.10: the logic check was reversed. 2001-06-27 14:11:25 +00:00
accf_data.c Remove headers not needed. 2000-10-07 23:15:17 +00:00
accf_http.c Fix incorrect logic wouldn't disconnect incomming connections that had been 2001-01-03 19:50:23 +00:00
icmp6.h - Renumber KAME local ICMP types and NDP options numberes beacaues they 2001-06-21 07:08:43 +00:00
icmp_var.h Clean up RST ratelimiting. Previously, ratelimiting occured before tests 2001-02-11 07:39:51 +00:00
if_atm.c udp IPv6 support, IPv6/IPv4 tunneling support in kernel, 1999-12-07 17:39:16 +00:00
if_atm.h Add $FreeBSD$ 2000-05-01 20:32:07 +00:00
if_ether.c Do not perform arp send/resolve on an interface marked NOARP. 2001-06-15 21:00:32 +00:00
if_ether.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
if_fddi.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
igmp_var.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
igmp.c Add netstat(1) knob to reset net.inet.{ip|icmp|tcp|udp|igmp}.stats. 2001-06-23 17:17:59 +00:00
igmp.h
in_cksum.c
in_gif.c Sync with recent KAME. 2001-06-11 12:39:29 +00:00
in_gif.h sync with kame tree as of july00. tons of bug fixes/improvements. 2000-07-04 16:35:15 +00:00
in_hostcache.c Convert more malloc+bzero to malloc+M_ZERO. 2000-12-08 21:51:06 +00:00
in_hostcache.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
in_pcb.c Backout CSRG revision 7.22 to this file (if in_losing notices an 2001-06-29 12:07:29 +00:00
in_pcb.h Sync with recent KAME. 2001-06-11 12:39:29 +00:00
in_proto.c Sync with recent KAME. 2001-06-11 12:39:29 +00:00
in_rmx.c In in_ifadown(), differentiate between whether the interface goes 2001-05-11 14:37:34 +00:00
in_systm.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
in_var.h In in_ifadown(), differentiate between whether the interface goes 2001-05-11 14:37:34 +00:00
in.c Sync with recent KAME. 2001-06-11 12:39:29 +00:00
in.h Fix a stack of KAME netinet6/in6.h warnings: 2001-06-15 00:37:27 +00:00
ip6.h Sync with recent KAME. 2001-06-11 12:39:29 +00:00
ip_divert.c Mechanical change to use <sys/queue.h> macro API instead of 2001-02-04 13:13:25 +00:00
ip_dummynet.c Sync with the bridge/dummynet/ipfw code already tested in stable. 2001-02-10 00:10:18 +00:00
ip_dummynet.h MFS: bridge/ipfw/dummynet fixes (bridge.c will be committed separately) 2001-02-02 00:18:00 +00:00
ip_ecn.c Sync with recent KAME. 2001-06-11 12:39:29 +00:00
ip_ecn.h Sync with recent KAME. 2001-06-11 12:39:29 +00:00
ip_encap.c Sync with recent KAME. 2001-06-11 12:39:29 +00:00
ip_encap.h sync with kame tree as of july00. tons of bug fixes/improvements. 2000-07-04 16:35:15 +00:00
ip_flow.c Bring in fix from NetBSD's revision 1.16: 2001-06-26 09:00:50 +00:00
ip_flow.h Back out the previous change to the queue(3) interface. 2000-05-26 02:09:24 +00:00
ip_fw.c pipe/queue are the only consumers of flow_id, so only set it in those cases 2001-04-06 06:52:25 +00:00
ip_fw.h Introduce a new feature in IPFW: Check of the source or destination 2001-02-13 14:12:37 +00:00
ip_icmp.c Add netstat(1) knob to reset net.inet.{ip|icmp|tcp|udp|igmp}.stats. 2001-06-23 17:17:59 +00:00
ip_icmp.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
ip_id.c Add ``options RANDOM_IP_ID'' which randomizes the ID field of IP packets. 2001-06-01 10:02:28 +00:00
ip_input.c Add netstat(1) knob to reset net.inet.{ip|icmp|tcp|udp|igmp}.stats. 2001-06-23 17:17:59 +00:00
ip_mroute.c Add ``options RANDOM_IP_ID'' which randomizes the ID field of IP packets. 2001-06-01 10:02:28 +00:00
ip_mroute.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
ip_output.c Sync with recent KAME. 2001-06-11 12:39:29 +00:00
ip_var.h Sync with recent KAME. 2001-06-11 12:39:29 +00:00
ip.h IPSEC support in the kernel. 1999-12-22 19:13:38 +00:00
ipprotosw.h activate pfil_hooks and covert ipfilter to use it 2000-07-31 13:11:42 +00:00
raw_ip.c Sync with recent KAME. 2001-06-11 12:39:29 +00:00
tcp_debug.c sync with kame tree as of july00. tons of bug fixes/improvements. 2000-07-04 16:35:15 +00:00
tcp_debug.h Sorry in this just befor code freeze commit. 2000-01-29 11:49:07 +00:00
tcp_fsm.h
tcp_input.c Add netstat(1) knob to reset net.inet.{ip|icmp|tcp|udp|igmp}.stats. 2001-06-23 17:17:59 +00:00
tcp_output.c Eliminate the allocation of a tcp template structure for each 2001-06-23 03:21:46 +00:00
tcp_reass.c Add netstat(1) knob to reset net.inet.{ip|icmp|tcp|udp|igmp}.stats. 2001-06-23 17:17:59 +00:00
tcp_seq.h Say goodbye to TCP_COMPAT_42 2001-04-20 11:58:56 +00:00
tcp_subr.c Allow getcred sysctl to work in jailed root processes. Processes can 2001-06-24 12:18:27 +00:00
tcp_timer.c Eliminate the allocation of a tcp template structure for each 2001-06-23 03:21:46 +00:00
tcp_timer.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
tcp_timewait.c Allow getcred sysctl to work in jailed root processes. Processes can 2001-06-24 12:18:27 +00:00
tcp_usrreq.c Eliminate the allocation of a tcp template structure for each 2001-06-23 03:21:46 +00:00
tcp_var.h Eliminate the allocation of a tcp template structure for each 2001-06-23 03:21:46 +00:00
tcp.h o Minor style(9)ism to make consistent with -STABLE 2001-01-09 18:26:17 +00:00
tcpip.h Remove struct full_tcpiphdr{}. 2001-02-26 20:10:16 +00:00
udp_usrreq.c Allow getcred sysctl to work in jailed root processes. Processes can 2001-06-24 12:18:27 +00:00
udp_var.h remove unused data structure definition, and corresponding macro into*() 2001-02-18 07:10:03 +00:00
udp.h