summaryrefslogtreecommitdiff
path: root/ip6.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove historic ECN definitions from IPv6Richard Scheffenegger2020-02-291-5/+0
|
* Use more HTTPS in URLsFrancois-Xavier Le Bail2019-08-191-1/+1
| | | | [skip ci]
* Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-1/+1
| | | | | | | The exceptions are currently: Some EXTRACT_ in print-juniper.c, not used on packet buffer pointer. An EXTRACT_BE_U_3 in addrtoname.c, not always used on packet buffer pointer.
* Get rid of ND_UNALIGNED.Guy Harris2018-02-141-6/+6
| | | | | | | Structures that describe packet formats now all use nd_ types, none of which require more than 1-byte alignment, so compilers shouldn't assume that anything in those structures is aligned on any particular boundary, even without a "this is unaligned" hint.
* RT6: Replace 'struct in6_addr' members type with a 'nd_ipv6' oneFrancois-Xavier Le Bail2018-01-301-4/+4
| | | | | | | | | | | | | | In 'struct ip6_hdr', 'struct ip6_rthdr0' and 'struct ip6_srh'. This avoid some 'undefined-behavior' warnings with clang and option -fsanitize=undefined enabled. print-rt6.c:66:3: runtime error: member access within misaligned address 0x61d00001eab6 for type 'const struct ip6_rthdr0', which requires 4 byte alignment 0x61d00001eab6: note: pointer points here 00 00 00 04 3a 02 00 01 00 00 00 00 22 00 00 00 00 00 02 10 00 02 00 00 00 00 00 04 80 00 d3 ab ^ SUMMARY: AddressSanitizer: undefined-behavior print-rt6.c:66:3 in
* Don't test for __attribute__ in the configure script.Guy Harris2018-01-211-6/+6
| | | | | | | | | Instead, use compiler test macros to check whether *particular* attributes are supported, and set various #defines appropriately, in header files. Rename the UNALIGNED structure attribute to ND_UNALIGNED, and ask whether we still need it.
* Add support for IPv6 routing header type 4Ahmed Abdelsalam2017-12-291-0/+16
| | | | | | | | | IPv6 routing header type 4 is known as Segment Routing Header (SRH). It is used by Segment Routing (SR) to steer a packet through a controlled set of instructions, called segments. It is described in https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-07 An extension is added to allow tcpdump to print SRH information.
* Use nd_ types in the IPv6 structures.Guy Harris2017-12-111-20/+20
| | | | | | And add the EXTRACT_U_1() calls as needed. Change some other EXTRACT_ calls that no longer need an & operator.
* RT6: Fix alignment issue with Solaris Studio 12.3 on Solaris 10 SPARCFrancois-Xavier Le Bail2017-09-131-6/+6
| | | | | | | | | | | Fix the 'Bus Error - core dumped' issue with the 'ipv6-routing-header' test when '-m64' compiling option is used. Fix with the method described in commit 1376682. /opt/solarisstudio12.3/bin/cc -V gives: cc: Sun C 5.12 SunOS_sparc Patch 148917-09 2016/08/02
* CVE-2017-12986/IPv6 R.H.: Update to reflect the actual IPv6 RFC.Guy Harris2017-09-131-3/+2
| | | | | | | | | | | | | In RFC 1883, the Type 0 routing header had a 1-byte reserved field and a 3-byte strict/loose bit map; in RFC 2460, that changed to a 4-byte reserved field. This fixes a buffer over-read discovered by Brian 'geeknik' Carpenter (by making an ND_TCHECK() call check for the presence in the captured data of all 4 bytes of the reserved field; we were printing it as a 4-byte field, so we needed to check for them). Add a test using the capture file supplied by the reporter(s).
* Don't overwrite the destination IPv6 address for routing headers.Guy Harris2016-02-121-3/+4
| | | | | | | | | | | If we have a routing header, instead of overwriting the packet's IPv6 destination address in the packet with the final destination, so that the next protocol's checksum routine can use it, we do as we do for IPv4, and, in the "next protocol checksum" routine, scan the headers looking for a routing header and, if we find one, copy the final destination from it. While we're at it, clean up a few things.
* More getting rid of old u_intN_t.Guy Harris2014-04-231-28/+28
|
* fix partial checksum errors in DCCP decoder, IPv6 caseFrancois-Xavier Le Bail2014-02-161-1/+1
|
* IPv6: refresh options decoding (GH #47 pt. 3)Denis Ovsienko2014-01-041-3/+12
| | | | | | | | | Brian Haley points that mobility (sub-)options decoded in print-ip6opts.c are specific to draft-ietf-mobileip-ipv6 only. RFC3775 (and respectively RFC6275) uses different encoding and parameter space, which print-mobility.c already handles. Remove deprecated code and update some related macros.
* remove tcpdump's own CVS keywordsDenis Ovsienko2014-01-031-1/+0
| | | | | | Remove lots of $Header's and a few $Id's that all belong to the former CVS repository of tcpdump itself. These keywords have been frozen since the migration to git in late 2008.
* print-ip6: add a test on the header version valuefxlb2013-11-121-0/+1
|
* Use nextproto6_cksum() for XXX-over-IPv6 checksums.Guy Harris2011-06-171-1/+1
| | | | Get rid of duplicated checksums with IPv6 pseudo-headers.
* Go with Wireshark's Internet checksum routine.Guy Harris2011-06-131-14/+0
| | | | | | | | | | | | | The Wireshark routine is based on the BSD in-kernel portable checksum routine (thus BSD-licensed); it takes a vector of pointers and lengths and checksums the concatenation of the buffers in question (just as the BSD in-kernel routine checksums a chain of mbufs). This simplifies the "with a pseudo-header" checksums; hopefully it'll fix up the problems being seen on some big-endian platforms, which might be due to hand-calculating some or all of the checksum and doing so incorrectly. It also gets rid of some code that might be dereferencing unaligned pointers.
* Mark various IPv4 and IPv6 headers as unaligned.Guy Harris2010-08-311-12/+13
| | | | | | | | | | | | | This prevents GCC on SPARC from generating code that assumes those structures are aligned naturally, which they are not guaranteed to be. Move some #defines from interface.h to tcpdump-stdinc.h to make them available to code that doesn't include interface.h. Move the declaration of nextproto6_cksum() to ip6.h, so that only files that use it get it declared, and thus so that you don't need to define "struct ip6_hdr" in everything that includes interface.h. Don't include ip6.h in tcpdump-stdinc.h.
* modularize ip6 nextlayer checksum generation andHannes Gredler2009-10-121-0/+14
| | | | change tcp6 and pim6 to use it.
* Patches from NetBSD tree.mcr2007-08-291-2/+2
|
* IRIX defines IPV6_VERSION in <netinet/in.h>, and we don't use it, soguy2005-04-201-4/+1
| | | | remove the definition from ip6.h, to get rid of compiler warnings.
* Fix up some errors from the previous checkin.guy2002-12-111-5/+4
| | | | | | | Fix up some const and unsigned issues. Make static some routines unused outside the file in which they're defined.
* The "__attribute__((packed))" tag on structures causes some files not toguy2002-12-111-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | compile with Sun C, as "interface.h" isn't being included before the structures are being declared. Furthermore, in the files that Sun C *can* compile, it doesn't cause Sun C to generate code that's safe with unaligned accesses, as "__attribute__" is defined as a do-nothing macro with compilers that don't support it. Therefore, we get rid of that tag on the structures to which it was added, and instead use "EXTRACT_16BIT()" and "EXTRACT_32BIT()" to fetch 16-bit and 32-bit big-endian quantities from packets. We also fix some other references to multi-byte quantities to get rid of code that tries to do unaligned loads on platforms that don't support them. We also throw in a hack that makes those macros use "__attribute__((packed))" on structures containing only one 16-bit or 32-bit integer to get the compiler to generate unaligned-safe code rather than doing it by hand. (GCC on SPARC produces the same code that doing it by hand does; I don't know if GCC on any other big-endian strict-alignment processor generates better code for that case. On little-endian processors, as "ntohs()" and "ntohl()" might be functions, that might actually produce worse code.) Fix some places to use "%u" rather than "%d" to print unsigned quantities.
* put __attribute__((packed)) to packet headers. s/u_short/u_int16_t/ and soitojun2002-11-091-8/+8
| | | | forth while i'm here
* Give a bunch of files RCS and SCCS IDs.guy2000-12-171-0/+1
|
* add mobile-ip6 option handling. patches@tcpdump.org #113itojun2000-12-131-2/+9
| | | | from Timo Koskiahde.
* put stripped-down version of ip6.h and icmp6.h into tcpdump tree.itojun2000-10-071-0/+187
ip6.h is almost normal RFC2292 header. icmp6.h has couple of extensions (not covered by RFC2292), like MLD, ICMPv6 nodeinfo, and router renumber. XXX how to synchronize with future kame changes?