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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user