Changeset 791:42fa209a8cc4 in freeDiameter
- Timestamp:
- Jul 13, 2012, 5:31:20 AM (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdproto/messages.c
r765 r791 1323 1323 *(uint32_t *)(_bufptr) = htonl((uint32_t)(_u32data)); \ 1324 1324 } 1325 1326 /* The location is not on 64b boundary, so we split the writing in two operations to avoid sigbus */ 1325 1327 #define PUT_in_buf_64( _u64data, _bufptr ) { \ 1326 *(uint64_t *)(_bufptr) = htonll((uint64_t)(_u64data)); \ 1328 uint64_t __v = htonll((uint64_t)(_u64data)); \ 1329 *(uint32_t *)(_bufptr) = (uint32_t)(__v); \ 1330 *(((uint32_t *)(_bufptr))+1) = (uint32_t)(__v >> 32); \ 1327 1331 } 1328 1332 … … 1774 1778 1775 1779 case AVP_TYPE_INTEGER64: 1776 avp->avp_storage.i64 = (int64_t)ntohll(*(uint64_t *)avp->avp_source); 1780 /* the storage might not be aligned on 64b boundary, so no direct indirection here is possible */ 1781 { 1782 uint64_t __stor; 1783 memcpy(&__stor, avp->avp_source, sizeof(__stor)); 1784 avp->avp_storage.i64 = (int64_t)ntohll(__stor); 1785 } 1777 1786 break; 1778 1787 … … 1784 1793 case AVP_TYPE_UNSIGNED64: 1785 1794 case AVP_TYPE_FLOAT64: /* same as 32 bits */ 1786 avp->avp_storage.u64 = (uint64_t)ntohll(*(uint64_t *)avp->avp_source); 1795 { 1796 uint64_t __stor; 1797 memcpy(&__stor, avp->avp_source, sizeof(__stor)); 1798 avp->avp_storage.u64 = (uint64_t)ntohll(__stor); 1799 } 1787 1800 break; 1788 1801
Note: See TracChangeset
for help on using the changeset viewer.