summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* build-sys: change gettext and rarpd build defaultsfix-issue-162Sami Kerola2018-12-201-3/+3
| | | | | | | | | | | | | | | | | Recently added localization support should needs to be turned on by default to gain traction from translations. Without this it is hopeless to get contributions going on. The rarpd is obsoleted by BOOTP and later DHCP protocols. There should not be reason why this executable ought to be build and packaged by default to pretty much all distributions. The traceroute6 is not needed, tracepath -6 can perform the same function, so drop it from default build as well. Addresses: https://github.com/iputils/iputils/issues/162 CC: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* man: reindent xml filesSami Kerola2018-12-209-1580/+2325
| | | | | | | | | | | | | | | | | | | | Due to great amount of change in this update normal review is not possible. I used following to ensure there are no unexpected changes. # Generate old manual pages. git checkout origin/master make clean && make mkdir a for i in builddir/doc/*; do man $i > a/${i##*/}; done # Generate new manual pages. git checkout <this-branch> make clean && make mkdir b for i in builddir/doc/*; do man $i > b/${i##*/}; done # Compare. diff -ruP a b Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* man: update to docbook 5Sami Kerola2018-12-209-65/+44
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* man: update rdisc compilation option notesSami Kerola2018-12-201-2/+2
| | | | | | | The -DRDISC_SERVER was true before meson build, now one needs to use 'meson configure builddir -DENABLE_RDISC_SERVER=true' if these features are needed. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* man: fix rarpd command name in synopsisSami Kerola2018-12-202-1/+2
| | | | | | | While going through this manual page I noticed --help output being incomplete, so lets sort that out in same go. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ping: fix warning when compiled with USE_CRYPTO=noneSami Kerola2018-12-191-0/+1
| | | | | | | | | | | | | Following warning is false positive, niquery_option_subject_name_handler() calls error() that terminates the program - but compiler does not know that because error() can be called non-terminating way. So lets a call to abort() that will terminate, and cause core as a sign of bug if error() ever falls through. ping6_common.c:494:1: warning: control reaches end of non-void function [-Wreturn-type] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ping: earlier localization commit broke musl buildSami Kerola2018-12-181-0/+2
| | | | | Reference: aeec6a0a5247a2526306479f57f987bf6c09f3d8 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* localization: move nls headers to iputils_common.hSami Kerola2018-12-186-70/+24
| | | | | | Aboid boilerplating. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* localization: add ja.poTomohiro "Tomo-p" KATO2018-12-172-1/+1681
|
* localization: arping, ping, ping6, tracepath and traceroute6Tomohiro "Tomo-p" KATO2018-12-1714-330/+1993
|
* clockdiff: avoid use of uninitialized variablesSami Kerola2018-12-161-2/+2
| | | | | | | | | ../clockdiff.c:307:11: warning: ‘histime1’ may be used uninitialized in this function [-Wmaybe-uninitialized] ../clockdiff.c:295:10: warning: ‘histime’ may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* clockdiff: split measure() to two functionsSami Kerola2018-12-161-156/+187
| | | | | | The measure() was a bit too long and deeply indented (8 steps). Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* clockdiff: merge measure() and measure_opt() functionsSami Kerola2018-12-161-214/+65
| | | | | | Writing nearly same function twice is not the best way. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* clockdiff: remove global variablesSami Kerola2018-12-161-130/+140
| | | | | | | In same go get rid of function like define, and convert magic values to enums that are more friendly to debuggers such as gdb. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* clockdiff: improve coding styleSami Kerola2018-12-161-278/+270
| | | | | | Reindent file and move declarations to top of the file. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: use strictest meson warning levelninfod-warningsSami Kerola2018-12-011-1/+1
| | | | | | All warnings should be fixed. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ninfod: fix couple warningsSami Kerola2018-12-011-8/+13
| | | | | | | | | | | | | arithmetic on a pointer to void is a GNU extension [-Wpointer-arith] comparison of integers of different signs: '__u32' (aka 'unsigned int') and 'int' [-Wsign-compare] And in ni_ifaddrs.c: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] Reference: https://github.com/iputils/iputils/pull/160#issuecomment-441390212 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* docs: disable man page builds when xsltproc does not workSami Kerola2018-11-111-2/+11
| | | | | Addresses: https://github.com/iputils/iputils/issues/157 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ping: make ping_strtod() fail path more obviousSami Kerola2018-11-111-3/+2
| | | | | | | The error() function will print wanted message regardless what is the errno value, including zero. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* traceroute6: get smallest unprivileged port from kernel runtimeSami Kerola2018-11-111-1/+15
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* traceroute6: explain all number constantsSami Kerola2018-11-111-35/+75
| | | | | | | | Some of these values are in kernel user api, but because includes redefine same variable names using system headers is not an option. While on it add icmp types that were earlier unknown to traceroute6. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* traceroute6: use monotonic clockSami Kerola2018-11-111-13/+19
| | | | | | | | | | | Use clock_gettime(3) CLOCK_MONOTONIC_RAW to determine time difference. This measurement is ideal to this use case, as in traceroute6 one does not care what is the time but how long packages are traveling back and forth. Notice that CLOCK_MONOTONIC_RAW is not subject to discontinuous jumps by system administrator manually adjusting time, or incremental adjustments performed by adjtime(3) and NTP. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* traceroute6: remove global variables by using a run state structSami Kerola2018-11-111-122/+131
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* traceroute6: improve coding styleSami Kerola2018-11-111-195/+168
| | | | | | | Reindent source, get rid of casting return values to (void), sort includes, and get rid of function like defines. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* traceroute6: make command to compile without function prototypesSami Kerola2018-11-111-307/+269
| | | | | | | And add static keyword to local functions. The tvsub() was also removed as it is not even used. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tracepath: move repeated function arguments to runtime configSami Kerola2018-11-111-49/+50
| | | | | | In same go make runtime pointer read-only. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tracepath: calculate milliseconds in output carefullySami Kerola2018-11-111-3/+4
| | | | | | | Use appropriate function to substract timeval data format, and be more cautious to avoid integer overflow. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tracepath: do not continue execution with illegal -m valueSami Kerola2018-11-111-0/+1
| | | | | | | Value that is not within expected range should not be used. Reference: 608419a7804caf36a359875d2fdae0b3eb181387 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tracepath: explain all number constantsSami Kerola2018-11-111-19/+36
| | | | | | | | Rather than using preprocessor #define's use enum values, that are visible for debuggers. That said icmp values are from headers where they are defined. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tracepath: improve coding styleSami Kerola2018-11-111-101/+105
| | | | | | Reindent the source file, sort includes, and such. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* tracepath: remove global variables by using a run state structSami Kerola2018-11-111-95/+105
| | | | | | | This change is similar to arping change that moved global variables to run state structure. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* arping: use monotonic raw clock when measuring reply timesSami Kerola2018-11-111-3/+3
| | | | | | | Raw clock is not subject of NTP or adjtime time changes that could distort measurements. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: arping rarely needs -lrt linkingSami Kerola2018-11-111-1/+5
| | | | | | | Old glibc did not have clock_gettime() that was part of librt, but since glibc 2.17 (December 2012), the library linking -rt is no longer required. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* arping: improve coding styleSami Kerola2018-11-111-211/+206
| | | | | | | Fix indentation, ort includes, move declarations to top of file and some other cosmetic improvements. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* arping: use signalfd() and timerfd() rather than signalsSami Kerola2018-11-111-106/+156
| | | | | | | | Stop using plain signals to coordinate when timer expires or to request exit. The point if of this change is to make it easier to understand control flow when it does not rely on jumps via signal handler. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* arping: fix getifaddrs() and sysfs memory leaksSami Kerola2018-11-111-6/+9
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* arping: remove unnecessary set_device_broadcast...() functionsSami Kerola2018-11-111-36/+15
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* arping: reuse runstate function argument when possibleSami Kerola2018-11-111-60/+41
| | | | | | | | Advantage of this is clear when if you look set_device_broadcast...() functions that are not a lot easier to understand. That said these three functions are now so trivial that collapsing them is the next obvious step. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* arping: remove global variables by using a run state structSami Kerola2018-11-111-198/+226
| | | | | | | | | | | | | This is first commit in refactoring effort. Global variables are simply replaced by equivalent struct run_state names. As one can quite clearly see some functions are taking multiple runtime variables as input, these can be reduced to passing of the main struct. Secondly, the finish() and catcher() do not take run state argument. This is because these functions are used in signal handler. Easy fix is to make signal handling to use signalfd(). I will come back to this later. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ping: do not bind to device when destination IP is on deviceSami Kerola2018-11-111-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>
* ninfod: remove dead codeSami Kerola2018-10-313-19/+0
| | | | | | | | The only call to check_nigroup() has not been compiled in latest 13 releases (from s20121125 to s20180629). It is time to remove the dead code. Reference: 0ae42139342f47a5a62977346f095fd94e1508c2 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ping: fix global variable scopeSami Kerola2018-10-281-1/+1
| | | | | | | | | | | Mark device variable to be shared in ping source files. This fixes linker issue that is reported when al gcc warnings are enabled. /usr/bin/ld: ping@exe/ping6_common.c.o:(.bss.device+0x0): multiple definition of `device'; ping@exe/ping.c.o:(.bss.device+0x0): first defined here Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: tidy up project a little bitSami Kerola2018-10-288-25/+16
| | | | | | | Remove obsolete files, reindent and wrap meson lines, and sort out ninfod build system fixme markup. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: hardcode ninja version to v1.8.2Sami Kerola2018-10-281-1/+1
| | | | | | | | | | | | | | Finding latest version fails too often following way. http://: Invalid host name. The command "wget "$NINJA_LATEST"" failed and exited with 1 during . That ninja version was created at 2017-09-11 so it is not changing all the time. I guess it's fine to hardcode this, and review if the version is still the latest before iputils release. Reference: https://travis-ci.org/iputils/iputils/jobs/447360838 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* misc: fix couple typosSami Kerola2018-10-276-9/+9
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* arping: fix undefined behavior detector [UBSan]Sami Kerola2018-10-251-9/+7
| | | | | | | arping.c:106:18: runtime error: member access within null pointer of type 'struct sockaddr_ll' Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* ninfod: use build-sys to define if syslog messages are enabledSami Kerola2018-10-255-11/+14
| | | | | | | | | | | | Despite the fact preprocessor variable name is ENABLE_DEBUG these are generally useful messages about what failed and how. In same go fix a warning added in 90d90f40f1f7fa72016e1dbaa5ea18d0dd175dc6. ninfod/ninfod_core.c:435:6: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign] 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