summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-06-19astraceroute.8: use more sensitive terminologyTobias Klauser1-4/+4
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-06-15mausezahn: remove unused MZ_SIZE_LONG_INTTobias Klauser2-5/+0
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-05-04netsniff-ng v0.6.7v0.6.7Tobias Klauser1-2/+2
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-05-04AUTHORS: updateTobias Klauser1-0/+1
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-05-04proto_lldp: prevent accidental out of bounds memory accessNathaniel Ferguson1-1/+5
Added an integer arithmetic check prior to performing arithmetic to prevent accidental out of bounds memory access. Signed-off-by: Nathaniel Ferguson <nathaniel@leapfrog.foundation> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-05-04proto_lldp: fix pointer increment in LLDP_TLV_SYSTEM_CAP caseNathaniel Ferguson1-1/+1
Fixed a typo wherein a pointer was incremented by sizeof(uint32_t) after reading sizeof(uint16_t) and before reading another sizeof(uint16_t). In essence a potential out of bounds memory access (read) due to improper increment of pointer Signed-off-by: Nathaniel Ferguson <nathaniel@leapfrog.foundation> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-05-04proto_lldp: Check inet_ntop() return valuesNathaniel Ferguson1-3/+11
Make netsniff error out of a recv routine if calls to inet_ntop() fail by adding return value checks. There are other inet_ntop() usages of similar however these are in a receive code path with user data for most of the variables Signed-off-by: Nathaniel Ferguson <nathaniel@leapfrog.foundation> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-05-04proto_ipv4: Make netsniff detect and properly handle some malformed packetsNathaniel Ferguson1-1/+1
Entails the potential integer underflow of a signed integer. Signed-off-by: Nathaniel Ferguson <nathaniel@leapfrog.foundation> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-02-21mz: Zero memory allocated for new automops elementMichael R Torres1-1/+1
Prevent crashes when using mausezahn in interactive mode by using calloc to zero the memory upon allocation. Fixes #195 Signed-off-by: Michael R Torres <mic.ric.tor@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-02-21AUTHORS: updateTobias Klauser2-0/+2
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-02-20mz: Fix accidental assignment in conditional statementMichael R. Torres1-2/+2
Corrects the accidental assignment of _c_ to 'c' or 'p' due to a missing equals sign. This enables the proper display of the missing argument error message for all relevant options. Signed-off-by: Michael R Torres <mic.ric.tor@gmail.com>
2020-02-01AUTHORS: updateTobias Klauser1-0/+1
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2020-02-01ifpps: fix iface stat parsing if uppercaseBenoît Ganne1-1/+1
Linux netdev can contain uppercase characters. Signed-off-by: Benoît Ganne <benoit.ganne@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2019-10-04mausezahn: Support -R to set packet priorityPetr Machata4-1/+33
Add a command line option -R to specify SO_PRIORITY socket option. This then sets priority of the generated SKBs, which is handy for testing Qdiscs and other priority-dependent functionality. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2019-10-04mausezahn.8: Document -rPetr Machata1-0/+3
This option is mentioned further in the man page, but is omitted in the main section. Add it. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2019-10-02astraceroute: reorder function declarationsuno200011-4/+4
Group functions for the same protocol together. Signed-off-by: uno20001 <regisztralo111@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2019-09-23AUTHORS: updateTobias Klauser1-0/+1
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2019-09-23trafgen: reset errno before calling sscanf in str2macJoachim Nilsson1-0/+1
When testing trafgen with the following example from the man page the error message "Failed to parse MAC address 11:22:33:44:55:66" is printed. trafgen -o lo --cpus 1 -n 3 '{ eth(da=11:22:33:44:55:66, da[0]=dinc()), tcp() }' Turns out errno was not cleared before str2mac() called sscanf(). Signed-off-by: Joachim Nilsson <troglobit@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2019-05-09netsniff-ng v0.6.6v0.6.6Tobias Klauser1-2/+2
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2019-05-03AUTHORS: regenerate and correct Jon's nameTobias Klauser2-2/+3
Jon's name was spelled wrong in .mailmap in commit 79608cdc169b ("AUTHORS: auto-generate from commit log") and thus ended up being wrong in the AUTHORS file since we started auto-generating it. Sorry about that! Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2019-04-10trafgen: fix -t 0 option to use sendtoQuentin Chateau1-5/+0
Currently, using -t 0 option calls shaper_set_delay with 0 sec and 0 ns, which results in sh->type to be SHAPER_NONE. This in turn causes trafgen to use TX_RING. Expected behavior, from "man trafgen": If this option is given, then instead of packet(7)'s TX_RING interface, trafgen will use sendto(2) I/O for network packets, even if the argument is 0. This patch forces sh->type to be set to SHAPER_DELAY even if the delay is 0. shaper_delay already handles the case where sh->type is SHAPER_DELAY and the delay is 0. Fixes #208 Signed-off-by: Quentin Chateau <quentin.chateau@gmail.com> [tklauser: adjusted commit message to include change description] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2019-03-06AUTHORS: updateTobias Klauser2-0/+3
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2019-03-06Build system: Use GZIP_ENV instead of GZIPDaniel Roggow2-2/+2
Older versions of gzip assume the GZIP environment variable contains flags[1]. Building netsniff-ng on a system with such a version of gzip will yield the following error: INST netsniff-ng/netsniff-ng gzip -9 -c netsniff-ng.8 > netsniff-ng/netsniff-ng.8.gz gzip: gzip: No such file or directory A practical alternative to redefining GZIP in the Makefile seems to be to use the GZIP_ENV make variable[2] instead. [1] The GZIP environment variable was deprecated in gzip version 1.7. See https://www.gnu.org/software/gzip/manual/html_node/Environment.html and https://git.savannah.gnu.org/cgit/gzip.git/tree/NEWS for more information. [2] https://www.gnu.org/software/automake/manual/automake.html#index-GZIP_005fENV Signed-off-by: Daniel Roggow <daniel.roggow@rockwellcollins.com>
2018-12-11AUTHORS: update authorsTobias Klauser1-0/+1
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-12-11astraceroute: checksum calculation for ICMP and TCPuno200011-44/+106
Calculate ICMP and TCP checksums for both IPv4 and IPv6, Fixes #198 Fixes #200 Signed-off-by: uno20001 <regisztralo111@gmail.com> [tk: code formatting, C89 compatibility] Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-12-10oui.conf: update from upstreamTobias Klauser2-1503/+5976
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-12-10AUTHORS: auto-generate from commit logTobias Klauser6-32/+85
I tend to forget to update the AUTHORS file with new contributors. Let's automate it and extract the contributors from the commit log. Manually mention people how have contributed in other ways (bug reports, documentation etc.) or how had commits in the previousl, no longer existing repository. Script based on https://github.com/cilium/cilium/blob/master/contrib/scripts/extract_authors.sh Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-12-10AUTHORS: single list of contributorsTobias Klauser1-20/+10
As a preparation for auto-generating the AUTHORS file, move everybody to a single list of contributors. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-12-10contrib: move auxiliary scripts to own directoryTobias Klauser2-0/+0
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-12-10Fix manpage warningsKartik Mistry1-4/+3
Signed-off-by: Kartik Mistry <kartik.mistry@gmail.com>
2018-12-04docs: remove again, moved to the netsniff-ng.github.ioTobias Klauser8-831/+0
If we want to use https://netsniff-ng.github.io instead of https://netsniff-ng.github.io/netsniff-ng the source apparently have to live in a separate repository. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-12-04docs: add netsniff-ng website source for GitHub pages renderingTobias Klauser8-0/+831
Let's move to GitHub pages so I don't always forget to update the website upon a new release. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-12-02netsniff-ng: store default prefix in ctxTobias Klauser1-2/+5
Store the default "dump-" prefix in ctx->prefix instead of checking it every time in generate_multi_pcap_filename. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-12-02zsh: netsniff-ng: add completion for --overwriteTobias Klauser1-0/+1
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-12-02AUTHORS: add Whang ChoiTobias Klauser1-0/+1
Add Whang Choi for PR #202 Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-12-02netsniff-ng: implement rotating capture filesWhang Choi2-7/+34
Add a new option -O, --overwrite which allows to rotate capture files. The timestamp in the file name is replaced with a number that wraps around after reaching the specified number of files. Example usage: netsniff-ng -s -F 1KiB -O 10 -i eth0 -o /output/folder Fixes #147 Signed-off-by: Whang Choi <wch0x01@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-12-02build: use system libsodium by defaultTobias Klauser1-2/+8
If libsodium is installed (i.e. pkg-config --variable=includedir libsodium returns a non-empty path), assume libsodium is installed and use it instead of libnacl. To use libnacl, set NACL_INC_DIR, NACL_LIBDIR and NACL_LIB accordingly. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-11-30astraceroute: Fix for reading mirrors from fileMandar Gokhale1-2/+2
If the file that GeoIP mirror addresses are being read from lacks a terminating newline, then the code that reads them in exhibits an off-by-one error. Example of such a file: $ xxd /etc/netsniff-ng/geoip.conf 00000000: 6765 6f6c 6974 652e 6d61 786d 696e 642e geolite.maxmind. 00000010: 636f 6d com Fix this by explicitly getting the part of the string before the newline using `strcspn`. Signed-off-by: Mandar Gokhale <mandarg@mandarg.com>
2018-10-22trafgen: fixed '--in -' to work again with STDINJaroslav Škarvada1-1/+1
This has been broken by commit 4e47fd021a6945aa626eaef4446c5b547d8c2a85. Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-10-04mz: Add error handling for mismatched address familiesMandar Gokhale1-13/+70
Check for errors in IP addresses specified, and throw an appropriate error if they are not specified properly, e.g. if user uses `-6` option with an IPv4 source address. Closes #166 Signed-off-by: Mandar Gokhale <mandarg@mandarg.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-09-20netsniff-ng v0.6.5v0.6.5Tobias Klauser1-1/+1
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-08-22AUTHORS: add Matteo CroceTobias Klauser1-0/+1
Add Matteo Croce for PR #194 Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-08-22mausezahn: improve random mac address generationMatteo Croce6-47/+33
Modify -b option to generate all random MAC addresses. Improve the random generation algorithm, use nrand48() which fills the ethernet address in two calls instead of six calls to rand() and six floating point calculations. Set the locally administered bit of generated MAC addresses. Signed-off-by: Matteo Croce <mcroce@redhat.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-06-20AUTHORS: add Radoslav BodoTobias Klauser1-0/+1
Add Radoslav Bodo for commit 76bd307a8ce8 ("trafgen: support ICMPv6 checksums") submitted via PR #193. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-06-20trafgen: support ICMPv6 checksumsRadoslav Bodo4-1/+12
Usage: csumicmp6(14, 54) Signed-off-by: Radoslav Bodo <bodik@cesnet.cz> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-05-31AUTHORS: add Nick GrauelTobias Klauser1-0/+1
Add Nick Grauel for commit 3f26829394ea ("mausezahn: Restore handling of raw hex string passed in on command line") via PR #191. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-05-31mausezahn: Restore handling of raw hex string passed in on command lineNick Grauel1-1/+5
Originally all hex strings (whether they were given on the command line or in a file) were handled by a call to str2hex(): bytestring_s = str2hex (tx.arg_string, bytestring, MAX_PAYLOAD_SIZE); Commit f634c74 added code to parse out "payload=" or "p=" flags that may have been added at the start of the hex string. This code also changed the logic around this str2hex() call to only call the function and populate bytestring_s if one of these flags was found. This broke the ability to pass in a raw hex string on the command line since it fails the check and bytestring_s is never populated with the hex bytes. I've added an else condition to make the str2hex() call using the old method in cases where no "payload=" or "p=" flags are found. Signed-off-by: Nick Grauel <nicolas.grauel@plexxi.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-05-17man: reformat all man pagesTobias Klauser7-581/+669
- use .TP for option and example labels - use .BR for references to other manpages, also in description texts - highlight options using .B in description texts - misc. cleanups Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-05-15AUTHORS: add Petr MachataTobias Klauser1-0/+1
Add Petr Machata for commit f6d450a5e405 ("mausezahn: Fix IPv6 address comparison"). Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-05-15mausezahn: Fix IPv6 address comparisonPetr Machata1-2/+2
CMP_INT evaluates its arguments more than once, and thus passing a post-incremented pointer as an argument causes double increments and hence buffer overruns. This can be observed by erratic behavior of IPv6 address ranges. Fix by moving the increment to loop header. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>