Fix: Use a union for other address objects

This commit is contained in:
Denis Kenzior 2010-04-14 13:10:45 -05:00
parent f86c13ce8b
commit 962d2fff50
2 changed files with 6 additions and 2 deletions

View File

@ -1202,7 +1202,7 @@ static gboolean parse_dataobj_other_address(
data = comprehension_tlv_iter_get_data(iter);
oa->type = data[0];
memcpy(oa->addr, data + 1, len - 1);
memcpy(&oa->addr, data + 1, len - 1);
return TRUE;
}

View File

@ -562,7 +562,11 @@ struct stk_card_reader_id {
* So the maximum size is 16 (for ipv6).
*/
struct stk_other_address {
unsigned char addr[16];
union {
/* Network Byte Order */
unsigned int ipv4;
unsigned char ipv6[16];
} addr;
unsigned char type;
};