summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ping: do not bind to device when destination IP is on deviceissue-104Sami Kerola2018-10-241-0/+6
| | | | | | | | | | | | | | | | | | Commit f455fee41c077d4b700a473b2f5b3487b8febc1d made ping to bind to device when a device argument was given. But that to does not work if destination IP on device that socket binds to. See below how to reproduce this issue. # ip addr show dev eth0 | grep 'inet ' inet 192.168.122.100/24 brd 192.168.122.255 scope global eth0 # ping -I eth0 192.168.122.100 PING 192.168.122.100 (192.168.122.100) from 192.168.122.100 eth0: 56(84) bytes of data. <nothing... loops forever> Easiest workaround is to cancel bind to device socket option when source and destination IPs are the same and device option is defined. Addresses: https://github.com/iputils/iputils/issues/104 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ping: check getifaddrs(3) ifa_name data before useSami Kerola2018-10-222-2/+4
| | | | | | | | | | | The getifaddrs(3) can return invalid data when system call is interrupted. Issue was fixed in glibc 2.28 (relesed 2018-08-01). It is fair to assume there are systems with older libc so make the ping more robust and check ifa->ifa_name is not NULL before using it. Reference: https://sourceware.org/bugzilla/show_bug.cgi?id=21812 Addresses: https://github.com/iputils/iputils/issues/112 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* arping: support -i interval optionIhar Hrachyshka2018-10-222-2/+13
| | | | | | | | | | | | | | | | | This option will allow to set time interval to use between packets sent. It may become handy to work around timing issues in the network. For example, Linux kernel as of the time of writing by default ignores all ARP updates that arrive in 1-second interval since previous update for the same table entry *irrespective of whether the previous update was ignored*. It means that calling apring with -c 3 may still not affect Linux network peers because every consequent update is ignored because of the previous ARP update (that was also ignored). In this scenario, we would now be able to call arping -i 2 to work that kernel behaviour around. Linux fix can be found in: https://patchwork.ozlabs.org/patch/760372/
* Merge pull request #154 from kerolasa/pull-84Sami Kerola2018-10-221-4/+4
|\ | | | | arping: honor setting source to 0.0.0.0
| * arping: honor setting source to 0.0.0.0Jens Låås2018-10-221-4/+4
|/ | | | | | | Useful for using arping without having a local IP-address. Reviewed-by: Sami Kerola <kerolasa@iki.fi> Reference: https://github.com/iputils/iputils/pull/84
* Merge pull request #153 from kerolasa/pull-122Sami Kerola2018-10-221-20/+48
|\ | | | | Updated version of pull 122 changes
| * ping: add support for sub-second timeoutsClaudius Zingerli2018-10-211-20/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Timeouts (-W) were previously silently rounded down to the next lower integral number. Subsecond values were rounded to zero which resulted in infinite timeouts, therefore ping never exited if there were no responses and timeouts below 1s. This commit fixes this issue. [Sami: I changed ping_strtod() to return double. Claudius did updated needed value by pointer reference, and had multiplication by 1000 in wrapper function. I think that made understanding the code unnecessarily difficult, so implementation was slightly changed.] Reviewed-by: Sami Kerola <kerolasa@iki.fi> Reference: https://github.com/iputils/iputils/pull/122
| * ping: zorbid zero timeoutClaudius Zingerli2018-10-211-1/+1
| | | | | | | | | | | | | | Setting a timeout of zero (in fact: anything below one) makes ping wait infinitely. This commit exits on such values Reviewed-by: Sami Kerola <kerolasa@iki.fi>
* | Merge pull request #140 from kanehuange/ping-duration-timeSami Kerola2018-10-211-1/+1
|\ \ | |/ |/|
| * fix ping duration time errorKane Huang2018-07-301-1/+1
| |
* | tracepath: remove references to tracepath6Sami Kerola2018-10-193-5/+10
| | | | | | | | | | | | | | | | | | Users should use -6 when tracing network path to IPv6 destination. While fixing this remove typo from traceroute6 manual, and fix build-sys issue that the typo'ed note was talking about. Addresses: https://github.com/iputils/iputils/issues/98 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | Merge pull request #151 from kerolasa/more-build-sys-fixesSami Kerola2018-10-183-6/+59
|\ \ | | | | | | More build sys fixes
| * | build-sys: add rdisc systemd fileSami Kerola2018-10-162-0/+38
| | | | | | | | | | | | | | | | | | And move installation directory to sbin. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | build-sys: add cap_net_raw to arping, clockdiff and rarpdSami Kerola2018-10-162-6/+21
|/ / | | | | | | | | | | | | | | The arping and clockdiff are command line tools, so it need file system capability bit. The rarpd is ran by systemd and changing unit file is better. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | build-sys: Check if optional idn2 was foundVictor Toso2018-10-161-2/+4
| | | | | | | | | | | | | | In systems without the headers for idn2, the build is failing as we always set USE_IDN to 1. Signed-off-by: Victor Toso <victortoso@redhat.com>
* | ping: Fallback raw protocol for EPROTONOSUPPORT also on IPv4Petr Vorel2018-10-151-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d141cb6 ("ping: work with older kernels that don't support ping sockets") fixed #54 with handling EPROTONOSUPPORT for IPv6. But some systems return EPROTONOSUPPORT also for IPv4 (Debian 9.5 based container with kernel 4.10). NOTE: inet_create() (IPv4) and inet6_create() (IPv6) implementations in kernel also returns ESOCKTNOSUPPORT (Socket type not supported), but we check that with assert: assert(socktype == SOCK_DGRAM || socktype == SOCK_RAW); Fixes: #129 Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
* | Merge pull request #149 from kerolasa/unit-filesSami Kerola2018-10-156-7/+92
|\ \ | | | | | | Add systemd rarpd and ninfod unit files
| * | ninfod: add systemd service unit fileSami Kerola2018-10-152-5/+43
| | | | | | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | rarpd: integrate systemd service file with build-systemSami Kerola2018-10-154-14/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | In same go make service unit file to indicate which interface rarpd ought to listen. The rarpd should not to go background, that helps systemd to know what is going on with the process. And while one it lets harden rarpd unit file to drop all unnecessary system access. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | rarpd: provide example of systemd unit file for rarpdMartin Pluskal2018-10-151-0/+14
| | |
| * | build-sys: start building ninfod by defaultSami Kerola2018-10-152-2/+2
| | | | | | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* | | Merge pull request #147 from primeos/fix-ninfod-manpageSami Kerola2018-10-151-1/+1
|\ \ \ | |/ / |/| | doc/ninfod: Fix the debug mode option (-a -> -d)
| * | doc/ninfod: Fix the debug mode option (-a -> -d)Michael Weiss2018-10-011-1/+1
| | |
* | | Merge pull request #120 from kerolasa/2017wk52Sami Kerola2018-10-1554-8968/+1497
|\ \ \ | |/ / |/| | deprecate autotools in favour of meson
| * | build-sys: fix musl compilationSami Kerola2018-10-092-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tested with archlinux musl 1.1.20-1 that also has kernel-headers-musl 3.12.6_6-1 package. Compilation worked when using following configuration options. $ meson builddir -DBUILD_NINFOD=false -DUSE_CAP=false -DUSE_CRYPTO=none -DUSE_IDN=false Requested-by: David Heidelberg <david@ixit.cz> Reference: https://github.com/iputils/iputils/pull/120 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | build-sys: update project versionSami Kerola2018-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Review of the meson build system pull request has taken a bit time, and meanwhile there's been release so update the meson version to match the latest tag. Reference: https://github.com/iputils/iputils/pull/120 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | ping: stop using pointer size as strncmp() size argumentSami Kerola2018-10-032-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 63579a1b5bf61f0e03dd4e815386170d684797f7 the strncmp() has used 8 bytes as lenght of interface name, that has probabyly been more than enough but lets make the comparison to work even when interface names are extra ordinarily long. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | ping: balance number of curly braces when #ifdef __linux__ is falseSami Kerola2018-10-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ping could not have been compiled on anything but linux since commit 87dbb3a5db657d5eae6934707beaf0507980a1c3 (May 2015), that is part of the four most recent releases. Considering there are are no reported portability bugs it is perhaps fair to say iputils project does not need to be extremely consevative what comes to avoiding portability issues. Or to say the same slightly differently using linux only api's, features, and expecting fairly up to date libraries is probabliy fine. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | build-sys: add setcap or setuid to ping when installingSami Kerola2018-10-032-0/+37
| | | | | | | | | | | | | | | | | | | | | Capacity is preferred, but when that does not work make ping to be setuid root binary, that is the legacy way to install this software. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | tftp: remove definitions that can be included from system headerSami Kerola2018-10-031-46/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will cause the following warning when _FORTIFY_SOURCE= is in use. The warning is explained in glibc. In short that is fine. /usr/include/bits/string_fortified.h:90:10: warning: ‘__builtin___strcpy_chk’ writing 1 or more bytes into a region of size 0 overflows the destination [-Wstringop-overflow=] return __builtin___strcpy_chk (__dest, __src, __bos (__dest)); Reference: http://www.sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=abb66a672f5575a328d05c0790403af673d0f76c Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | ping: remove local stub header in favour of system include fileSami Kerola2018-10-032-41/+1
| | | | | | | | | | | | | | | | | | | | | | | | The words 'we cannot use "linux/in6.h" immediately' originate to commit fed7e6306f37a18 from November 2012, that does not seem to be accurate anymore. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | build-sys: change cryto lib default to opensslSami Kerola2018-10-031-1/+1
| | | | | | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | build-sys: use disabler rather than empty listSami Kerola2018-10-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meson version 0.47.1 prints following warning. meson.build:212: WARNING: Trying to compare values of different types (DependencyHolder, list) using ==. The result of this is undefined and will become a hard error in a future Meson release. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | ping: remove global variable that is not usedSami Kerola2018-10-031-9/+0
| | | | | | | | | | | | | | | | | | | | | These variables are only set, but not used. There does not seem to be any reason to keep them hanging around. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | warnings: fix multiple errno printing format specifier issuesSami Kerola2018-10-033-24/+24
| | | | | | | | | | | | | | | | | | | | | All of these report same warning: ISO C does not support the ‘%m’ gnu_printf format [-Wformat=] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | rdisc: ensure pr_name() buffer is big enoughSami Kerola2018-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Values in buffer size definition can hold maxium lenght host name, longest possible IPv6 address, and space for decorations. Earlier code may have truncated names and addresses, that is unlikely ever wanted. Additionally this fixes following warning. rdisc.c:720:31: warning: ‘ (’ directive output may be truncated writing 2 bytes into a region of size between 1 and 1025 [-Wformat-truncation=] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | warnings: fix minor issuesSami Kerola2018-10-033-5/+5
| | | | | | | | | | | | | | | | | | | | | Do not use of GNU ?: conditional. And avoid data type overflow by using unsigned char data type. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | warnings: fix initializersSami Kerola2018-10-033-4/+4
| | | | | | | | | | | | | | | | | | These are cosmetic issues, that address clang warnings. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | ping: make command to use glibc error printing facilitySami Kerola2018-10-034-399/+217
| | | | | | | | | | | | | | | | | | | | | | | | This ensures program name is always prefixed to error message. In same go use similar style in all message, that is lower caps text and inclusion data that is being complained about (when applicable). Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | ping: fix minor compiler warningsSami Kerola2018-10-033-11/+11
| | | | | | | | | | | | | | | | | | | | | ISO C does not allow extra ‘;’ outside of a function [-Wpedantic] warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | ninfod: remove syslog based malloc debuggingSami Kerola2018-10-035-41/+27
| | | | | | | | | | | | | | | | | | | | | There are better ways to debug allocations, for example valgrind and address & leak sanitizers. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | ninfod: remove function like declarationSami Kerola2018-10-034-55/+30
| | | | | | | | | | | | | | | | | | | | | In same go simplify debuging functions, and fix couple conditional compilations to work. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | rdisc: remove function like declarationSami Kerola2018-10-031-42/+49
| | | | | | | | | | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | build-sys: avoid typos in header checkSami Kerola2018-10-031-26/+24
| | | | | | | | | | | | | | | | | | | | | The HAVE_ definitions are based on header name, so generate them from input to avoid mismatch errors. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | build-sys: use config.h rather than compiler option -DdefinesSami Kerola2018-10-031-3/+5
| | | | | | | | | | | | | | | | | | | | | Now when project_arguments has -include config.h there is no need use anything but config.h for preprocessor definitions. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | build-sys: use HAVE_LIBCAP to determine libcap code should be compiledSami Kerola2018-10-036-18/+19
| | | | | | | | | | | | | | | | | | | | | The HAVE_* style is more common in other project, so change CAPABILITIES definition to match that - that is also used in ninfod/*.c files. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | ninfod: remove incomplete iputils_md5dig.h fileSami Kerola2018-10-036-60/+12
| | | | | | | | | | | | | | | | | | | | | Prefer the iputils_md5dig.h that works with nettle. In same make all the crypto library variations to work without errors and warnings. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | docs: make html manuals work againSami Kerola2018-10-033-7/+34
| | | | | | | | | | | | | | | | | | | | | If enabled html manuals are installed to <prefix>/usr/share/iputils/ directory, that is probably a right location store these. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | docs: remove INSTALL.md and update README.md command listSami Kerola2018-10-032-28/+1
| | | | | | | | | | | | | | | | | | The INSTALL.md is removed as completely deprecated. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
| * | add version print out to remaining commandsSami Kerola2018-10-0310-4/+54
| | | | | | | | | | | | | | | | | | | | | For some reason version print out was not implemented in all commands. This fixes that. Signed-off-by: Sami Kerola <kerolasa@iki.fi>