Endianess problem in linux/*

Bug #23010 reported by Laurent Bigonville
12
Affects Status Importance Assigned to Milestone
iproute (Ubuntu)
Fix Released
High
Martin Pitt
linux-source-2.6.20 (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Hi,

Under breezy if I try to create a sit tunnel I get "ioctl: Invalid argument".
There was no problem under hoary.

Revision history for this message
Laurent Bigonville (bigon) wrote :

the command I use is "ip tunnel add sixxs mode sit"

Revision history for this message
Guillaume Desmottes (cassidy) wrote :

Have no error on i386

Revision history for this message
Matt Zimmerman (mdz) wrote :

Works fine here as well. Run it under strace and attach the output.

Revision history for this message
Laurent Bigonville (bigon) wrote :

Created an attachment (id=4363)
strace

here the strace output

Revision history for this message
Laurent Bigonville (bigon) wrote :

I have to mention that I am under powerpc

Revision history for this message
Matt Zimmerman (mdz) wrote :

Does anything appear in dmesg when this happens?

Revision history for this message
Laurent Bigonville (bigon) wrote :

(In reply to comment #6)
> Does anything appear in dmesg when this happens?

nope

Revision history for this message
Laurent Bigonville (bigon) wrote :

In fact there is the same problem with gre and ipip tunnels

Revision history for this message
Laurent Bigonville (bigon) wrote :

If I install the hoary version of iproute (20041019-1) no more problem...

Revision history for this message
Laurent Bigonville (bigon) wrote :

Same problem with the dapper version(20041019-4ubuntu1)...

Could someone confirm this bug, this is a functionality loss on ppc

Revision history for this message
Laurent Bigonville (bigon) wrote :

It's very very strange....

1°I take the binary package for powerpc on the debian archive
(version:20041019-3) and install it, "ip tunnel add plop mode sit" makes no error
2°I download the source on debian (same version)
3°I recompile the source with a pbuilder chroot
4°I try the same command with the newly compiled version... it fails

gni?

Revision history for this message
Laurent Bigonville (bigon) wrote :

I create a chroot with debootstrap (debian etch) and recompile the ubuntu
package in it.... Everything works...

Revision history for this message
Laurent Bigonville (bigon) wrote :

The problem still present in flight cd2
The problem is maybe in kernel hearders

Revision history for this message
Paul Sladen (sladen) wrote :

Hello Laurent, this this still happening with latest Dapper on ppc?

Revision history for this message
Laurent Bigonville (bigon) wrote :

yes, the problem still happening with my up-to-date dapper

Matt Zimmerman (mdz)
Changed in iproute:
assignee: nobody → pitti
Revision history for this message
Laurent Bigonville (bigon) wrote :

It's an endianess problem...

The struct 'iphdr' is defined in /usr/include/linux/ip.h. In this struct there is a check for the endianess of the machine. The problem is with de definition of __LITTLE_ENDIAN and __BIG_ENDIAN, both are defined!!!!!!

Revision history for this message
Laurent Bigonville (bigon) wrote :

Found the problem..

__LITTLE_ENDIAN and __BIG_ENDIAN are always defined...

The test must use _LITTLE_ENDIAN and _BIG_ENDIAN only one underscore.

Changed in linux-kernel-headers:
status: Unconfirmed → Confirmed
Revision history for this message
Laurent Bigonville (bigon) wrote : The patch

The patch only remove an underscore.. Upstream makes this differently but this doesn't seem to work with this version of the headers

Revision history for this message
Laurent Bigonville (bigon) wrote : Re: Endianess problem in linux/ip.h

Close this bug for iproute but it needs to be recompiled

Changed in iproute:
status: Unconfirmed → Rejected
Revision history for this message
Laurent Bigonville (bigon) wrote :

The problem is not limited to the linux/ip.h header... A lot of other header files are concerned

Revision history for this message
Laurent Bigonville (bigon) wrote : patch 2

This new patch changes the other files that are concerned with this problem.

Revision history for this message
Laurent Bigonville (bigon) wrote : patch 3

I just have a look upstream and at debian's package and I don't understand why you've changed all the __BIG_ENDIAN_BITFIELD and __LITTLE_ENDIAN_BITFIELD

Revision history for this message
Martin Pitt (pitti) wrote :

Reopening iproute task, it needs to be rebuilt against a fixed l-k-h

Changed in iproute:
status: Rejected → Confirmed
Revision history for this message
Matt Zimmerman (mdz) wrote :

Has l-k-h been fixed? Is anyone working on it?

Revision history for this message
Jeff Bailey (jbailey) wrote :

Patch1 tested and uploaded to lkh. Given that these headers have been in use for over a year, I'm not comfortable blindly applying the changes to the rest.

I'll leave the bug open, however, to make sure that I write tests for those other things.

Revision history for this message
Jeff Bailey (jbailey) wrote :

Important fix for 6.06-LTS uploaded, retargetting for after that with normal severity for remainder of fixes.

Jeff Bailey (jbailey)
Changed in iproute:
status: Confirmed → Fix Released
Revision history for this message
Laurent Bigonville (bigon) wrote :

lkh has been updated in edgy (version 2.6.17), almost everything seems to be ok now.

The patch corrects the last thing that could be a problem.

Revision history for this message
Laurent Bigonville (bigon) wrote :

oups

Revision history for this message
Martin Pitt (pitti) wrote :

linux-kernel-headers are now built from the main linux source, reassigning. The patch still applies, but I leave the judging to the kernel team.

Changed in linux-kernel-headers:
assignee: jbailey → nobody
Changed in linux-source-2.6.20:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.