Commit Graph
1467 Commits
Author SHA1 Message Date
DL6ER a2b7a241e2 Add routine to update all existing network table entries using the latest mac->vendor database
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-31 00:18:50 +01:00
DL6ER 92d819899e Add MAC->Vendor database support. We will provide the database as an optional auxiliary file.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-30 23:35:15 +01:00
DL6ER f2f543c8d6 Do not count in findClient() if search is triggered from parse_arp_cache()
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-28 20:39:03 +01:00
DL6ER d8fdf76ceb Store number of queries per client in the database
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-28 12:18:35 +01:00
DL6ER ac6ee9e1ef Add config option to disable ARP cache parsing
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-26 11:29:28 +01:00
DL6ER 54253bd7d5 Added more comments
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-26 11:25:41 +01:00
DL6ER 3a8c87907a Initialize new devices with lastQuery property if available
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-26 11:14:25 +01:00
DL6ER 465a4900ec Use one big transaction for changes to be written to the network table and skip incomplete entires when parsing the ARP cache
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-26 01:21:31 +01:00
DL6ER 68a584ad8b Reduce code duplication
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-26 01:21:00 +01:00
DL6ER 95d3c02c5f Store lastQuery property for known clients
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-25 22:35:16 +01:00
DL6ER 82b43c332b Parse ARP cache after storing queries into long-term database(usen the dedicated database thread)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-25 17:56:44 +01:00
DL6ER 050452e75b Merge branch 'fix/shm_lock_resolve' into new/hosts-table 2018-12-25 15:53:01 +01:00
DL6ER bd6c9aadd0 Move locking/unlocking to the place where the functions that need it are called. This fixes a bug where socket.c tried to release a lock that was already released in request.c. Furthermore, this prevents obtaining a lock for both, API calls that do not need a lock and also for unknown API calls.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-25 14:20:33 +01:00
DL6ER da8620f49c Also include filename in lock debug output
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-25 14:10:00 +01:00
DL6ER e7b454f646 Add debugging output for locks
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-25 14:06:08 +01:00
DL6ER 68d9036c9e Ensure that lock is released when resolving host names. This is necessary as we'd otherwise block the main thread which is actually supposed to do the resolving.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-25 13:57:45 +01:00
DL6ER c7bdf9bd60 Update if device uses Pi-hole and store host name if available
Print executed SQL statements when in debug mode

Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-25 13:45:34 +01:00
DL6ER 40fd4d317e Add / update rows in table network depending on what we see in the ARP cache
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-24 13:19:18 +01:00
DL6ER 36d1499804 Add network table. This will update the database to version 3. Furthermore, we make some database routines globally (add prototypes to routines.h) and mark some internal database variables as static. This commit also improves on the speed of the database routines as the main loop is changed to run from the last saved query to the most recent one instead of looping over all queries in memory. This ID is corrected when queries are removed in gc.c
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-23 12:51:03 +01:00
Dan Schaper 6fc52c61da Merge pull request #443 from pi-hole/release/v4.1.1
Merge hotfix v4.1.1 and v4.1.2 into dev
2018-12-21 13:35:00 -08:00
Mcat12 19af73ffe5 Merge branch 'hotfix/v4.1.2' into release/v4.1.1
# Conflicts:
#	dnsmasq_interface.c
2018-12-21 15:49:33 -05:00
Mcat12 ab9dc6ebca Fix segfault in FTL_reply corresponding to name being null
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-12-21 15:24:29 -05:00
Mcat12 6bfcf398b4 Fix compile error due to merge
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-12-21 12:10:14 -05:00
Mcat12 2b76b57073 Merge branch 'development' into release/v4.1.1
# Conflicts:
#	dnsmasq_interface.c
2018-12-21 12:07:37 -05:00
Jacob Salmela f5f331bce7 Merge pull request #435 from pi-hole/release/v4.1.1
Pi-hole FTL v4.1.1
v4.1.1
2018-12-21 10:32:10 -06:00
DL6ER c501c441dd Merge pull request #438 from pi-hole/fix/onceAgainPercentages
Improve internal duplication handling
2018-12-19 18:02:03 +01:00
Mark Drobnak c46a7440ab Merge pull request #439 from pi-hole/tweak/zero_init_all_addr_structs
Zero initialize all_addr structs
2018-12-18 11:58:40 -05:00
DL6ER d058eafb20 Add check for IP addresses from setupVars.conf. If IPV4_ADDRESS or IPV6_ADDRESS is not set (or empty) we use "0.0.0.0" or "::" instead to ensure that we will always use something for blocking. Otherwise, if both address fields would be empty, FTL would fail in "IP" mode and only block AAAA requests in "IP_NODATA_AAAA" mode.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-18 06:28:58 +01:00
DL6ER 10dc1df383 Use {{{0}}} instead of {0} to initialize the structs. This is necessary due to a gcc-4.9 regression.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-17 22:49:27 +01:00
DL6ER ab10aa7f03 Complete query
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-17 22:31:25 +01:00
DL6ER 47b8abcd52 make sure to zero initialize the all_addr structs we're using for the IPv4 and IPv6 addresses. This should resolve a bug that was reported on Discourse. Note that this allows a great simplification of prepare_blocking_mode() as inet_pton("0.0.0.0") resp. inet_pton("::") is nothing different than filling the corresponding memory of the structs with zeros.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-17 22:17:28 +01:00
DL6ER 5ab6496344 Optimize FTL_reply()
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-17 20:40:21 +01:00
DL6ER 5aadcacc53 Simplify FTL_cache(). 99% no functional change, only indentation.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-17 19:42:51 +01:00
Mark Drobnak 9da8306c47 Merge pull request #423 from pi-hole/fix/cached_query_forwarded
Fix query status if forwarded query was partially replied to from cache

Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-17 19:36:13 +01:00
Mark Drobnak e39584a64c Merge pull request #437 from pi-hole/tweak/quad9-detection-improvement
Improve Quad9 externally blocked detection
2018-12-16 12:27:26 -05:00
DL6ER 456ea61c48 Evaluate AD bit in combination with reply code NXDOMAIN already early as externally blocked domain. If the response code (rcode) is NXDOMAIN, we may be seeing a response from an externally blocked query. As they are not always accompany a necessary SOA record, they are not getting added to our cache and, therefore, FTL_reply() is never getting called from within the cache routines. Hence, we have to store the necessary information about the NXDOMAIN reply already here.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-15 11:04:45 +01:00
Mark Drobnak 5420945631 Merge pull request #425 from quasi-mod/master
Modify type of lastGCrun to avoid overflow

Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-14 20:28:31 +01:00
DL6ER de8450fb83 Merge pull request #430 from pi-hole/fix/no-daemon-mode
Fix no-daemon mode forking dnsmasq and not logging

Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-14 20:28:23 +01:00
Mark Drobnak 53a93f71b4 Merge pull request #431 from r00t0vi4/patch-1
Update config.c

Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-14 20:28:10 +01:00
Mark Drobnak d288b7d0e4 Merge pull request #431 from r00t0vi4/patch-1
Update config.c
2018-12-13 20:06:40 -05:00
Mark Drobnak 9452664359 Merge pull request #433 from pi-hole/new/NODATA_blocking
Add new NODATA blocking mode
2018-12-13 19:16:13 -05:00
r00t0vi4 dd9b9935ee Update config.c
getpath function contained hardcoded "PIDFILE" value

Signed-off-by: r00t0vi4 <r00t0vi4@gmail.com>
2018-12-13 09:45:36 +03:00
DL6ER 3634704115 Merge pull request #430 from pi-hole/fix/no-daemon-mode
Fix no-daemon mode forking dnsmasq and not logging
2018-12-12 19:41:49 +01:00
DL6ER fab378b27a Merge branch 'development' into new/NODATA_blocking 2018-12-12 18:07:54 +01:00
Mcat12 9b03470dfd Fix no-daemon mode forking dnsmasq and not logging
no-daemon mode operates just like debug mode, but without the debug
output, and dnsmasq is not in debug mode.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-12-11 20:40:01 -05:00
Mark Drobnak 88bad8cb71 Merge pull request #429 from pi-hole/new/shmem
Use shared memory objects for data
2018-12-11 20:11:47 -05:00
Mark Drobnak 02dcf45d13 Merge pull request #419 from pi-hole/new/efficient_NULL_blocking
Half memory usage of NULL blocking mode
2018-12-11 17:08:24 -05:00
DL6ER 45891e4d5f Update comment describing add_blocked_domain_cache()
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-11 04:33:08 +01:00
DL6ER e4ace90e99 Merge branch 'development' into new/efficient_NULL_blocking 2018-12-11 04:31:46 +01:00
Mark Drobnak 25bc3b6990 Merge pull request #426 from pi-hole/sqlite/3.26.0
Update SQLite to 3.26.0
2018-12-10 16:28:20 -05:00