summaryrefslogtreecommitdiff
path: root/print-ospf6.c
Commit message (Collapse)AuthorAgeFilesLines
* OSPFv3: Remove two unnecessary dereferencesFrancois-Xavier Le Bail2022-02-181-5/+3
| | | | | | | Remove also two unnecessary ND_TCHECK_SIZE(). Moreover: Remove an unnecessary cast.
* Replace ND_TCHECK_/memcpy() pairs with GET_CPY_BYTES().Guy Harris2021-01-051-2/+1
| | | | | | | | | For BGP, this eliminates some cases where routines return -1 on truncation; clean up after that. This also means that some memcpy()s get replaced by UNALIGNED_MEMCPY(), which may fix some issues on processors that don't support unaligned accesses.
* OSPFv3: Use %zu to print sizeof valuesFrancois-Xavier Le Bail2020-11-041-5/+5
| | | | | Moreover: Fix indentation.
* OSPF6: Update the option bit props.Denis Ovsienko2020-10-021-3/+5
| | | | | | In the "OSPFv3 Router Properties Registry" the code point 0x08 is deprecated and the code point 0x10 stands for Nt-bit, not N-bit. Also list the N-bit from "OSPFv3 Options (24 bits)".
* Remove some now redundant ND_TCHECK_4() callsFrancois-Xavier Le Bail2020-09-081-4/+0
| | | | | | | | | | | ND_TCHECK_4(e). They are redundant because they are followed by a GET_IPADDR_STRING(e) call, same e, which do the bounds check. Remove unused 'trunc' labels and associated codes. Update the output of a test accordingly.
* Remove 96 assorted ND_TCHECK calls.Denis Ovsienko2020-09-081-1/+0
| | | | | | | Remove a number of instances that do not match common patterns and have the only substantial effect on the code flow that a truncated packet triggers "goto trunc" instead of longjmp(). (In a few cases this change can increase the number of fields printed before giving up.)
* Remove some now redundant ND_TCHECK_16() callsFrancois-Xavier Le Bail2020-09-071-1/+0
| | | | | | | ND_TCHECK_16(e). They are redundant because they are followed by a GET_IP6ADDR_STRING(e) call, same e, which do the bounds check.
* Remove many (762) now redundant ND_TCHECK_n() callsFrancois-Xavier Le Bail2020-09-061-28/+0
| | | | | | | | | | | ND_TCHECK_n(e), n in { 1, 2, 3, 4, 8 }. They are redundant because they are followed by a GET_.*_n(e) call, same n, same e, which do the bounds check. Remove unused 'trunc' labels and most associated codes. Update the outputs of some tests accordingly.
* ospf6: note some places where subtraction won't underflow.Guy Harris2020-05-271-0/+20
|
* More bounds checking when fetching addresses and converting to strings.Guy Harris2020-01-191-24/+24
| | | | | | | | | | | | | | Replace more calls to ipaddr_string()/ip6addr_string() with calls to GET_IPADDR_STRING()/GET_IP6ADDR_STRING() macros performing bounds checking. Add similar bounds-checking inline functions and macros to wrap linkaddr_string(), etheraddr_string(), and isonsap_string() and convert calls to them to use the macros as well. Shuffle the inline functions in addrtoname.h around a bit, so that the inline functions, external declarations, and macros are all in the same order.
* OSPFv3: Fix a bounds checkFrancois-Xavier Le Bail2019-04-191-2/+2
| | | | | Moreover: Clean up whitespaces/indentation.
* OSPFv3: Add/remove some bounds checksFrancois-Xavier Le Bail2019-04-021-2/+1
| | | | | Remove two bounds checks now useless with GET_ macros uses. The check on 'lshp->ls_router' is needed before ipaddr_string() call.
* Use the new GET_ macros instead of the EXTRACT_ onesFrancois-Xavier Le Bail2019-03-261-58/+61
| | | | | | | 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.
* Fix spacesFrancois-Xavier Le Bail2018-09-031-1/+1
|
* Print truncations with nd_print_trunc() instead of tstr[] stringsFrancois-Xavier Le Bail2018-05-041-3/+2
| | | | | | | | Remove the tstr[] strings. Update the output of some tests accordingly. Moreover: Add or update some ndo_protocol fields.
* Add the ndo_protocol field in the netdissect_options structureFrancois-Xavier Le Bail2018-03-161-0/+1
| | | | | Update this field in printer entry functions. It will be used for some printings.
* Rename some printer functions to *_printFrancois-Xavier Le Bail2018-02-221-2/+2
| | | | | Moreover: Fix spaces.
* OSPFv3: More nd_ipv6-ificationFrancois-Xavier Le Bail2018-01-311-5/+5
|
* Have ip{6}addr_string take a u_char * as the second argument.Guy Harris2018-01-311-31/+28
| | | | Fix warnings that introduces.
* A bit more nd_ipv4-ification.Guy Harris2018-01-301-2/+2
|
* Use nd_ipv6 rather than struct in6_addr in packet-layout structures.Guy Harris2018-01-301-4/+4
| | | | Also, use it, and nd_ipv4, in sizeof() operations.
* OSPFv3: Use more ND_TCHECK_n() and ND_TCHECK_SIZE() macrosFrancois-Xavier Le Bail2018-01-241-10/+10
|
* Use more ND_TCHECK_n() macrosFrancois-Xavier Le Bail2018-01-221-17/+17
|
* 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
|
* Clean up signed vs. unsigned.Guy Harris2018-01-111-5/+5
|
* Update ND_PRINT() as a variadic macroFrancois-Xavier Le Bail2018-01-071-76/+76
|
* Use ND_TTEST_SIZE()/ND_TCHECK_SIZE() macros (1/n)Francois-Xavier Le Bail2018-01-031-5/+5
|
* OSPFv3: Replace ND_TCHECK2 call by ND_TCHECK_LEN callFrancois-Xavier Le Bail2017-12-141-1/+1
|
* Use nd_ types for OSPF and OSPF6 packets.Guy Harris2017-12-141-100/+102
| | | | | | And add EXTRACT_ calls as required. Remove no-longer-necessary & operators in EXTRACT_ calls.
* Remove all storage class specifier 'register'Francois-Xavier Le Bail2017-12-131-28/+28
| | | | | | Let the compiler do the optimizations (or not) based on build options. Avoid 'value has been optimized out' messages in gdb using '-O0'.
* Replace ND_TTEST2()/ND_TCHECK2() macros by macros using pointers (1/n)Francois-Xavier Le Bail2017-12-111-3/+3
| | | | | ND_TTEST2(var, l) -> ND_TTEST_LEN(p, l) ND_TCHECK2(var, l) -> ND_TCHECK_LEN(p, l)
* Use more ND_TCHECK_n()/ND_TTEST_n() macrosFrancois-Xavier Le Bail2017-11-241-8/+8
|
* Rename EXTRACT_ macrosFrancois-Xavier Le Bail2017-11-221-39/+39
| | | | | | | | | | | | | | | | Now all the macros have a name meaning a count in bytes. With _S_: signed, _U_: unsigned e.g.: EXTRACT_BE_32BITS -> EXTRACT_BE_U_4 EXTRACT_LE_32BITS -> EXTRACT_LE_U_4 ... EXTRACT_BE_INT32 -> EXTRACT_BE_S_4 and have: EXTRACT_8BITS -> EXTRACT_U_1 EXTRACT_INT8 -> EXTRACT_S_1
* Rename ND_TCHECK_/ND_TTEST_ macrosFrancois-Xavier Le Bail2017-11-221-1/+1
| | | | | | | | Now all the macros have a name meaning a count in bytes. e.g.: ND_TCHECK_32BITS -> ND_TCHECK_4 ND_TTEST_32BITS -> ND_TTEST_4
* Rename EXTRACT_nBITS() macros to EXTRACT_BE_nBITS()Francois-Xavier Le Bail2017-11-181-39/+41
| | | | | It indicates clearly that these macros are used to extract big-endian integral values.
* OSPFv3: More bounds checks.Guy Harris2017-09-131-0/+3
|
* CVE-2017-13036/OSPFv3: Add a bounds check before fetching dataFrancois-Xavier Le Bail2017-09-131-0/+1
| | | | | | | | This fixes a buffer over-read discovered by Bhargava Shastry, SecT/TU Berlin. Add a test using the capture file supplied by the reporter(s), modified so the capture file won't be rejected as an invalid capture.
* Move the printer summaries from INSTALL.txt to each printerFrancois-Xavier Le Bail2016-08-141-0/+2
| | | | | | | | with the tag '\summary:' for greping. Remark: Currently some printers have no summary line. Moreover: Summarize all printers with a single line in INSTALL.txt
* 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
* Printers must include 'netdissect.h', not 'interface.h'Francois-Xavier Le Bail2015-09-051-1/+1
|
* Fix a bunch of de-constifications.Guy Harris2015-04-261-29/+29
|
* 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.
* Split the OSPFv3 header and bodies into separate structures.Guy Harris2014-05-011-82/+89
| | | | | | | | Some compilers appear to put some padding before the ospf6_un union, so the OSPFv3 packets aren't dissected correctly. Pull the members of that union into separate structures, and find the pointer to the OSPFv6 body by adding the header length to the pointer to the beginning of the header.
* u_intN_t is dead, long live uintN_t.Guy Harris2014-04-231-65/+65
| | | | | | | | | 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.
* Squelch a Coverity warning.Guy Harris2014-04-181-5/+8
| | | | | Make the lsa_p_prefix field as large as the largest possible prefix, so that Coverity doesn't complain about going past the end of an array.
* OSPFv3: fix SEGV on SPARCv9 (concurs with 8f6bca3)Denis Ovsienko2014-04-111-5/+5
| | | | | | | | This bug arose on the OpenCSW build farm: ospf3_auth-vv : TEST FAILED Dagobert Michelsen had helped to use the farm servers to debug.
* Netdissectify the to-name resolution routines.Guy Harris2014-04-041-24/+24
| | | | | | | | Have them take a netdissect_options * argument, and get the "no name resolution" flag from it. Move the declaration of dnaddr_string to addrtoname.h, along with the other XXX-to-string routines.
* NDOize DECnet, OSPF and TCP decodersDenis Ovsienko2014-04-021-2/+2
|
* spell "%s" format strings (complements 708a68a)Denis Ovsienko2014-03-311-1/+1
| | | | | Make "%s" format string always reside in the print function call explicitly such that the reader doesn't have to assess its safety.