Registered Member
|
Not sure whether this has been fixed in newer version. But here is the bug.
void UTPex::encode(…) // UTPEX.CPP { . . // Use KDE API to get an IP in Network Byte Order. // WriteUint32 swap the byte order again!!! WriteUint32(buf,size,addr.ipAddress().IPv4Addr()); . . } void WriteUint32(Uint8* buf,Uint32 off,Uint32 val) //FUNCTIONS.CPP { // swap the byte order buf[off + 0] = (Uint8) ((val & 0xFF000000) >> 24); buf[off + 1] = (Uint8) ((val & 0x00FF0000) >> 16); buf[off + 2] = (Uint8) ((val & 0x0000FF00) >> 8); buf[off + 3] = (Uint8) (val & 0x000000FF); } |
Moderator
|
I'm not sure looking at the documentation and the implementation, seeing that it returns quint32 from an internal array.
http://api.kde.org/4.x-api/kdelibs-apid ... 4c462300ba We need to figure out if KIpAddress stores the address in network or host byte order internally. |
Registered Member
|
I am quite sure the KDE lib return IP in network byte order. You can write a testing program to try it out.
|
Moderator
|
|
Registered Member
|
Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar