From owner-svn-src-stable-8@FreeBSD.ORG Fri Jun 10 19:13:23 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D4AD106564A; Fri, 10 Jun 2011 19:13:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CC878FC08; Fri, 10 Jun 2011 19:13:23 +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 p5AJDNQP039724; Fri, 10 Jun 2011 19:13:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5AJDNCj039722; Fri, 10 Jun 2011 19:13:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201106101913.p5AJDNCj039722@svn.freebsd.org> From: John Baldwin Date: Fri, 10 Jun 2011 19:13:23 +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: r222947 - stable/8/usr.bin/rlogin X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2011 19:13:23 -0000 Author: jhb Date: Fri Jun 10 19:13:22 2011 New Revision: 222947 URL: http://svn.freebsd.org/changeset/base/222947 Log: MFC 221079: Generate the network byte order version of the window size structure in a temporary variable on the stack and then copy that into the output buffer so that the htons() conversions use aligned accesses. Modified: stable/8/usr.bin/rlogin/rlogin.c Directory Properties: stable/8/usr.bin/rlogin/ (props changed) Modified: stable/8/usr.bin/rlogin/rlogin.c ============================================================================== --- stable/8/usr.bin/rlogin/rlogin.c Fri Jun 10 19:12:00 2011 (r222946) +++ stable/8/usr.bin/rlogin/rlogin.c Fri Jun 10 19:13:22 2011 (r222947) @@ -485,18 +485,18 @@ sigwinch(int signo __unused) void sendwindow(void) { - struct winsize *wp; + struct winsize ws; char obuf[4 + sizeof (struct winsize)]; - wp = (struct winsize *)(obuf+4); obuf[0] = 0377; obuf[1] = 0377; obuf[2] = 's'; obuf[3] = 's'; - wp->ws_row = htons(winsize.ws_row); - wp->ws_col = htons(winsize.ws_col); - wp->ws_xpixel = htons(winsize.ws_xpixel); - wp->ws_ypixel = htons(winsize.ws_ypixel); + ws.ws_row = htons(winsize.ws_row); + ws.ws_col = htons(winsize.ws_col); + ws.ws_xpixel = htons(winsize.ws_xpixel); + ws.ws_ypixel = htons(winsize.ws_ypixel); + bcopy(&ws, obuf + 4, sizeof(ws)); (void)write(rem, obuf, sizeof(obuf)); }