From owner-svn-src-all@FreeBSD.ORG Mon Sep 5 17:45:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7F2C1065670; Mon, 5 Sep 2011 17:45:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACE678FC17; Mon, 5 Sep 2011 17:45:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p85HjMjv047648; Mon, 5 Sep 2011 17:45:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p85HjMM1047645; Mon, 5 Sep 2011 17:45:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201109051745.p85HjMM1047645@svn.freebsd.org> From: Marius Strobl Date: Mon, 5 Sep 2011 17:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225403 - in stable/8/tools/tools/netrate: netblast netsend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2011 17:45:22 -0000 Author: marius Date: Mon Sep 5 17:45:22 2011 New Revision: 225403 URL: http://svn.freebsd.org/changeset/base/225403 Log: MFC: r225334 Fix alignment assumptions. PR: 160289 Modified: stable/8/tools/tools/netrate/netblast/netblast.c stable/8/tools/tools/netrate/netsend/netsend.c Directory Properties: stable/8/tools/tools/netrate/netblast/ (props changed) stable/8/tools/tools/netrate/netsend/ (props changed) Modified: stable/8/tools/tools/netrate/netblast/netblast.c ============================================================================== --- stable/8/tools/tools/netrate/netblast/netblast.c Mon Sep 5 15:21:18 2011 (r225402) +++ stable/8/tools/tools/netrate/netblast/netblast.c Mon Sep 5 17:45:22 2011 (r225403) @@ -26,6 +26,7 @@ * $FreeBSD$ */ +#include #include #include #include @@ -108,11 +109,9 @@ blast_loop(int s, long duration, u_char * previous send, the error will turn up the current send * operation, causing the current sequence number also to be * skipped. - * - * XXXRW: Note alignment assumption. */ if (packet_len >= 4) { - *((u_int32_t *)packet) = htonl(counter); + be32enc(packet, counter); counter++; } if (send(s, packet, packet_len, 0) < 0) Modified: stable/8/tools/tools/netrate/netsend/netsend.c ============================================================================== --- stable/8/tools/tools/netrate/netsend/netsend.c Mon Sep 5 15:21:18 2011 (r225402) +++ stable/8/tools/tools/netrate/netsend/netsend.c Mon Sep 5 17:45:22 2011 (r225403) @@ -26,6 +26,7 @@ * $FreeBSD$ */ +#include #include #include #include @@ -203,11 +204,9 @@ timing_loop(struct _a *a) * skipped. * The counter is incremented only on the initial port number, * so all destinations will see the same set of packets. - * - * XXXRW: Note alignment assumption. */ if (cur_port == a->port && a->packet_len >= 4) { - *((u_int32_t *)a->packet) = htonl(counter); + be32enc(a->packet, counter); counter++; } if (a->port == a->port_max) { /* socket already bound */