From: Harald Welte <laforge@gnumonks.org>
To: Andi Kleen <ak@suse.de>
Cc: David Miller <davem@redhat.com>,
netdev@oss.sgi.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix HIPQUAD macro in kernel.h
Date: Thu, 8 Aug 2002 14:06:32 +0200 [thread overview]
Message-ID: <20020808140632.I11828@sunbeam.de.gnumonks.org> (raw)
In-Reply-To: <20020808134113.A2552@wotan.suse.de>; from ak@suse.de on Thu, Aug 08, 2002 at 01:41:13PM +0200
[-- Attachment #1: Type: text/plain, Size: 1674 bytes --]
On Thu, Aug 08, 2002 at 01:41:13PM +0200, Andi Kleen wrote:
> On Thu, Aug 08, 2002 at 01:31:12PM +0200, Harald Welte wrote:
> > Hi Dave!
> >
> > Below is a fix for the HIPQUAD macro in kernel.h. The macro is currently
> > not endian-aware - it just assumes running on a little-endian machine.
> >
> > If you don't like the #ifdefs in kernel.h, the macros could be moved into
> > include/linux/byteorder/.
> >
> > Please apply, thanks
>
> That change is wrong. IP address should be always in network order (=BE)
> while in kernel.
well, there is for example a short codepath in ip_conntrack_irc.c, where
the ip address is parsed from the packet payload (after which it is present
in host byte order). Before it is written to the apropriate data structures,
we convert it to network byte order. And just before this happens,
there are debug printk's which use HIPQUAD.
What is the point of providing two macros (HIPQUAD and NIPQUAD), if
one of them does only work on little-endian. I would understand your point
if th HIPQUAD macro wasn't present at all (and only NIPQUAD existed).
I assumed that NIPQUAD does parse an ip address in network byte order,
and HIPQUAD in host byte order. If they are really meant for little or
big endian, they should be renamed to BEIPQUAD and LEIPQUAD.
> -Andi
--
Live long and prosper
- Harald Welte / laforge@gnumonks.org http://www.gnumonks.org/
============================================================================
GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M+
V-- PS++ PE-- Y++ PGP++ t+ 5-- !X !R tv-- b+++ !DI !D G+ e* h--- r++ y+(*)
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
next prev parent reply other threads:[~2002-08-08 12:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-08 11:31 Harald Welte
2002-08-08 11:41 ` Andi Kleen
2002-08-08 12:06 ` Harald Welte [this message]
2002-08-08 14:48 ` David S. Miller
2002-08-08 14:58 ` David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020808140632.I11828@sunbeam.de.gnumonks.org \
--to=laforge@gnumonks.org \
--cc=ak@suse.de \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®