Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Jan 2017 13:38:17 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r311683 - stable/11/cddl/lib/libdtrace
Message-ID:  <201701081338.v08DcHAe095870@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Sun Jan  8 13:38:17 2017
New Revision: 311683
URL: https://svnweb.freebsd.org/changeset/base/311683

Log:
  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.

Modified:
  stable/11/cddl/lib/libdtrace/ip.d
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/cddl/lib/libdtrace/ip.d
==============================================================================
--- stable/11/cddl/lib/libdtrace/ip.d	Sun Jan  8 13:35:10 2017	(r311682)
+++ stable/11/cddl/lib/libdtrace/ip.d	Sun Jan  8 13:38:17 2017	(r311683)
@@ -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];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701081338.v08DcHAe095870>