History log of /openbsd-current/sys/netinet/ip_icmp.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.32 20-Dec-2020 bluhm

Accept reject and blackhole routes for IPsec PMTU discovery.

Since revision 1.87 of ip_icmp.c icmp_mtudisc_clone() ignored reject
routes. Otherwise TCP would clone these routes for PMTU discovery.
They will not work, even after dynamic routing has found a better
route than the reject route.

With IPsec the use case is different. First you need a route, but
then the flow handles the packet without routing. Usually this
route should be a reject route to avoid sending unencrypted traffic
if the flow is missing. But IPsec needs this route for PMTU
discovery, so use it for that.

OK claudio@ tobhe@


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.31 05-Nov-2018 claudio

In icmp_input_if() m_pullup up the maximum size of required data at the start.
The maximum is ICMP_MINLEN (8) + max IPv4 header size (60) + IPv6 header (40)
for the IPv6 over IPv4 transition case. By having up to this amount of data
consequtive in an mbuf makes the rest of the code simpler and no more extra
m_pullup calls are needed. Only length checks are now required.The maximum
size is also big enough for all other ICMP types that don't embed the IP
heaader. This ensures that all data has been m_pullup-ed before calling the
ctlinput function which can look that deep into the header.
OK bluhm@ markus@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
# 1.30 14-Apr-2017 bluhm

Pass down the address family through the pr_input calls. This
allows to simplify code used for both IPv4 and IPv6.
OK mikeb@ deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.29 29-Jan-2017 bluhm

Change the IPv4 pr_input function to the way IPv6 is implemented,
to get rid of struct ip6protosw and some wrapper functions. It is
more consistent to have less different structures. The divert_input
functions cannot be called anyway, so remove them.
OK visa@ mpi@


# 1.28 25-Jan-2017 bluhm

Since raw_input() and route_input() are gone from pr_input, we can
make the variable parameters of the protocol input functions fixed.
Also add the proto to make it similar to IPv6.
OK mpi@ guenther@ millert@


Revision tags: OPENBSD_6_0_BASE
# 1.27 07-Mar-2016 mmcc

http -> https for IETF/IANA URLs in comments


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.26 13-Jul-2014 mpi

Stop using old n_time, n_long and n_short types in netinet headers.

ok deraadt@, naddy@


Revision tags: OPENBSD_5_5_BASE
# 1.25 08-Aug-2013 mpi

Change MTU discovery functions to not abuse the global icmpsrc variable
to pass the destination address of the route to clone.

ok markus@, mikeb@


Revision tags: OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.24 13-Sep-2010 claudio

Change icmp_reflect() so that it does not call icmp_send directly. This
allows other users (like MPLS) use this function instead of rolling a own
version. Implement icmp_do_exthdr() to attach an RFC 4884 extension header
to an ICMP error produced by icmp_do_error().
"best to get it in." deraadt@


Revision tags: OPENBSD_4_8_BASE
# 1.23 08-Jul-2010 claudio

Add definitions for ICMP extended headers available for some ICMP messages
like time exceeded messages. This will allow to add additional information
to those messges like the incomming MPLS label.
OK deraadt@, dhill@


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.22 05-Jun-2009 claudio

Initial support for routing domains. This allows to bind interfaces to
alternate routing table and separate them from other interfaces in distinct
routing tables. The same network can now be used in any doamin at the same
time without causing conflicts.
This diff is mostly mechanical and adds the necessary rdomain checks accross
net and netinet. L2 and IPv4 are mostly covered still missing pf and IPv6.
input and tested by jsg@, phessler@ and reyk@. "put it in" deraadt@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.21 31-Jul-2005 pascoe

Change the API for icmp_do_error so that it takes the mtu directly, rather
than a pointer to struct ifnet containing it.

Saves a 448 byte stack allocation in ip_forward which previously faked up
a struct ifnet just for this purpose.

idea ok deraadt millert


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE SMP_SYNC_A SMP_SYNC_B
# 1.20 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: UBC_SYNC_A
# 1.19 10-May-2003 dhartmei

"enought to" -> "enough to" comment typo


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_B
# 1.18 09-Jun-2002 itojun

whitespace


# 1.17 08-Jun-2002 jasoni

Break up icmp_error() so we can have the icmp error mbuf returned
instead of it being sent to ip_output().


Revision tags: OPENBSD_3_1_BASE
# 1.16 14-Mar-2002 millert

First round of __P removal in sys


# 1.15 12-Jan-2002 ericj

add rediraccept and redirtimeout sysctl's.
rediraccept allows one to ignore ICMP_REDIRECT
redirtimeout sets a timeout on the routing entries pretaining to
ICMP_REDIRECT, this timeout is defaulted to 10 minutes. (same as ipv6)
From NetBSD.
millert@ ok


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.14 04-Jul-2001 angelos

branches: 1.14.4;
Update with codes, URL, RFCs, from jason@Ackley.NET, closes PR 1919


# 1.13 09-Jun-2001 angelos

Inclusion protection.


Revision tags: OPENBSD_2_9_BASE
# 1.12 12-Dec-2000 mickey

a few more icmp types/codes; itojun@ ok (awhile ago ;)


# 1.11 11-Dec-2000 provos

turn off path mtu when icmp needfrag messages get blocked, okay itojun@


Revision tags: OPENBSD_2_8_BASE
# 1.10 10-Oct-2000 provos

verify payload of the icmp need fragment message at the tcp layer. okay itojun@


Revision tags: OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE SMP_BASE kame_19991208
# 1.9 07-Jan-1999 deraadt

branches: 1.9.6;
add ipv6 transition related ICMP errors


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE
# 1.8 26-Aug-1997 deraadt

indent


Revision tags: OPENBSD_2_1_BASE
# 1.7 04-Feb-1997 kstailey

changed comment to reflect RFC-1812


# 1.6 04-Feb-1997 kstailey

Changed ICMP "unreachable" code #defines to match the ones in
tcpdump/print-icmp.c since they were in BSD first.


# 1.5 30-Jan-1997 kstailey

Added ICMP Destination Unreachable codes from RFC-1812:

14 = Host Precedence Violation. Sent by the first hop router to a
host to indicate that a requested precedence is not permitted
for the particular combination of source/destination host or

15 = Precedence cutoff in effect. The network operators have imposed
a minimum level of precedence required for operation, the
datagram was sent with a precedence below this level;


# 1.4 30-Jan-1997 kstailey

added #define for Communication Administratively Prohibited
as in RFC-1812 Section 5.2.7.1 Destination Unreachable


Revision tags: OPENBSD_2_0_BASE
# 1.3 02-Aug-1996 tholo

ICMP Router Discovery definitions; from FreeBSD


# 1.2 03-Mar-1996 niklas

From NetBSD: 960217 merge


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.31 05-Nov-2018 claudio

In icmp_input_if() m_pullup up the maximum size of required data at the start.
The maximum is ICMP_MINLEN (8) + max IPv4 header size (60) + IPv6 header (40)
for the IPv6 over IPv4 transition case. By having up to this amount of data
consequtive in an mbuf makes the rest of the code simpler and no more extra
m_pullup calls are needed. Only length checks are now required.The maximum
size is also big enough for all other ICMP types that don't embed the IP
heaader. This ensures that all data has been m_pullup-ed before calling the
ctlinput function which can look that deep into the header.
OK bluhm@ markus@


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE
# 1.30 14-Apr-2017 bluhm

Pass down the address family through the pr_input calls. This
allows to simplify code used for both IPv4 and IPv6.
OK mikeb@ deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.29 29-Jan-2017 bluhm

Change the IPv4 pr_input function to the way IPv6 is implemented,
to get rid of struct ip6protosw and some wrapper functions. It is
more consistent to have less different structures. The divert_input
functions cannot be called anyway, so remove them.
OK visa@ mpi@


# 1.28 25-Jan-2017 bluhm

Since raw_input() and route_input() are gone from pr_input, we can
make the variable parameters of the protocol input functions fixed.
Also add the proto to make it similar to IPv6.
OK mpi@ guenther@ millert@


Revision tags: OPENBSD_6_0_BASE
# 1.27 07-Mar-2016 mmcc

http -> https for IETF/IANA URLs in comments


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.26 13-Jul-2014 mpi

Stop using old n_time, n_long and n_short types in netinet headers.

ok deraadt@, naddy@


Revision tags: OPENBSD_5_5_BASE
# 1.25 08-Aug-2013 mpi

Change MTU discovery functions to not abuse the global icmpsrc variable
to pass the destination address of the route to clone.

ok markus@, mikeb@


Revision tags: OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.24 13-Sep-2010 claudio

Change icmp_reflect() so that it does not call icmp_send directly. This
allows other users (like MPLS) use this function instead of rolling a own
version. Implement icmp_do_exthdr() to attach an RFC 4884 extension header
to an ICMP error produced by icmp_do_error().
"best to get it in." deraadt@


Revision tags: OPENBSD_4_8_BASE
# 1.23 08-Jul-2010 claudio

Add definitions for ICMP extended headers available for some ICMP messages
like time exceeded messages. This will allow to add additional information
to those messges like the incomming MPLS label.
OK deraadt@, dhill@


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.22 05-Jun-2009 claudio

Initial support for routing domains. This allows to bind interfaces to
alternate routing table and separate them from other interfaces in distinct
routing tables. The same network can now be used in any doamin at the same
time without causing conflicts.
This diff is mostly mechanical and adds the necessary rdomain checks accross
net and netinet. L2 and IPv4 are mostly covered still missing pf and IPv6.
input and tested by jsg@, phessler@ and reyk@. "put it in" deraadt@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.21 31-Jul-2005 pascoe

Change the API for icmp_do_error so that it takes the mtu directly, rather
than a pointer to struct ifnet containing it.

Saves a 448 byte stack allocation in ip_forward which previously faked up
a struct ifnet just for this purpose.

idea ok deraadt millert


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE SMP_SYNC_A SMP_SYNC_B
# 1.20 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: UBC_SYNC_A
# 1.19 10-May-2003 dhartmei

"enought to" -> "enough to" comment typo


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_B
# 1.18 09-Jun-2002 itojun

whitespace


# 1.17 08-Jun-2002 jasoni

Break up icmp_error() so we can have the icmp error mbuf returned
instead of it being sent to ip_output().


Revision tags: OPENBSD_3_1_BASE
# 1.16 14-Mar-2002 millert

First round of __P removal in sys


# 1.15 12-Jan-2002 ericj

add rediraccept and redirtimeout sysctl's.
rediraccept allows one to ignore ICMP_REDIRECT
redirtimeout sets a timeout on the routing entries pretaining to
ICMP_REDIRECT, this timeout is defaulted to 10 minutes. (same as ipv6)
From NetBSD.
millert@ ok


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.14 04-Jul-2001 angelos

branches: 1.14.4;
Update with codes, URL, RFCs, from jason@Ackley.NET, closes PR 1919


# 1.13 09-Jun-2001 angelos

Inclusion protection.


Revision tags: OPENBSD_2_9_BASE
# 1.12 12-Dec-2000 mickey

a few more icmp types/codes; itojun@ ok (awhile ago ;)


# 1.11 11-Dec-2000 provos

turn off path mtu when icmp needfrag messages get blocked, okay itojun@


Revision tags: OPENBSD_2_8_BASE
# 1.10 10-Oct-2000 provos

verify payload of the icmp need fragment message at the tcp layer. okay itojun@


Revision tags: OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE SMP_BASE kame_19991208
# 1.9 07-Jan-1999 deraadt

branches: 1.9.6;
add ipv6 transition related ICMP errors


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE
# 1.8 26-Aug-1997 deraadt

indent


Revision tags: OPENBSD_2_1_BASE
# 1.7 04-Feb-1997 kstailey

changed comment to reflect RFC-1812


# 1.6 04-Feb-1997 kstailey

Changed ICMP "unreachable" code #defines to match the ones in
tcpdump/print-icmp.c since they were in BSD first.


# 1.5 30-Jan-1997 kstailey

Added ICMP Destination Unreachable codes from RFC-1812:

14 = Host Precedence Violation. Sent by the first hop router to a
host to indicate that a requested precedence is not permitted
for the particular combination of source/destination host or

15 = Precedence cutoff in effect. The network operators have imposed
a minimum level of precedence required for operation, the
datagram was sent with a precedence below this level;


# 1.4 30-Jan-1997 kstailey

added #define for Communication Administratively Prohibited
as in RFC-1812 Section 5.2.7.1 Destination Unreachable


Revision tags: OPENBSD_2_0_BASE
# 1.3 02-Aug-1996 tholo

ICMP Router Discovery definitions; from FreeBSD


# 1.2 03-Mar-1996 niklas

From NetBSD: 960217 merge


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


Revision tags: OPENBSD_6_2_BASE
# 1.30 14-Apr-2017 bluhm

Pass down the address family through the pr_input calls. This
allows to simplify code used for both IPv4 and IPv6.
OK mikeb@ deraadt@


Revision tags: OPENBSD_6_1_BASE
# 1.29 29-Jan-2017 bluhm

Change the IPv4 pr_input function to the way IPv6 is implemented,
to get rid of struct ip6protosw and some wrapper functions. It is
more consistent to have less different structures. The divert_input
functions cannot be called anyway, so remove them.
OK visa@ mpi@


# 1.28 25-Jan-2017 bluhm

Since raw_input() and route_input() are gone from pr_input, we can
make the variable parameters of the protocol input functions fixed.
Also add the proto to make it similar to IPv6.
OK mpi@ guenther@ millert@


Revision tags: OPENBSD_6_0_BASE
# 1.27 07-Mar-2016 mmcc

http -> https for IETF/IANA URLs in comments


Revision tags: OPENBSD_5_6_BASE OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.26 13-Jul-2014 mpi

Stop using old n_time, n_long and n_short types in netinet headers.

ok deraadt@, naddy@


Revision tags: OPENBSD_5_5_BASE
# 1.25 08-Aug-2013 mpi

Change MTU discovery functions to not abuse the global icmpsrc variable
to pass the destination address of the route to clone.

ok markus@, mikeb@


Revision tags: OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.24 13-Sep-2010 claudio

Change icmp_reflect() so that it does not call icmp_send directly. This
allows other users (like MPLS) use this function instead of rolling a own
version. Implement icmp_do_exthdr() to attach an RFC 4884 extension header
to an ICMP error produced by icmp_do_error().
"best to get it in." deraadt@


Revision tags: OPENBSD_4_8_BASE
# 1.23 08-Jul-2010 claudio

Add definitions for ICMP extended headers available for some ICMP messages
like time exceeded messages. This will allow to add additional information
to those messges like the incomming MPLS label.
OK deraadt@, dhill@


Revision tags: OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.22 05-Jun-2009 claudio

Initial support for routing domains. This allows to bind interfaces to
alternate routing table and separate them from other interfaces in distinct
routing tables. The same network can now be used in any doamin at the same
time without causing conflicts.
This diff is mostly mechanical and adds the necessary rdomain checks accross
net and netinet. L2 and IPv4 are mostly covered still missing pf and IPv6.
input and tested by jsg@, phessler@ and reyk@. "put it in" deraadt@


Revision tags: OPENBSD_3_8_BASE OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE
# 1.21 31-Jul-2005 pascoe

Change the API for icmp_do_error so that it takes the mtu directly, rather
than a pointer to struct ifnet containing it.

Saves a 448 byte stack allocation in ip_forward which previously faked up
a struct ifnet just for this purpose.

idea ok deraadt millert


Revision tags: OPENBSD_3_4_BASE OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE SMP_SYNC_A SMP_SYNC_B
# 1.20 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: UBC_SYNC_A
# 1.19 10-May-2003 dhartmei

"enought to" -> "enough to" comment typo


Revision tags: OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_B
# 1.18 09-Jun-2002 itojun

whitespace


# 1.17 08-Jun-2002 jasoni

Break up icmp_error() so we can have the icmp error mbuf returned
instead of it being sent to ip_output().


Revision tags: OPENBSD_3_1_BASE
# 1.16 14-Mar-2002 millert

First round of __P removal in sys


# 1.15 12-Jan-2002 ericj

add rediraccept and redirtimeout sysctl's.
rediraccept allows one to ignore ICMP_REDIRECT
redirtimeout sets a timeout on the routing entries pretaining to
ICMP_REDIRECT, this timeout is defaulted to 10 minutes. (same as ipv6)
From NetBSD.
millert@ ok


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.14 04-Jul-2001 angelos

branches: 1.14.4;
Update with codes, URL, RFCs, from jason@Ackley.NET, closes PR 1919


# 1.13 09-Jun-2001 angelos

Inclusion protection.


Revision tags: OPENBSD_2_9_BASE
# 1.12 12-Dec-2000 mickey

a few more icmp types/codes; itojun@ ok (awhile ago ;)


# 1.11 11-Dec-2000 provos

turn off path mtu when icmp needfrag messages get blocked, okay itojun@


Revision tags: OPENBSD_2_8_BASE
# 1.10 10-Oct-2000 provos

verify payload of the icmp need fragment message at the tcp layer. okay itojun@


Revision tags: OPENBSD_2_5_BASE OPENBSD_2_6_BASE OPENBSD_2_7_BASE SMP_BASE kame_19991208
# 1.9 07-Jan-1999 deraadt

branches: 1.9.6;
add ipv6 transition related ICMP errors


Revision tags: OPENBSD_2_2_BASE OPENBSD_2_3_BASE OPENBSD_2_4_BASE
# 1.8 26-Aug-1997 deraadt

indent


Revision tags: OPENBSD_2_1_BASE
# 1.7 04-Feb-1997 kstailey

changed comment to reflect RFC-1812


# 1.6 04-Feb-1997 kstailey

Changed ICMP "unreachable" code #defines to match the ones in
tcpdump/print-icmp.c since they were in BSD first.


# 1.5 30-Jan-1997 kstailey

Added ICMP Destination Unreachable codes from RFC-1812:

14 = Host Precedence Violation. Sent by the first hop router to a
host to indicate that a requested precedence is not permitted
for the particular combination of source/destination host or

15 = Precedence cutoff in effect. The network operators have imposed
a minimum level of precedence required for operation, the
datagram was sent with a precedence below this level;


# 1.4 30-Jan-1997 kstailey

added #define for Communication Administratively Prohibited
as in RFC-1812 Section 5.2.7.1 Destination Unreachable


Revision tags: OPENBSD_2_0_BASE
# 1.3 02-Aug-1996 tholo

ICMP Router Discovery definitions; from FreeBSD


# 1.2 03-Mar-1996 niklas

From NetBSD: 960217 merge


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision