NetBSD Problem Report #32734

From www@netbsd.org  Sat Feb  4 21:59:22 2006
Return-Path: <www@netbsd.org>
Received: by narn.netbsd.org (Postfix, from userid 31301)
	id C511D63B86B; Sat,  4 Feb 2006 21:59:22 +0000 (UTC)
Message-Id: <20060204215922.C511D63B86B@narn.netbsd.org>
Date: Sat,  4 Feb 2006 21:59:22 +0000 (UTC)
From: uwe@netbsd.org
Reply-To: uwe@netbsd.org
To: gnats-bugs@netbsd.org
Subject: Fallback ntohl &co are defined to bswap regardless of endianness
X-Send-Pr-Version: www-1.0

>Number:         32734
>Category:       port-arm
>Synopsis:       Fallback ntohl &co are defined to bswap regardless of endianness
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-arm-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 04 22:00:01 +0000 2006
>Closed-Date:    Sat Oct 07 17:05:47 +0000 2006
>Last-Modified:  Sat Oct 07 17:05:47 +0000 2006
>Originator:     Valeriy E. Ushakov
>Release:        -current
>Organization:
>Environment:
>Description:
common/lib/libc/arch/arm/gen/byte_swap_2.S
uncodintionally defines ntohs and htons as
atlernative entry points into bswap16

Ditto for bswap32.

That should be conditionalized on endianness
and for big endian no-op versions should be provided.

I guess nobody has ever encountered this bug
as the ntohl &co are inlined.
>How-To-Repeat:
Source code inspection.

>Fix:
THis is trivial to fix with come cpp logic similar to
sys/lib/libkern/arch/sh3/byte_swap_2.S

My arm fu is too weak to fix this myself.

>Release-Note:

>Audit-Trail:
From: "Valeriy E. Ushakov" <uwe@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/32734 CVS commit: src/common/lib/libc/arch/arm/gen
Date: Sat,  4 Feb 2006 23:14:48 +0000 (UTC)

 Module Name:	src
 Committed By:	uwe
 Date:		Sat Feb  4 23:14:48 UTC 2006

 Modified Files:
 	src/common/lib/libc/arch/arm/gen: byte_swap_2.S byte_swap_4.S

 Log Message:
 Define htonl &co as alternative names to bswap only if little endian.
 I'm not sure if idempotent versions need to be defined for big endian,
 as the man page says in that case they are defined idempotent macros.

 PR port-arm/32734


 To generate a diff of this commit:
 cvs rdiff -r1.2 -r1.3 src/common/lib/libc/arch/arm/gen/byte_swap_2.S \
     src/common/lib/libc/arch/arm/gen/byte_swap_4.S

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: uwe@netbsd.org
State-Changed-When: Sat, 04 Feb 2006 23:18:41 +0000
State-Changed-Why:
Waiting for expert opinion from Klaus.


State-Changed-From-To: feedback->closed
State-Changed-By: elad@netbsd.org
State-Changed-When: Sat, 07 Oct 2006 17:05:47 +0000
State-Changed-Why:
fixed & feedback timeout
D

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.