From 53fe80d8a7c99f041cdf944813c9342c84ed4434 Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Mon, 3 Dec 2012 20:34:15 -0300 Subject: [PATCH] Added fix for IP::tot_len's endianess in OSX. --- include/ip.h | 4 ++-- src/ip.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/ip.h b/include/ip.h index ef3d903..64bc8ee 100644 --- a/include/ip.h +++ b/include/ip.h @@ -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); diff --git a/src/ip.cpp b/src/ip.cpp index f7590eb..c95a2be 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -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);