diff options
author | ae <ae@FreeBSD.org> | 2017-01-08 13:38:17 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2017-01-08 13:38:17 +0000 |
commit | 38902a1ccc4c3301ac9d5ac36701c55e9fad5ac4 (patch) | |
tree | 86dcf38fa2657596e610e5bb1fbdc71486b6e125 | |
parent | 32933c6213a1b40eae2c2d7b2c2d879158b18d6a (diff) | |
download | FreeBSD-src-38902a1ccc4c3301ac9d5ac36701c55e9fad5ac4.zip FreeBSD-src-38902a1ccc4c3301ac9d5ac36701c55e9fad5ac4.tar.gz |
MFC r310785:
Convert ipv4_flags and ipv4_offset fields into host byte order.
Also save only high bits in the ipv4_flags, because it is defined
as uint8_t. So now it will show DF and MF flags as 0x40 and 0x20.
-rw-r--r-- | cddl/lib/libdtrace/ip.d | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cddl/lib/libdtrace/ip.d b/cddl/lib/libdtrace/ip.d index eb3846b..e3fc23d 100644 --- a/cddl/lib/libdtrace/ip.d +++ b/cddl/lib/libdtrace/ip.d @@ -255,8 +255,8 @@ translator ipv4info_t < struct ip *p > { ipv4_tos = p == NULL ? 0 : p->ip_tos; ipv4_length = p == NULL ? 0 : ntohs(p->ip_len); ipv4_ident = p == NULL ? 0 : ntohs(p->ip_id); - ipv4_flags = p == NULL ? 0 : (p->ip_off & 0xe000); - ipv4_offset = p == NULL ? 0 : p->ip_off; + ipv4_flags = p == NULL ? 0 : (ntohs(p->ip_off) & 0xe000) >> 8; + ipv4_offset = p == NULL ? 0 : ntohs(p->ip_off) & 0x1fff; ipv4_ttl = p == NULL ? 0 : p->ip_ttl; ipv4_protocol = p == NULL ? 0 : p->ip_p; ipv4_protostr = p == NULL ? "<null>" : protocols[p->ip_p]; |