summaryrefslogtreecommitdiff
path: root/iftop.c
diff options
context:
space:
mode:
authorpdw <>2004-02-05 22:58:06 +0000
committerpdw <>2004-02-05 22:58:06 +0000
commit2fd7012129ac64b99e64cddee6b3697f4adb76d1 (patch)
tree5f0949147f4aa0742018091d6b2853e2696dbc05 /iftop.c
parentf123c4f1f7324bdf4eb45c1538cd9b0de6225b71 (diff)
downloadiftop-2fd7012129ac64b99e64cddee6b3697f4adb76d1.zip
Fixes for type-punned pointers - Henne Vogelsang <hvogel@suse.de>
Diffstat (limited to 'iftop.c')
-rw-r--r--iftop.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/iftop.c b/iftop.c
index a3a6523..6dc8a8f 100644
--- a/iftop.c
+++ b/iftop.c
@@ -187,6 +187,10 @@ static void handle_ip_packet(struct ip* iptr, int hw_dir)
{
int direction = 0; /* incoming */
history_type* ht;
+ union {
+ history_type **ht_pp;
+ void **void_pp;
+ } u_ht = { &ht };
addr_pair ap;
int len;
@@ -261,7 +265,7 @@ static void handle_ip_packet(struct ip* iptr, int hw_dir)
resolve(&iptr->ip_dst, NULL, 0);
resolve(&iptr->ip_src, NULL, 0);
- if(hash_find(history, &ap, (void**)&ht) == HASH_STATUS_KEY_NOT_FOUND) {
+ if(hash_find(history, &ap, u_ht.void_pp) == HASH_STATUS_KEY_NOT_FOUND) {
ht = history_create();
hash_insert(history, &ap, ht);
}