summaryrefslogtreecommitdiff
path: root/contrib
Commit message (Collapse)AuthorAgeFilesLines
* remove stale contrib/SuseOlaf Hering2021-09-305-246/+0
| | | | | | dnsmasq is included in SUSE Linux since 2004. Signed-off-by: Olaf Hering <olaf@aepfle.de>
* Fix few coverity warnings in lease-toolsPetr Menšík2021-09-112-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error: UNINIT (CWE-457): [#def2] dnsmasq-2.86test7/contrib/lease-tools/dhcp_release.c:265: var_decl: Declaring variable "ifr" without initializer. dnsmasq-2.86test7/contrib/lease-tools/dhcp_release.c:285: uninit_use_in_call: Using uninitialized value "ifr". Field "ifr.ifr_ifru" is uninitialized when calling "setsockopt". # 283| strncpy(ifr.ifr_name, argv[1], sizeof(ifr.ifr_name)-1); # 284| ifr.ifr_name[sizeof(ifr.ifr_name)-1] = '\0'; # 285|-> if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr)) == -1) # 286| { # 287| perror("cannot setup interface"); Error: CHECKED_RETURN (CWE-252): [#def3] dnsmasq-2.86test7/contrib/lease-tools/dhcp_release6.c:346: check_return: Calling "inet_pton" without checking return value (as is done elsewhere 61 out of 72 times). dnsmasq-2.86test7/contrib/lease-tools/dhcp_release6.c:188: example_assign: Example 1: Assigning: "s" = return value from "inet_pton(10, ip, &result.ip)". dnsmasq-2.86test7/contrib/lease-tools/dhcp_release6.c:189: example_checked: Example 1 (cont.): "s" has its value checked in "s <= 0". dnsmasq-2.86test7/src/cache.c:1108: example_checked: Example 2: "inet_pton(10, token, &addr)" has its value checked in "inet_pton(10, token, &addr) > 0". dnsmasq-2.86test7/src/dbus.c:525: example_checked: Example 3: "inet_pton(2, ipaddr, &addr.addr4)" has its value checked in "inet_pton(2, ipaddr, &addr.addr4)". dnsmasq-2.86test7/src/domain.c:138: example_checked: Example 4: "inet_pton(prot, tail, addr)" has its value checked in "inet_pton(prot, tail, addr)". dnsmasq-2.86test7/src/lease.c:81: example_checked: Example 5: "inet_pton(10, dnsmasq_daemon->namebuff, &addr.addr6)" has its value checked in "inet_pton(10, dnsmasq_daemon->namebuff, &addr.addr6)". # 344| client_addr.sin6_flowinfo = 0; # 345| client_addr.sin6_scope_id =0; # 346|-> inet_pton(AF_INET6, "::", &client_addr.sin6_addr); # 347| bind(sock, (struct sockaddr*)&client_addr, sizeof(struct sockaddr_in6)); # 348| inet_pton(AF_INET6, DHCP6_MULTICAST_ADDRESS, &server_addr.sin6_addr); Error: CHECKED_RETURN (CWE-252): [#def4] dnsmasq-2.86test7/contrib/lease-tools/dhcp_release6.c:347: check_return: Calling "bind(sock, (struct sockaddr *)&client_addr, 28U)" without checking return value. This library function may fail and return an error code. # 345| client_addr.sin6_scope_id =0; # 346| inet_pton(AF_INET6, "::", &client_addr.sin6_addr); # 347|-> bind(sock, (struct sockaddr*)&client_addr, sizeof(struct sockaddr_in6)); # 348| inet_pton(AF_INET6, DHCP6_MULTICAST_ADDRESS, &server_addr.sin6_addr); # 349| server_addr.sin6_port = htons(DHCP6_SERVER_PORT); Error: CHECKED_RETURN (CWE-252): [#def5] dnsmasq-2.86test7/contrib/lease-tools/dhcp_release6.c:348: check_return: Calling "inet_pton" without checking return value (as is done elsewhere 61 out of 72 times). dnsmasq-2.86test7/contrib/lease-tools/dhcp_release6.c:188: example_assign: Example 1: Assigning: "s" = return value from "inet_pton(10, ip, &result.ip)". dnsmasq-2.86test7/contrib/lease-tools/dhcp_release6.c:189: example_checked: Example 1 (cont.): "s" has its value checked in "s <= 0". dnsmasq-2.86test7/src/cache.c:1108: example_checked: Example 2: "inet_pton(10, token, &addr)" has its value checked in "inet_pton(10, token, &addr) > 0". dnsmasq-2.86test7/src/dbus.c:525: example_checked: Example 3: "inet_pton(2, ipaddr, &addr.addr4)" has its value checked in "inet_pton(2, ipaddr, &addr.addr4)". dnsmasq-2.86test7/src/domain.c:138: example_checked: Example 4: "inet_pton(prot, tail, addr)" has its value checked in "inet_pton(prot, tail, addr)". dnsmasq-2.86test7/src/lease.c:81: example_checked: Example 5: "inet_pton(10, dnsmasq_daemon->namebuff, &addr.addr6)" has its value checked in "inet_pton(10, dnsmasq_daemon->namebuff, &addr.addr6)". # 346| inet_pton(AF_INET6, "::", &client_addr.sin6_addr); # 347| bind(sock, (struct sockaddr*)&client_addr, sizeof(struct sockaddr_in6)); # 348|-> inet_pton(AF_INET6, DHCP6_MULTICAST_ADDRESS, &server_addr.sin6_addr); # 349| server_addr.sin6_port = htons(DHCP6_SERVER_PORT); # 350| int16_t recv_size = 0; Error: NEGATIVE_RETURNS (CWE-394): [#def6] dnsmasq-2.86test7/contrib/lease-tools/dhcp_release6.c:360: var_tested_neg: Variable "recv_size" tests negative. dnsmasq-2.86test7/contrib/lease-tools/dhcp_release6.c:373: negative_returns: "recv_size" is passed to a parameter that cannot be negative. # 371| } # 372| # 373|-> int16_t result = parse_packet(response, recv_size); # 374| if (result == NOT_REPLY_CODE) # 375| {
* Remove remaining uses of deprecated inet_addr() function.Petr Menšík2021-08-102-5/+8
|
* Fix systemd unit startup ordernl67202019-10-301-0/+3
| | | | | | | Order dnsmasq.service before network.target and after network-online.target & nss-lookup.target. Additionally pull in nss-lookup.target. This matches the behaviour of systemd-resolved and Unbound. Signed-off-by: nl6720 <nl6720@gmail.com>
* Report error on dhcp_releasePetr Menšík2019-10-071-1/+5
| | | | | | | | If no IPv4 address is present on given interface, the tool would not send any request. It would not report any error at the same time. Report error if request send failed. Signed-off-by: Petr Mensik <pemensik@redhat.com>
* Change dhcp_release to use default address when no IP subnet matchesBrian Haley2019-08-301-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, dhcp_release will only send a 'fake' release when the address given is in the same subnet as an IP on the interface that was given. This doesn't work in an environment where dnsmasq is managing leases for remote subnets via a DHCP relay, as running dhcp_release locally will just cause it to silently exit without doing anything, leaving the lease in the database. Change it to use the default IP on the interface, as the dnsmasq source code at src/dhcp.c does, if no matching subnet IP is found, as a fall-back. This fixes an issue we are seeing in certain Openstack deployments where we are using dnsmasq to provision baremetal systems in a datacenter. While using Dbus might have seemed like an obvious solution, because of our extensive use of network namespaces (which Dbus doesn't support), this seemed like a better solution than creating system.d policy files for each dnsmasq we might spawn and using --enable-dbus=$id in order to isolate messages to specific dnsmasq instances. Signed-off-by: Brian Haley <haleyb.dev@gmail.com>
* Fix breakage of dhcp_lease_time utility.Simon Kelley2019-08-141-1/+1
|
* Replace ash shell with dash in contrib/reverse-dns.Simon Kelley2019-04-082-2/+2
|
* Minor improvements in lease-toolsPetr Menšík2018-09-043-3/+7
| | | | | | Limit max interface name to fit into buffer. Make sure pointer have to be always positive. Close socket after received reply.
* Spelling fixes.Ville Skyttä2018-01-141-1/+1
|
* Fix exit code from dhcp_release6.Simon Kelley2017-12-141-3/+6
|
* Severely fix code formating of contrib/lease-tools/dhcp_release6.cSimon Kelley2017-12-141-270/+318
|
* Update contrib/try-all-ns.Rasmus Ahlberg2017-09-252-0/+30
|
* Printf related fixes.Rosen Penev2017-06-271-4/+4
|
* Spelling fixes.klemens2017-02-191-1/+1
|
* Comprehensive spelling/typo fixes.Josh Soref2017-02-0613-20/+20
| | | | Thanks to Josh Soref for generating these fixes.
* Stricter command line args validation to dhcp_release6.v2.76rc2Sergey Nechaev2016-05-141-6/+35
|
* Add contrib/lease-tools/dhcp_release6Simon Kelley2016-05-033-2/+456
|
* Move dhcp_release and dhcp_lease_time to contrib/lease_tools.Simon Kelley2016-05-035-0/+0
|
* Check IP address command line arg in dhcp_release.cMoshe Levi2015-04-191-0/+5
|
* New version of contrib/reverse-dnsSimon Kelley2015-03-043-57/+125
|
* Log parsing utils in contrib/reverse-dnsJoachim Zobel2015-02-233-0/+75
|
* Mention name in systemd.Simon Danner2014-08-181-1/+1
|
* Updated version of contrib/try-all-nsv2.69test6Jesse Glick2014-02-041-0/+29
|
* macscript: create file if it doesn't exist.Simon Kelley2013-09-271-10/+16
|
* Add contrib/mactableSimon Kelley2013-09-271-0/+30
|
* Note that dhcp_lease_time and dhcp_release only work for IPv4.Simon Kelley2013-04-232-2/+6
|
* Fix regression in dhcp_lease_time utility.Simon Kelley2013-04-221-1/+8
|
* Remove dead code.Simon Kelley2013-02-051-4/+0
|
* Add contrib/dbus-test/dbus-test.pySimon Kelley2012-10-121-0/+43
|
* Add instructions/patches for dbus activation to contrib/systemd.v2.62Simon Kelley2012-06-041-0/+57
|
* Send "FTP transfer complete" events to the DHCP lease script.v2.61test7Simon Kelley2012-03-201-0/+10
|
* import of dnsmasq-2.58.tar.gzv2.58Simon Kelley2012-01-056-1/+141
|
* import of dnsmasq-2.56.tar.gzv2.56Simon Kelley2012-01-051-2/+0
|
* import of dnsmasq-2.53.tar.gzv2.53Simon Kelley2012-01-053-1/+44
|
* import of dnsmasq-2.52.tar.gzv2.52Simon Kelley2012-01-058-0/+203
|
* import of dnsmasq-2.48.tar.gzv2.48Simon Kelley2012-01-052-0/+28
|
* import of dnsmasq-2.47.tar.gzv2.47Simon Kelley2012-01-052-0/+598
|
* import of dnsmasq-2.46.tar.gzv2.46Simon Kelley2012-01-051-0/+0
|
* import of dnsmasq-2.42.tar.gzv2.42Simon Kelley2012-01-052-0/+93
|
* import of dnsmasq-2.40.tar.gzv2.40Simon Kelley2012-01-055-6/+753
|
* import of dnsmasq-2.36.tar.gzv2.36Simon Kelley2012-01-052-0/+80
|
* import of dnsmasq-2.34.tar.gzv2.34Simon Kelley2012-01-056-8/+302
|
* import of dnsmasq-2.33.tar.gzv2.33Simon Kelley2012-01-059-0/+575
|
* import of dnsmasq-2.24.tar.gzv2.24Simon Kelley2012-01-056-1/+76
|
* import of dnsmasq-2.23.tar.gzv2.23Simon Kelley2012-01-056-0/+217
|
* import of dnsmasq-2.16.tar.gzv2.16Simon Kelley2012-01-051-0/+249
|
* import of dnsmasq-2.10.tar.gzv2.10Simon Kelley2012-01-053-0/+697