freebsd-skq/sys/netinet
Ruslan Ermilov 04287599db Fixed broken ICMP error generation, unified conversion of IP header
fields between host and network byte order.  The details:

o icmp_error() now does not add IP header length.  This fixes the problem
  when icmp_error() is called from ip_forward().  In this case the ip_len
  of the original IP datagram returned with ICMP error was wrong.

o icmp_error() expects all three fields, ip_len, ip_id and ip_off in host
  byte order, so DTRT and convert these fields back to network byte order
  before sending a message.  This fixes the problem described in PR 16240
  and PR 20877 (ip_id field was returned in host byte order).

o ip_ttl decrement operation in ip_forward() was moved down to make sure
  that it does not corrupt the copy of original IP datagram passed later
  to icmp_error().

o A copy of original IP datagram in ip_forward() was made a read-write,
  independent copy.  This fixes the problem I first reported to Garrett
  Wollman and Bill Fenner and later put in audit trail of PR 16240:
  ip_output() (not always) converts fields of original datagram to network
  byte order, but because copy (mcopy) and its original (m) most likely
  share the same mbuf cluster, ip_output()'s manipulations on original
  also corrupted the copy.

o ip_output() now expects all three fields, ip_len, ip_off and (what is
  significant) ip_id in host byte order.  It was a headache for years that
  ip_id was handled differently.  The only compatibility issue here is the
  raw IP socket interface with IP_HDRINCL socket option set and a non-zero
  ip_id field, but ip.4 manual page was unclear on whether in this case
  ip_id field should be in host or network byte order.
