From vs@theater.dyndns.org  Thu Jan 24 09:22:05 2002
Return-Path: <vs@theater.dyndns.org>
Received: from mailout09.sul.t-online.com (mailout09.sul.t-online.com [194.25.134.84])
	by hub.freebsd.org (Postfix) with ESMTP
	id 7E97A37B404; Thu, 24 Jan 2002 09:22:04 -0800 (PST)
Received: from fwd01.sul.t-online.de 
	by mailout09.sul.t-online.com with smtp 
	id 16TnZb-0001QZ-03; Thu, 24 Jan 2002 18:22:03 +0100
Received: from theater.dyndns.org (320068889749-0001@[217.80.156.227]) by fmrl01.sul.t-online.com
	with esmtp id 16TnZR-14lJCaC; Thu, 24 Jan 2002 18:21:53 +0100
Received: from varphi.ikea.net (varphi.ikea.net [fec0::3:240:5ff:fea1:8f55])
	by theater.dyndns.org (8.11.6/8.11.6) with ESMTP id g0OHLqr00955;
	Thu, 24 Jan 2002 18:21:53 +0100 (CET)
	(envelope-from vs@erde.ikea.net)
Received: (from vs@localhost)
	by varphi.ikea.net (8.11.6/8.11.6) id 20OHA8r00644;
	Mon, 24 Jan 2022 18:10:08 +0100 (CET)
	(envelope-from vs)
Message-Id: <202201241710.20OHA8r00644@varphi.ikea.net>
Date: Mon, 24 Jan 2022 18:10:08 +0100 (CET)
From: Volker Stolz <stolz@informatik.rwth-aachen.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc: alpha@freebsd.org
Subject: rpc.statd throws alignment errors
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         34232
>Category:       alpha
>Synopsis:       rpc.statd throws alignment errors
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-alpha
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 24 09:30:00 PST 2002
>Closed-Date:    Mon May 23 21:58:28 GMT 2005
>Last-Modified:  Mon May 23 21:58:28 GMT 2005
>Originator:     Volker Stolz
>Release:        FreeBSD RC1 alpha
>Organization:
Lehrstuhl fr Informatik II
>Environment:
System: FreeBSD varphi.ikea.net RC1 FreeBSD RC1 #0: Thu Jan 20 22:20:51 CET 2022 vs@varphi.ikea.net:/usr/src/sys/compile/VARPHI alpha

>Description:
rpc.statd throws alignment errors when started.
>How-To-Repeat:
Simply invoke rpc.statd.
>Fix:
Unkown.

>Release-Note:
>Audit-Trail:

From: Volker Stolz <stolz@hyperion.informatik.rwth-aachen.de>
To: alpha@freebsd.org
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: alpha/34232: rpc.statd throws alignment errors
Date: Sun, 27 Jan 2002 18:26:44 +0100

 More details after building libc with debugging support:
 #0  0x120005584 in get_myaddress (addr=0x11ffb950)
     at /usr/src/lib/libc/../libc/rpc/get_myaddress.c:84
 84			memcpy(&ifreq, ifr, sizeof(ifreq));
 -- 
 Wonderful \hbox (0.80312pt too nice) in paragraph at lines 16--18
 Volker Stolz * stolz@i2.informatik.rwth-aachen.de
 Please use PGP or S/MIME for correspondence!

From: Volker Stolz <stolz@hyperion.informatik.rwth-aachen.de>
To: freebsd-gnats-submit@freebsd.org
Cc: alpha@freebsd.org
Subject: Re: alpha/34232: rpc.statd throws alignment errors
Date: Sun, 27 Jan 2002 23:43:44 +0100

 Sigh. Okay. Here's my first take at this sucker:
 Some interface addresses have 26 bytes in size, which causes
 the alignment error. The attached fix will solve my rpc.statd
 problem and hopefully a couple of things more (I saw dhclient
 going mad on me earlier, but this seems to have been fixed now,
 too).  The obvious disadvantage: Each time, the ioctl will copy
 up to 7(6?) bytes of garbage, but we can probably live with
 that :-) Should I hunt down the place where this ifa->ifa_addr is 
 initialized and add the padding right then when the interface
 (address) is created? This patch seems to be closely related to
 the ifconfig patch.
 
 Another question: Can I safely replace
   memcpy(&ifreq, ifr, sizeof(ifreq));
 with
   ifreq=*ifr;
 in lib/libc/rpc/get_myaddress.c? I know that this kind of
 assignment has been non-standard, but I'd like to know if
 this will safely work today. I did check, it works fine.
 It will de-obfuscate the code and even eliminate one warning :-)
 
 --- sys/net/if.c.orig	Sun Jan 27 23:25:54 2002
 +++ sys/net/if.c	Sun Jan 27 23:12:54 2002
 @@ -1298,6 +1298,7 @@
  		for ( ; space > sizeof (ifr) && ifa;
  		    ifa = ifa->ifa_link.tqe_next) {
  			register struct sockaddr *sa = ifa->ifa_addr;
 +			sa->sa_len = _ALIGN(sa->sa_len);
  			if (curproc->p_prison && prison_if(curproc, sa))
  				continue;
  			addrs++;
 -- 
 Wonderful \hbox (0.80312pt too nice) in paragraph at lines 16--18
 Volker Stolz * stolz@i2.informatik.rwth-aachen.de
 Please use PGP or S/MIME for correspondence!

From: Sten Spans <sten@blinkenlights.nl>
To: bug-followup@FreeBSD.org, stolz@informatik.rwth-aachen.de
Cc:  
Subject: Re: alpha/34232: rpc.statd throws alignment errors
Date: Mon, 23 May 2005 22:39:48 +0200 (CEST)

 This code ( /usr/src/lib//libc/rpc/get_myaddress.c )
 has been retired about four years ago.
 The replacement code doesn't seem to have the
 same alignment problems. Please close this pr.
 
 -- 
 Sten Spans
 
 "There is a crack in everything, that's how the light gets in."
 Leonard Cohen - Anthem
State-Changed-From-To: open->closed 
State-Changed-By: vs 
State-Changed-When: Mon May 23 21:55:56 GMT 2005 
State-Changed-Why:  
Closed: No longer pertinent for 5.x/6.x 

http://www.freebsd.org/cgi/query-pr.cgi?pr=34232 
>Unformatted:
