diff options
author | jake <jake@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-02-09 08:40:40 +0000 |
---|---|---|
committer | jake <jake@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-02-09 08:40:40 +0000 |
commit | b1b69320717045bbff86887735dbd7cbfe08a8d3 (patch) | |
tree | 8df3856878d326c98870bac7cb3f8b9e58f341a0 /epan/dissectors/packet-6lowpan.c | |
parent | 5971dede0bfdbbe1eacbf9a823e9c6d291fccc20 (diff) |
From Owen Kirby:
This patch fixes a bug in the 6LoWPAN dissector where link-local addresses
created from an EUI-64 address do not correctly invert the universal/local bit
as recommended by section 4 of RFC2464.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31843 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-6lowpan.c')
-rw-r--r-- | epan/dissectors/packet-6lowpan.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/epan/dissectors/packet-6lowpan.c b/epan/dissectors/packet-6lowpan.c index daa112e41c..06eef8349f 100644 --- a/epan/dissectors/packet-6lowpan.c +++ b/epan/dissectors/packet-6lowpan.c @@ -464,6 +464,8 @@ lowpan_dlsrc_to_ifcid(packet_info *pinfo, guint8 *ifcid) /* Check the link-layer address field. */ if (pinfo->dl_src.type == AT_EUI64) { memcpy(ifcid, pinfo->dl_src.data, LOWPAN_IFC_ID_LEN); + /* RFC2464: Invert the U/L bit when using an EUI64 address. */ + ifcid[0] ^= 0x02; return TRUE; } @@ -476,6 +478,8 @@ lowpan_dlsrc_to_ifcid(packet_info *pinfo, guint8 *ifcid) guint64 addr; addr = pntoh64(&packet->src.addr64); memcpy(ifcid, &addr, LOWPAN_IFC_ID_LEN); + /* RFC2464: Invert the U/L bit when using an EUI64 address. */ + ifcid[0] ^= 0x02; return TRUE; } if (packet->src_addr_mode == IEEE802154_FCF_ADDR_SHORT) { @@ -509,6 +513,8 @@ lowpan_dldst_to_ifcid(packet_info *pinfo, guint8 *ifcid) /* Check the link-layer address field. */ if (pinfo->dl_dst.type == AT_EUI64) { memcpy(ifcid, pinfo->dl_dst.data, LOWPAN_IFC_ID_LEN); + /* RFC2464: Invert the U/L bit when using an EUI64 address. */ + ifcid[0] ^= 0x02; return TRUE; } @@ -521,6 +527,8 @@ lowpan_dldst_to_ifcid(packet_info *pinfo, guint8 *ifcid) guint64 addr; addr = pntoh64(&packet->dst.addr64); memcpy(ifcid, &addr, LOWPAN_IFC_ID_LEN); + /* RFC2464: Invert the U/L bit when using an EUI64 address. */ + ifcid[0] ^= 0x02; return TRUE; } if (packet->src_addr_mode == IEEE802154_FCF_ADDR_SHORT) { |