2000-09-01 12:33:03 +00:00
..
libalias Changed the way we handle outgoing ICMP error messages -- do 2000-09-01 09:32:44 +00:00
accf_data.c return of the accept filter part II 2000-06-20 01:09:23 +00:00
accf_http.c return of the accept filter part II 2000-06-20 01:09:23 +00:00
fil.c resolve conflicts 2000-08-13 04:31:06 +00:00
icmp6.h sync with kame tree as of july00. tons of bug fixes/improvements. 2000-07-04 16:35:15 +00:00
icmp_var.h sysctl'ize ICMP_BANDLIM and ICMP_BANDLIM_SUPPRESS_OUTPUT. 2000-05-22 16:12:28 +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 Extra sanity check when arp proxyall is enabled. Don't send an arp 2000-07-13 19:31:01 +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 #include <machine/in_cksum.h>, in order to pick up the checksum 2000-05-06 18:19:58 +00:00
igmp.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
in_cksum.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
in_gif.c repair endianness issue in IN_MULTICAST(). 2000-08-15 07:34:08 +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 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +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 When a connection is being dropped due to a listen queue overflow, 2000-07-21 23:26:37 +00:00
in_pcb.h Back out the previous change to the queue(3) interface. 2000-05-26 02:09:24 +00:00
in_proto.c Make netstat(1) to be aware of divert(4) sockets. 2000-08-03 14:09:52 +00:00
in_rmx.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +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 Back out the previous change to the queue(3) interface. 2000-05-26 02:09:24 +00:00
in.c Fixed a missing splx() in if_addmulti(). Was broken in rev.1.28. 2000-08-19 22:10:10 +00:00
in.h sync with kame tree as of july00. tons of bug fixes/improvements. 2000-07-04 16:35:15 +00:00
ip6.h remove m_pulldown statistics, which is highly experimental and does not 2000-07-12 16:39:13 +00:00
ip_auth.c Change __FreeBSD_Version into the proper __FreeBSD_version. 2000-08-01 17:14:38 +00:00
ip_auth.h fix conflicts 2000-05-24 03:17:16 +00:00
ip_compat.h resolve conflicts 2000-08-13 04:31:06 +00:00
ip_divert.c Fixed broken ICMP error generation, unified conversion of IP header 2000-09-01 12:33:03 +00:00
ip_dummynet.c close PR 19544 - ipfw pipe delete causes panic when no pipes defined 2000-07-17 20:03:27 +00:00
ip_dummynet.h Implement WF2Q+ in dummynet. 2000-06-08 09:45:23 +00:00
ip_ecn.c sync with kame tree as of july00. tons of bug fixes/improvements. 2000-07-04 16:35:15 +00:00
ip_ecn.h sync with kame tree as of july00. tons of bug fixes/improvements. 2000-07-04 16:35:15 +00:00
ip_encap.c sync with kame tree as of july00. tons of bug fixes/improvements. 2000-07-04 16:35:15 +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_fil.c resolve conflicts 2000-08-13 04:31:06 +00:00
ip_fil.h activate pfil_hooks and covert ipfilter to use it 2000-07-31 13:11:42 +00:00
ip_flow.c Back out the previous change to the queue(3) interface. 2000-05-26 02:09:24 +00:00
ip_flow.h Back out the previous change to the queue(3) interface. 2000-05-26 02:09:24 +00:00
ip_frag.c fix conflicts 2000-07-19 14:02:09 +00:00
ip_frag.h It would have been nice if this actually compiled. Close the header 2000-05-24 09:08:55 +00:00
ip_ftp_pxy.c resolve conflicts 2000-08-13 04:31:06 +00:00
ip_fw.c Add tcpoptions to ipfw. This works much in the same way as ipoptions do. 2000-06-08 15:34:51 +00:00
ip_fw.h Remove obsolete comment. 2000-08-22 00:32:52 +00:00
ip_icmp.c Fixed broken ICMP error generation, unified conversion of IP header 2000-09-01 12:33:03 +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_input.c Fixed broken ICMP error generation, unified conversion of IP header 2000-09-01 12:33:03 +00:00
ip_log.c resolve conflicts 2000-08-13 04:31:06 +00:00
ip_mroute.c Fixed broken ICMP error generation, unified conversion of IP header 2000-09-01 12:33:03 +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_nat.c resolve conflicts 2000-08-13 04:31:06 +00:00
ip_nat.h fix conflicts 2000-07-19 14:02:09 +00:00
ip_output.c Fixed broken ICMP error generation, unified conversion of IP header 2000-09-01 12:33:03 +00:00
ip_proxy.c fix conflicts 2000-05-24 04:21:35 +00:00
ip_proxy.h fix conflicts 2000-05-24 04:21:35 +00:00
ip_raudio_pxy.c fix up conflicts 2000-05-24 04:40:17 +00:00
ip_rcmd_pxy.c fix conflicts 2000-07-19 14:02:09 +00:00
ip_state.c resolve conflicts 2000-08-13 04:31:06 +00:00
ip_state.h fix conflicts 2000-07-19 14:02:09 +00:00
ip_var.h sync with kame tree as of july00. tons of bug fixes/improvements. 2000-07-04 16:35:15 +00:00
ip.h IPSEC support in the kernel. 1999-12-22 19:13:38 +00:00
ipl.h resolve conflicts 2000-08-13 04:31:06 +00:00
ipprotosw.h activate pfil_hooks and covert ipfilter to use it 2000-07-31 13:11:42 +00:00
mlfk_ipl.c resolve conflicts 2000-08-13 04:31:06 +00:00
raw_ip.c Fixed broken ICMP error generation, unified conversion of IP header 2000-09-01 12:33:03 +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 Undo rev 1.10, which took out TH_FIN from the CLOSING state. This 1999-11-07 04:18:30 +00:00
tcp_input.c When a connection is being dropped due to a listen queue overflow, 2000-07-21 23:26:37 +00:00
tcp_output.c Improve performance in the case where ip_output() returns an error. 2000-08-03 23:23:36 +00:00
tcp_reass.c When a connection is being dropped due to a listen queue overflow, 2000-07-21 23:26:37 +00:00
tcp_seq.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
tcp_subr.c When a connection is being dropped due to a listen queue overflow, 2000-07-21 23:26:37 +00:00
tcp_timer.c Previous commit changing SYSCTL_HANDLER_ARGS violated KNF. 2000-07-04 11:25:35 +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 When a connection is being dropped due to a listen queue overflow, 2000-07-21 23:26:37 +00:00
tcp_usrreq.c Support per socket based IPv4 mapped IPv6 addr enable/disable control. 2000-04-01 22:35:47 +00:00
tcp_var.h When a connection is being dropped due to a listen queue overflow, 2000-07-21 23:26:37 +00:00
tcp.h Implement TCP NewReno, as documented in RFC 2582. This allows 2000-05-06 03:31:09 +00:00
tcpip.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
udp_usrreq.c Fixed broken ICMP error generation, unified conversion of IP header 2000-09-01 12:33:03 +00:00
udp_var.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
udp.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00