aboutsummaryrefslogtreecommitdiffstats
path: root/src/fnettrace/hostnames.c
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@protonmail.com>2022-01-16 08:53:39 -0500
committerLibravatar netblue30 <netblue30@protonmail.com>2022-01-16 08:53:39 -0500
commit281d236835e546a71b96da4045b4998752f89eba (patch)
tree08b6bb349dd45ccf225d1fa1f9e875ea4ef0b7ce /src/fnettrace/hostnames.c
parentMerge pull request #4856 from smitsohu/fildes (diff)
downloadfirejail-281d236835e546a71b96da4045b4998752f89eba.tar.gz
firejail-281d236835e546a71b96da4045b4998752f89eba.tar.zst
firejail-281d236835e546a71b96da4045b4998752f89eba.zip
more on nettrace
Diffstat (limited to 'src/fnettrace/hostnames.c')
-rw-r--r--src/fnettrace/hostnames.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/fnettrace/hostnames.c b/src/fnettrace/hostnames.c
index 5422166e6..dd92070bf 100644
--- a/src/fnettrace/hostnames.c
+++ b/src/fnettrace/hostnames.c
@@ -29,7 +29,7 @@ char *retrieve_hostname(uint32_t ip) {
29 if (geoip_not_found) 29 if (geoip_not_found)
30 return NULL; 30 return NULL;
31 geoip_calls++; 31 geoip_calls++;
32 32
33 char *rv = NULL; 33 char *rv = NULL;
34 char *cmd; 34 char *cmd;
35 if (asprintf(&cmd, "/usr/bin/geoiplookup %d.%d.%d.%d", PRINT_IP(ip)) == -1) 35 if (asprintf(&cmd, "/usr/bin/geoiplookup %d.%d.%d.%d", PRINT_IP(ip)) == -1)
@@ -46,7 +46,7 @@ char *retrieve_hostname(uint32_t ip) {
46 ptr = buf + 22; 46 ptr = buf + 22;
47 if (*ptr == ' ' && *(ptr + 3) == ',' && *(ptr + 4) == ' ') { 47 if (*ptr == ' ' && *(ptr + 3) == ',' && *(ptr + 4) == ' ') {
48 rv = ptr + 5; 48 rv = ptr + 5;
49 radix_add(ip, 0xffffffff, ptr + 5); 49 rv = radix_add(ip, 0xffffffff, rv);
50 } 50 }
51 } 51 }
52 } 52 }
@@ -55,7 +55,7 @@ char *retrieve_hostname(uint32_t ip) {
55 } 55 }
56 else 56 else
57 geoip_not_found = 1; 57 geoip_not_found = 1;
58 58
59 free(cmd); 59 free(cmd);
60 60
61 return NULL; 61 return NULL;
@@ -122,9 +122,3 @@ errexit:
122 exit(1); 122 exit(1);
123} 123}
124 124
125void build_list(const char *fname) {
126 assert(fname);
127 load_hostnames(fname);
128 radix_build_list();
129}
130