All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Mackall <mpm@selenic.com>
To: Duncan Sands <baldrick@free.fr>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] netpoll endian fixes
Date: Tue, 7 Sep 2004 18:57:02 -0500	[thread overview]
Message-ID: <20040907235702.GC31237@waste.org> (raw)
In-Reply-To: <200409080124.43530.baldrick@free.fr>

On Wed, Sep 08, 2004 at 01:24:43AM +0200, Duncan Sands wrote:
> The big-endians took their revenge in netpoll.c: on i386,
> the ip header length / version nibbles need to be the other
> way round; and the htonl leaves only zeros in tot_len...
> 
> All the best, 
> 
> Duncan.
> 
> 
> --- linux-2.5/net/core/netpoll.c.orig	2004-09-08 01:15:22.000000000 +0200
> +++ linux-2.5/net/core/netpoll.c	2004-09-08 01:05:33.000000000 +0200
> @@ -22,6 +22,7 @@
>  #include <net/tcp.h>
>  #include <net/udp.h>
>  #include <asm/unaligned.h>
> +#include <asm/byteorder.h>
>  
>  /*
>   * We maintain a small pool of fully-sized skbs, to make sure the
> @@ -242,9 +243,13 @@
>  	iph = (struct iphdr *)skb_push(skb, sizeof(*iph));
>  
>  	/* iph->version = 4; iph->ihl = 5; */
> +#if defined(__LITTLE_ENDIAN_BITFIELD)
> +	put_unaligned(0x45, (unsigned char *)iph);
> +#else
>  	put_unaligned(0x54, (unsigned char *)iph);
> +#endif

Probably what's happened is this:

The original person who sent me the alignment fixes sent a similar
bizarre endian #ifdef thing. He didn't send it as a proper patch
though, so I redid it and copied the not-so-obviously incorrect
clause.

It looks like it ought to be 0x45 everywhere, meaning it's currently
broken everywhere. But no one's complained. Unfortunately at the
present moment I've got one machine short of a test rig unpacked, so
I'm loathe to push another fix until I get some other test reports.
Anyone else run into trouble with netpoll/netconsole in recent -mm or
-bk?

-- 
Mathematics is the supreme nostalgia of our time.

  parent reply	other threads:[~2004-09-07 23:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-07 23:24 [PATCH] netpoll endian fixes Duncan Sands
2004-09-07 23:29 ` Matt Mackall
2004-09-08  6:56   ` Duncan Sands
2004-09-07 23:57 ` Matt Mackall [this message]
2004-09-08 10:01   ` Duncan Sands
2004-09-08 22:53     ` Matt Mackall
2004-09-09  9:31       ` Duncan Sands
     [not found] <77423609@toto.iv>
2004-09-09  2:09 ` Peter Chubb

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=20040907235702.GC31237@waste.org \
    --to=mpm@selenic.com \
    --cc=baldrick@free.fr \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.