File: bug-debian-962695-ipv6-dns-resolution.patch

package info (click to toggle)
iftop 1.0~pre4-10
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,120 kB
  • sloc: ansic: 5,782; sh: 4,262; makefile: 38
file content (46 lines) | stat: -rw-r--r-- 1,851 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From: Markus Koschany <apo@debian.org>
Date: Fri, 24 Feb 2023 22:09:00 +0100
Subject: bug debian 962695 ipv6 dns resolution

Bug-Debian: https://bugs.debian.org/962695
Origin: https://code.blinkace.com/pdw/iftop/-/commit/35af3cf65f17961d173b31fd3b00166ec095c226
---
 resolver.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/resolver.c b/resolver.c
index adddbc1..a3123bd 100644
--- a/resolver.c
+++ b/resolver.c
@@ -438,11 +438,11 @@ void resolver_worker(void* ptr) {
 		    char **ch_pp;
 		    void **void_pp;
 		} u_old = { &old };
-                if(hash_find(ns_hash, &addr, u_old.void_pp) == HASH_STATUS_OK) {
+                if(hash_find(ns_hash, &addr.as_addr6, u_old.void_pp) == HASH_STATUS_OK) {
                     hash_delete(ns_hash, &addr);
                     xfree(old);
                 }
-                hash_insert(ns_hash, &addr, (void*)hostname);
+                hash_insert(ns_hash, &addr.as_addr6, (void*)hostname);
             }
 
         }
@@ -488,7 +488,7 @@ void resolve(int af, void* addr, char* result, int buflen) {
 
         pthread_mutex_lock(&resolver_queue_mutex);
 
-        if(hash_find(ns_hash, raddr, u_hostname.void_pp) == HASH_STATUS_OK) {
+        if(hash_find(ns_hash, &raddr->as_addr6, u_hostname.void_pp) == HASH_STATUS_OK) {
             /* Found => already resolved, or on the queue, no need to keep
 	     * it around */
             free(raddr);
@@ -497,7 +497,7 @@ void resolve(int af, void* addr, char* result, int buflen) {
             hostname = xmalloc(INET6_ADDRSTRLEN);
             inet_ntop(af, &raddr->addr, hostname, INET6_ADDRSTRLEN);
 
-            hash_insert(ns_hash, raddr, hostname);
+            hash_insert(ns_hash, &raddr->as_addr6, hostname);
 
             if(((head + 1) % RESOLVE_QUEUE_LENGTH) == tail) {
                 /* queue full */