Commit 1f6691ae authored by Håvard Moås's avatar Håvard Moås
Browse files

Update IPFIXLIB to fix error in byte ordering for ipv4 addresses (regression),...

Update IPFIXLIB to fix error in byte ordering for ipv4 addresses (regression), havard.mork@gmail.com

git-svn-id: file:///home/svn/mapi/branches/haavardm-mapi@115 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 22947395
......@@ -896,11 +896,14 @@ static void copyIpV6(struct in6_addr ipv6, char *outBuffer, int *outBufferBegin,
static void copyIpAddress(u_int8_t version, IpAddress ipaddr, char *outBuffer, int *outBufferBegin, int *outBufferMax) {
int strLen = (version==6)?sizeof(ipaddr.ipType.ipv6):sizeof(ipaddr.ipType.ipv4);
if(ipaddr.ipVersion==version)
copyLen(((version==6)?((char*)&ipaddr.ipType.ipv6):((char*)&ipaddr.ipType.ipv4)),
(version==6)?sizeof(ipaddr.ipType.ipv6):sizeof(ipaddr.ipType.ipv4),
outBuffer, outBufferBegin, outBufferMax);
else {
if(ipaddr.ipVersion==version) {
if(version==4)
copyInt32(ipaddr.ipType.ipv4, outBuffer, outBufferBegin, outBufferMax);
else {
copyLen(((char*)&ipaddr.ipType.ipv6), sizeof(ipaddr.ipType.ipv6),
outBuffer, outBufferBegin, outBufferMax);
}
} else {
/* Write empty data for address */
if((*outBufferBegin)+strLen < (*outBufferMax)) {
memset(&outBuffer[(*outBufferBegin)], 0, strLen);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment