aboutsummaryrefslogtreecommitdiff
path: root/cddl/lib
diff options
context:
space:
mode:
authorAndrey V. Elsukov <ae@FreeBSD.org>2016-12-29 20:27:54 +0000
committerAndrey V. Elsukov <ae@FreeBSD.org>2016-12-29 20:27:54 +0000
commit4349a2145f1c7106124d3119130d1c8b5e25ec9e (patch)
tree918882545b2c06797d586ab9fb0c0a8fba153bef /cddl/lib
parent8e7c7e4ed772a8835b1240c4e60957a9e1070d53 (diff)
downloadsrc-4349a2145f1c7106124d3119130d1c8b5e25ec9e.tar.gz
src-4349a2145f1c7106124d3119130d1c8b5e25ec9e.zip
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. Reviewed by: markj@ MFC after: 1 week
Notes
Notes: svn path=/head/; revision=310785
Diffstat (limited to 'cddl/lib')
-rw-r--r--cddl/lib/libdtrace/ip.d4
1 files changed, 2 insertions, 2 deletions
diff --git a/cddl/lib/libdtrace/ip.d b/cddl/lib/libdtrace/ip.d
index eb3846bda1c0..e3fc23dbf744 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];