Fixes for type-punned pointers - Henne Vogelsang <hvogel@suse.de>

This commit is contained in:
pdw
2004-02-05 22:58:06 +00:00
parent f123c4f1f7
commit 2fd7012129
3 changed files with 26 additions and 5 deletions

View File

@@ -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);
}