summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-04-14 13:10:45 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-04-14 13:10:45 -0500
commit962d2fff509e251ae715875e89e5a080a37ab588 (patch)
tree2938bc889356ffc8a20a611d18c851a83137d731
parentf86c13ce8bd07025f98e0c7982ec4d3ccb0ecb62 (diff)
downloadofono-962d2fff509e251ae715875e89e5a080a37ab588.tar.bz2
Fix: Use a union for other address objects
-rw-r--r--src/stkutil.c2
-rw-r--r--src/stkutil.h6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/stkutil.c b/src/stkutil.c
index 3c792ff6..43c06cd2 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -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;
}
diff --git a/src/stkutil.h b/src/stkutil.h
index 08110484..1c05440f 100644
--- a/src/stkutil.h
+++ b/src/stkutil.h
@@ -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;
};