summaryrefslogtreecommitdiff
path: root/in_cksum.c
Commit message (Collapse)AuthorAgeFilesLines
* Squelch a warning.Guy Harris2018-12-101-1/+1
| | | | | | We're returning the calculated checksum result modulo 65536, given that Internet checksums are 16-bit; throw in a cast to let MSVC know that this is intended.
* Always include <config.h> rather than "config.h".Guy Harris2018-01-211-1/+1
| | | | | | | | This can prevent bizarre failures if, for example, you've done a configuration in the top-level source directory, leaving behind one config.h file, and then do an out-of-tree build in another directory, with different configuration options. This way, we always pick up the same config.h, in the build directory.
* Use quoted include netdissect-stdinc.h instead of angle-bracketed oneFrancois-Xavier Le Bail2018-01-211-1/+1
|
* Remove all storage class specifier 'register'Francois-Xavier Le Bail2017-12-131-3/+3
| | | | | | Let the compiler do the optimizations (or not) based on build options. Avoid 'value has been optimized out' messages in gdb using '-O0'.
* Use uintptr_t to look at the bits of a pointer.Guy Harris2015-12-151-1/+1
| | | | | | | | We use AC_TYPE_UINTPTR_T in the configure script, so it'll be defined if we use autotools, and MSVC has supported it since at least Visual Studio .NET 2003, so we'll use it instead of "unsigned long"; "unsigned long" causes warnings on LLP64 platforms, as it's not wide enough for a pointer on those platforms.
* libnetdissect code must include 'netdissect.h', not 'interface.h'Francois-Xavier Le Bail2015-09-111-1/+1
| | | | | | | Moreover: Remove netdissect.h include in interface.h Move thiszone declaration in netdissect.h Update a comment
* Rename 'tcpdump-stdinc.h' to 'netdissect-stdinc.h'Francois-Xavier Le Bail2015-09-101-1/+1
| | | | Get the full log via: git log --follow netdissect-stdinc.h
* Fix a bunch of de-constifications.Guy Harris2015-04-261-3/+3
|
* dismiss NETDISSECT_REWORKED macroDenis Ovsienko2015-03-221-1/+0
| | | | | | | The purpose of this macro was to enable the file-by-file switch to NDO, after which only tcpdump.c had a use of it and the definitions guarded by it. Update tcpdump.c not to require them any more and dismiss the unused definitions.
* More fixes for uint8_t being shorter than u_int8_t.Guy Harris2014-04-231-1/+1
| | | | Fix a typo while we're at it.
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-16/+16
| | | | | | | | | And, as we require at least autoconf 2.61, and as autoconf 2.61 and later have AC_TYPE_UINTn_T and AC_TYPE_INTn_T macros, we use them to define the uintN_t and intN_t macros if the system doesn't define them for us. This lets us get rid of bitypes.h as well.
* Define NETDISSECT_REWORKED in a bunch of files, and fix the issues it finds.Guy Harris2014-04-041-0/+1
| | | | | The only one it found was that routines in sigsecret.c needed to refer to ndo->ndo_sigsecret, not just sigsecret.
* Get rid of $Id$ - you can't get that with Git.Guy Harris2011-06-161-2/+0
|
* Go with Wireshark's Internet checksum routine.Guy Harris2011-06-131-0/+202
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.