1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Added fix for IP::tot_len's endianess in OSX.

This commit is contained in:
Matias Fontanini
2012-12-03 20:34:15 -03:00
parent 742276c251
commit 53fe80d8a7
2 changed files with 4 additions and 4 deletions

View File

@@ -260,8 +260,8 @@ namespace Tins {
* \return The total length of this IP PDU.
*/
uint16_t tot_len() const {
// BSD wants this in host byte order............
#ifdef BSD
// FreeBSD wants this in host byte order............
#ifdef __FreeBSD__
return _ip.tot_len;
#else
return Endian::be_to_host(_ip.tot_len);

View File

@@ -170,8 +170,8 @@ void IP::tos(uint8_t new_tos) {
}
void IP::tot_len(uint16_t new_tot_len) {
// BSD wants this in host byte order............
#ifdef BSD
// FreeBSD wants this in host byte order............
#ifdef __FreeBSD__
_ip.tot_len = new_tot_len;
#else
_ip.tot_len = Endian::host_to_be(new_tot_len);