aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/ip_icmp.h
Commit message (Collapse)AuthorAgeFilesLines
* sys: Remove ancient SCCS tags.Warner Losh2023-11-271-2/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* netinet*: remove PRC_ constants and streamline ICMP processingGleb Smirnoff2022-10-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the original design of the network stack from the protocol control input method pr_ctlinput was used notify the protocols about two very different kinds of events: internal system events and receival of an ICMP messages from outside. These events were coded with PRC_ codes. Today these methods are removed from the protosw(9) and are isolated to IPv4 and IPv6 stacks and are called only from icmp*_input(). The PRC_ codes now just create a shim layer between ICMP codes and errors or actions taken by protocols. - Change ipproto_ctlinput_t to pass just pointer to ICMP header. This allows protocols to not deduct it from the internal IP header. - Change ip6proto_ctlinput_t to pass just struct ip6ctlparam pointer. It has all the information needed to the protocols. In the structure, change ip6c_finaldst fields to sockaddr_in6. The reason is that icmp6_input() already has this address wrapped in sockaddr, and the protocols want this address as sockaddr. - For UDP tunneling control input, as well as for IPSEC control input, change the prototypes to accept a transparent union of either ICMP header pointer or struct ip6ctlparam pointer. - In icmp_input() and icmp6_input() do only validation of ICMP header and count bad packets. The translation of ICMP codes to errors/actions is done by protocols. - Provide icmp_errmap() and icmp6_errmap() as substitute to inetctlerrmap, inet6ctlerrmap arrays. - In protocol ctlinput methods either trust what icmp_errmap() recommend, or do our own logic based on the ICMP header. Differential revision: https://reviews.freebsd.org/D36731
* sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326023
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Add support for handling ICMP and ICMP6 messages sent in responseMichael Tuexen2016-04-291-2/+3
| | | | | | | to SCTP/UDP/IP and SCTP/UDP/IPv6 packets. Notes: svn path=/head/; revision=298800
* Allow the handling of ICMP messages sent in response to SCTP packetsMichael Tuexen2016-04-141-2/+3
| | | | | | | | | | | containing an INIT chunk. These need to be handled in case the peer does not support SCTP and returns an ICMP messages indicating destination unreachable, protocol unreachable. MFC after: 1 week Notes: svn path=/head/; revision=297990
* When delivering an ICMP packet to the ctlinput function, ensure thatMichael Tuexen2016-04-141-0/+6
| | | | | | | | | | | | | | | the outer IP header, the ICMP header, the inner IP header and the first n bytes are stored in contgous memory. The ctlinput functions currently rely on this for n = 8. This fixes a bug in case the inner IP header had options. While there, remove the options from the outer header and provide a way to increase n to allow improved ICMP handling for SCTP. This will be added in another commit. MFC after: 1 week Notes: svn path=/head/; revision=297989
* Where appropriate, use the modern terms for the one true time baseWarner Losh2014-12-211-1/+1
| | | | | | | | | (UTC) rather than the archaic (GMT) in comments. Except where the comments are making fun of people doing this (and pedants who insist on the new terms). Notes: svn path=/head/; revision=275985
* Merge 'struct ip6protosw' and 'struct protosw' into one. Now we haveKevin Lo2014-08-081-1/+1
| | | | | | | | | | only one protocol switch structure that is shared between ipv4 and ipv6. Phabric: D476 Reviewed by: jhb Notes: svn path=/head/; revision=269699
* MFP4: @176978-176982, 176984, 176990-176994, 177441Bjoern A. Zeeb2010-04-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Whitspace" churn after the VIMAGE/VNET whirls. Remove the need for some "init" functions within the network stack, like pim6_init(), icmp_init() or significantly shorten others like ip6_init() and nd6_init(), using static initialization again where possible and formerly missed. Move (most) variables back to the place they used to be before the container structs and VIMAGE_GLOABLS (before r185088) and try to reduce the diff to stable/7 and earlier as good as possible, to help out-of-tree consumers to update from 6.x or 7.x to 8 or 9. This also removes some header file pollution for putatively static global variables. Revert VIMAGE specific changes in ipfilter::ip_auth.c, that are no longer needed. Reviewed by: jhb Discussed with: rwatson Sponsored by: The FreeBSD Foundation Sponsored by: CK Software GmbH MFC after: 6 days Notes: svn path=/head/; revision=207369
* Use uint32_t instead of n_long and n_time, and uint16_t instead of n_short.Luigi Rizzo2009-02-131-9/+13
| | | | | | | | | | | | Add a note next to fields in network format. The n_* types are not enough for compiler checks on endianness, and their use often requires an otherwise unnecessary #include <netinet/in_systm.h> The typedef in in_systm.h are still there. Notes: svn path=/head/; revision=188578
* Change the initialization methodology for global variables scheduledMarko Zec2008-11-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | for virtualization. Instead of initializing the affected global variables at instatiation, assign initial values to them in initializer functions. As a rule, initialization at instatiation for such variables should never be introduced again from now on. Furthermore, enclose all instantiations of such global variables in #ifdef VIMAGE_GLOBALS blocks. Essentialy, this change should have zero functional impact. In the next phase of merging network stack virtualization infrastructure from p4/vimage branch, the new initialization methology will allow us to switch between using global variables and their counterparts residing in virtualization containers with minimum code churn, and in the long run allow us to intialize multiple instances of such container structures. Discussed at: devsummit Strassburg Reviewed by: bz, julian Approved by: julian (mentor) Obtained from: //depot/projects/vimage-commit2/... X-MFC after: never Sponsored by: NLnet Foundation, The FreeBSD Foundation Notes: svn path=/head/; revision=185088
* Pass icmp_error() the MTU argument directly instead ofAndre Oppermann2005-05-041-1/+1
| | | | | | | | an interface pointer. This simplifies a couple of uses and removes some XXX workarounds. Notes: svn path=/head/; revision=145863
* Introduce a struct icmphdr which contains the type, code, and cksumBrooks Davis2005-04-261-0/+11
| | | | | | | | | | | | | | | | | | | | fields of an ICMP packet. Use this to allow ipfw to pullup only these values since it does not use the rest of the packet and it was failed on ICMP packets because they were not long enough. struct icmp should probably be modified to use these at some point, but that will break a fair bit of code so it can wait for another day. On the off chance that adding this struct breaks something in ports, bump __FreeBSD_version. Reported by: Randy Bush <randy at psg dot com> Tested by: Randy Bush <randy at psg dot com> Notes: svn path=/head/; revision=145565
* Move Path MTU discovery ICMP processing from icmp_input() toAndre Oppermann2005-04-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | tcp_ctlinput() and subject it to active tcpcb and sequence number checking. Previously any ICMP unreachable/needfrag message would cause an update to the TCP hostcache. Now only ICMP PMTU messages belonging to an active TCP session with the correct src/dst/port and sequence number will update the hostcache and complete the path MTU discovery process. Note that we don't entirely implement the recommended counter measures of Section 7.2 of the paper. However we close down the possible degradation vector from trivially easy to really complex and resource intensive. In addition we have limited the smallest acceptable MTU with net.inet.tcp.minmss sysctl for some time already, further reducing the effect of any degradation due to an attack. Security: draft-gont-tcpm-icmp-attacks-03.txt Section 7.2 MFC after: 3 days Notes: svn path=/head/; revision=145360
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-071-1/+1
| | | | Notes: svn path=/head/; revision=139823
* Remove advertising clause from University of California Regent'sWarner Losh2004-04-071-4/+0
| | | | | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson Notes: svn path=/head/; revision=128019
* Tweak existing header and other build infrastructure to be able to buildMax Laier2004-02-261-1/+16
| | | | | | | | | | pf/pflog/pfsync as modules. Do not list them in NOTES or modules/Makefile (i.e. do not connect it to any (automatic) builds - yet). Approved by: bms(mentor) Notes: svn path=/head/; revision=126263
* Add comments regarding the ICMP timestamp fields.Matthew N. Dodd2003-03-211-4/+4
| | | | Notes: svn path=/head/; revision=112464
* Fix two instances of variant struct definitions in sys/netinet:Poul-Henning Kamp2002-10-201-5/+0
| | | | | | | | | | | | | | | | | Remove the never completed _IP_VHL version, it has not caught on anywhere and it would make us incompatible with other BSD netstacks to retain this version. Add a CTASSERT protecting sizeof(struct ip) == 20. Don't let the size of struct ipq depend on the IPDIVERT option. This is a functional no-op commit. Approved by: re Notes: svn path=/head/; revision=105586
* Remove __P.Alfred Perlstein2002-03-191-2/+2
| | | | Notes: svn path=/head/; revision=92723
* Patches from Keiichi SHIMA <keiichi@iij.ad.jp>Julian Elischer2001-09-031-1/+1
| | | | | | | | | to make ip use the standard protosw structure again. Obtained from: Well, KAME I guess. Notes: svn path=/head/; revision=82884
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"Peter Wemm1999-12-291-1/+1
| | | | | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come. Notes: svn path=/head/; revision=55205
* IPSEC support in the kernel.Yoshinobu Inoue1999-12-221-1/+1
| | | | | | | | | | | pr_input() routines prototype is also changed to support IPSEC and IPV6 chained protocol headers. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project Notes: svn path=/head/; revision=55009
* add two more codes to ICMP error 12 (Parameter Problem).Jonathan M. Bresler1999-11-151-0/+2
| | | | | | | | | these two are detailed in RFC1700. Reviewed by: Garrett Wollman <wollman@khavrinen.lcs.mit.edu> Notes: svn path=/head/; revision=53187
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Declare id_mask as a fixed-size type.Bruce Evans1998-07-131-2/+2
| | | | Notes: svn path=/head/; revision=37621
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Add #define's for RFC1716/RFC1812 new ICMP UNREACHABLE types.Bill Fenner1996-08-201-1/+4
| | | | | | | Obtained from: LBL's tcpdump distribution Notes: svn path=/head/; revision=17720
* Eliminate some more references to separate ip_v and ip_hl fields.Garrett Wollman1996-07-241-1/+6
| | | | Notes: svn path=/head/; revision=17269
* Fix a bunch of spelling errors in the comment fields ofMike Pritchard1996-01-301-2/+2
| | | | | | | a bunch of system include files. Notes: svn path=/head/; revision=13765
* Add definitions for ICMP router discovery.Bill Fenner1996-01-191-1/+20
| | | | | | | Reviewed by: wollman Notes: svn path=/head/; revision=13486
* New style sysctl & staticize alot of stuff.Poul-Henning Kamp1995-11-141-4/+1
| | | | Notes: svn path=/head/; revision=12296
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-2/+2
| | | | Notes: svn path=/head/; revision=8876
* Made idempotent.Paul Richards1994-08-211-1/+6
| | | | | | | Submitted by: Paul Notes: svn path=/head/; revision=2169
* Added $Id$David Greenman1994-08-021-0/+1
| | | | Notes: svn path=/head/; revision=1817
* BSD 4.4 Lite Kernel SourcesRodney W. Grimes1994-05-241-0/+160
Notes: svn path=/head/; revision=1541