Fix compiler error on mac (?)

This commit is contained in:
Arnout Engelen
2016-03-20 23:23:27 +01:00
parent 41614af520
commit f2a2d368bc
2 changed files with 13 additions and 14 deletions

View File

@@ -35,7 +35,6 @@
#endif #endif
extern local_addr * local_addrs; extern local_addr * local_addrs;
/* /*
* connection-inode table. takes information from /proc/net/tcp. * connection-inode table. takes information from /proc/net/tcp.
* key contains source ip, source port, destination ip, destination * key contains source ip, source port, destination ip, destination
@@ -143,12 +142,12 @@ void addtoconninode (char * buffer)
* 172.16.3.3, packages arrive from 195.169.216.157 to 172.16.3.3, where * 172.16.3.3, packages arrive from 195.169.216.157 to 172.16.3.3, where
* 172.16.3.1 and 195.169.216.157 are the local addresses of different * 172.16.3.1 and 195.169.216.157 are the local addresses of different
* interfaces */ * interfaces */
struct local_addr * current_local_addr = local_addrs; for (class local_addr *current_local_addr = local_addrs;
while (current_local_addr != NULL) { current_local_addr != NULL;
current_local_addr = current_local_addr->next) {
/* TODO maybe only add the ones with the same sa_family */ /* TODO maybe only add the ones with the same sa_family */
snprintf(hashkey, HASHKEYSIZE * sizeof(char), "%s:%d-%s:%d", current_local_addr->string, local_port, remote_string, rem_port); snprintf(hashkey, HASHKEYSIZE * sizeof(char), "%s:%d-%s:%d", current_local_addr->string, local_port, remote_string, rem_port);
conninode[hashkey] = inode; conninode[hashkey] = inode;
current_local_addr = current_local_addr->next;
} }
free (hashkey); free (hashkey);
free (remote_string); free (remote_string);