From nobody Tue Mar 14 15:58:18 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PbdV30bgWz3yQPN; Tue, 14 Mar 2023 15:58:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PbdV308gBz4FHm; Tue, 14 Mar 2023 15:58:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678809499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AwabSpvGsoIXhcfkWdRoUmqO+rIPZ6D43lbRZ2IfcZg=; b=jU8RqEzGMs19kVJw7E/yfEtlhhjDQep5YmpjmXhCmIxjuj81RBMJ1HzxCIX5fNUZN7P5Wb IgxR4AJSxnekyH6BGAtB2Lw9TmPc2jXQBdTN+nElTfwLAU7XI6/KtdtOBtJ++jAaWVPpj2 sHM/H3hZ+i0gA+jY86YKyX7EeohXQCjJ3tLLRnI1TKGC3UE9hQoavAjFe7GT8XbRBYBR6J jjwCAfarC7QVxek+CePzNsLuJK2MpvYyDepdpGvCMJGGqfvkq93x5JVcR6hUX4KxJqmi2V lqAB2TzlcFIJ09qx5YhuuRngpgwrrynQT+LCUuqvIvKKfF4xtS5Y9/eyqCOHgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678809499; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AwabSpvGsoIXhcfkWdRoUmqO+rIPZ6D43lbRZ2IfcZg=; b=gKwhchuP7xgqUY8gp/PhlJvcB2J7FMLMCBzrWVxrPTvwgkbq1sif31UtWYfRUHjpLBKzZQ oCx/zRgP+bor71JKkpVhzIeaiftuyDtEXoBdrqQTn+Vfwjx6gjv+01REukAR4MPgfxwhze T43oLvyQ2qS+WOwaawpZFsdmweY0tA201lB2V23CMdMyPZJdkuuXXLBvpyfdj9/BOFw6qr poTPbh529oGVweC1/hMavgaC0kGEdlD+CjYZRA2jRVEDx8xQYUB3Ej/2pDFpJXrvvhDa1O 6+7nGAq6cAcF/YBMGWx0XTNj7HxB4hxvmP2+Yl3nVBV9ogtbnmX/N7+QL9wbeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678809499; a=rsa-sha256; cv=none; b=QIr8l/tcgUNyuZ+BMT+fMqwoyLVInKJa2AZFtOJiKCQkBXClvrmkwU2QAqW4F+eliVEWpd eO/zvzmeBRgXuM48XR1IPai+3WXzO8HYj4GD5xfLE9GJTD4UcfBKoCPiyawNjMPyTMJTzR 5sn977LdlSAt2GzKYyPmlntOWs956ArlGa5g9a8fLPwT4mBHEA67B7itiY4v8V/9/veIi5 yakP8w3QcoQ9+NQgINv0XxlvIsw9FET4Gw53IPzi0k/ZNO9Nphes4mhdTyHJVqgZLxefBR 6urm7f9SYJUz0E1fpOkd4N3oyG35Bu4+VAF3RAYfFREyiM2+15C8YX8k26Eoaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PbdV26N5nzh17; Tue, 14 Mar 2023 15:58:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32EFwIhI007931; Tue, 14 Mar 2023 15:58:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32EFwIre007930; Tue, 14 Mar 2023 15:58:18 GMT (envelope-from git) Date: Tue, 14 Mar 2023 15:58:18 GMT Message-Id: <202303141558.32EFwIre007930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 9185854d1965 - main - ping: Fix the display of Flags/Fragment Offset List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9185854d19658289d0da93bb3af8e49cba184b7e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9185854d19658289d0da93bb3af8e49cba184b7e commit 9185854d19658289d0da93bb3af8e49cba184b7e Author: Jose Luis Duran AuthorDate: 2023-03-14 15:09:27 +0000 Commit: Mark Johnston CommitDate: 2023-03-14 15:58:02 +0000 ping: Fix the display of Flags/Fragment Offset In the IP header, Flags + Fragment Offset is a 16-bit field. Use ntohs() instead of ntohl(), otherwise the Flags/Fragment Offset values may not display correctly. Before (DF set) Vr HL TOS Len ID Flg off TTL Pro cks Src Dst 4 5 00 0054 0001 0 0000 40 01 b6a4 192.0.2.1 192.0.2.2 After (DF set) Vr HL TOS Len ID Flg off TTL Pro cks Src Dst 4 5 00 0054 0001 2 0000 40 01 b6a4 192.0.2.1 192.0.2.2 Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D38479 --- sbin/ping/ping.c | 6 +++--- sbin/ping/tests/test_ping.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 2fc876e50776..00026c33a479 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1680,9 +1680,9 @@ pr_iph(struct ip *ip) (void)printf(" %1x %1x %02x %04x %04x", ip->ip_v, ip->ip_hl, ip->ip_tos, ntohs(ip->ip_len), ntohs(ip->ip_id)); - (void)printf(" %1lx %04lx", - (u_long) (ntohl(ip->ip_off) & 0xe000) >> 13, - (u_long) ntohl(ip->ip_off) & 0x1fff); + (void)printf(" %1x %04x", + (ntohs(ip->ip_off) & 0xe000) >> 13, + ntohs(ip->ip_off) & 0x1fff); (void)printf(" %02x %02x %04x", ip->ip_ttl, ip->ip_p, ntohs(ip->ip_sum)); memcpy(&ina, &ip->ip_src.s_addr, sizeof ina); diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py index 186790853314..a9b760ff7aca 100644 --- a/sbin/ping/tests/test_ping.py +++ b/sbin/ping/tests/test_ping.py @@ -919,7 +919,6 @@ Vr HL TOS Len ID Flg off TTL Pro cks Src Dst "stderr": "", "redacted": False, }, - marks=pytest.mark.skip("XXX currently failing"), id="_3_1_flags_DF", ), ]