Fixes for type-punned pointers - Henne Vogelsang <hvogel@suse.de>
This commit is contained in:
6
iftop.c
6
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user