summaryrefslogtreecommitdiff
path: root/utils
Commit message (Collapse)AuthorAgeFilesLines
* libndp,ndptool: use poll() instead of select()Beniamino Galvani2021-03-052-14/+10
| | | | | | | | | | | select() doesn't support file descriptors greater than 1023. If the program has many files open, the socket descriptor can be > 1023 and then FD_SET(fd, &rfds) causes a buffer overflow. Switch to poll() and ppoll() which don't have this limitation. Signed-off-by: Beniamino Galvani <bgalvani@redhat.com> Signed-off-by: Jiri Pirko <jiri@nvidia.com>
* ndptool: avoid static buffer for string in ndptoolThomas Haller2021-01-281-8/+7
| | | | | | | | | ndptool is of single threaded, so there is no actual problem here. However, I think it not best to use static variables, and in this case it can be easily avoided. Signed-off-by: Thomas Haller <thaller@redhat.com> Signed-off-by: Jiri Pirko <jiri@nvidia.com>
* ndptool: don't use static variable for local context in msgrcv_handler_func()Thomas Haller2021-01-271-1/+1
| | | | | | | | ndptool is single threaded, so this isn't an actual issue. But it's ugly and unnecessary. Signed-off-by: Thomas Haller <thaller@redhat.com> Signed-off-by: Jiri Pirko <jiri@nvidia.com>
* ndptool: fix printing dnssl lifetime in ndptoolThomas Haller2021-01-271-1/+1
| | | | | Signed-off-by: Thomas Haller <thaller@redhat.com> Signed-off-by: Jiri Pirko <jiri@nvidia.com>
* ndptool: fix potential memory leak caused by strdupHangbin Liu2019-09-241-3/+8
| | | | | | | | | We use strdup to copy the parameters. As strdup will call malloc when obtain the memory, we need to free them before exit, or there will be memory leak. This is found by covscan. Signed-off-by: Hangbin Liu <haliu@redhat.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* ndptool: add -D dest supportHangbin Liu2019-09-161-14/+35
| | | | | | | | | | | | | | This patch add -D dest option, with this option a user could set the dest address in IPv6 header for solicited NS/NA message For function ndp_msg_addrto_adjust_solicit_multi(), I moved the check in ndp_msg_target_set() instead of in the function itself. I also use reverse christmas tree variable order in the main() function of ndptool.c. Signed-off-by: Hangbin Liu <haliu@redhat.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* ndptool: fix target parameter typoHangbin Liu2018-12-171-1/+1
| | | | | | | | | In my last commit acccd780df517 ("ndptool: add -T target support"), after renaming parameter -d to -T. I forgot to change the name in switch opt. Fixes: acccd780df517 ("ndptool: add -T target support") Signed-off-by: Hangbin Liu <haliu@redhat.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* ndptool: add -T target supportHangbin Liu2018-08-061-3/+18
| | | | | | | | | | | | | | | | Currently ndptool can send a Neighbour Solicitation, but does not target an IP address, so the NS packet doesn't really make sense. Extend ndptool to target a destination for Neighbour Solicitation. v2: 1) remove function ipv6_addr_is_multicast() 2) inline some help functions. 3) update code style. 4) rename parameter -d/--dest to -T/--target Signed-off-by: Hangbin Liu <haliu@redhat.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* ndptool: Fix compilation on musl libcKylie McClain2016-06-151-0/+1
| | | | | | | FD_ZERO, fd_set, etc are defined within sys/select.h on musl. Signed-off-by: Kylie McClain <somasis@exherbo.org> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* libndp: revert API change for ndp_msg_send() and add ndp_msg_send_with_flags()Thomas Haller2016-03-101-1/+1
| | | | | | Fixes: cb1ab5fc8b ("libndp: add option flags to send messages") Signed-off-by: Thomas Haller <thaller@redhat.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* ndptool: add option to send messages typesJamie Bainbridge2016-03-101-2/+10
| | | | | | | | | Use the new flags interface of message sending, implement sending Unsolicited NA in ndptool. -U was chosen to mirror established convention of unsolicited ARP in arping. Signed-off-by: Jamie Bainbridge <jamie.bainbridge@gmail.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
* update copyright datesJiri Pirko2015-04-021-1/+1
| | | | Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* ndptool: use conventional signal handlers instead of signalfdAndrew Ayer2015-04-021-37/+31
| | | | | | | | signalfd() is Linux-specific. Using conventional signal handlers will allow ndptool to compile on non-Linux systems and old versions of Linux. Signed-off-by: Andrew Ayer <agwa@andrewayer.name> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* ndptool: fix -v argumentYanko Kaneti2013-08-081-1/+1
| | | | | Signed-off-by: Yanko Kaneti <yaneti@declera.com> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* add flag getters for prefix optionJiri Pirko2013-06-131-0/+6
| | | | Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* fix compile error on ia32Jiri Pirko2013-05-041-1/+1
| | | | Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* add man page for ndptoolJiri Pirko2013-04-171-3/+3
| | | | Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* ndptool: push litefime printout into separete functionJiri Pirko2013-04-171-19/+11
| | | | Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* add support for DNS Search List (rfc6106)Jiri Pirko2013-04-171-0/+19
| | | | Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* add support for Recursive DNS Server (rfc6106)Jiri Pirko2013-04-121-0/+19
| | | | Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* add support for Default Router Preference in RA msg (rfc4191)Jiri Pirko2013-04-051-11/+19
| | | | Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* add support for Route Information Option (rfc4191)Jiri Pirko2013-04-051-0/+26
| | | | Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* libndp: remove unnecessary evenfd struct and handle all by single event fdJiri Pirko2013-03-291-15/+11
| | | | Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* libndp: change the was opts are handledJiri Pirko2013-03-291-13/+15
| | | | Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* ndptool: add support for sending messagesJiri Pirko2013-03-171-1/+42
| | | | Signed-off-by: Jiri Pirko <jiri@resnulli.us>
* initialJiri Pirko2013-03-152-0/+396
Signed-off-by: Jiri Pirko <jiri@resnulli.us>