Bug#623634: libnet-rawip-perl: miscalculates header checksums

Niko Tyni ntyni at debian.org
Mon Mar 31 19:54:57 UTC 2014


tag  623634 patch
thanks

On Mon, Mar 31, 2014 at 08:34:03PM +0200, gregor herrmann wrote:
> On Wed, 26 Mar 2014 09:07:40 +0100, Christoph Pleger wrote:
> 
> > On my search in the web, if there was already some solution for 'my'
> > libnet-rawip-perl problem, I found two patches; these are attached. The
> > patch Net-RawIP-0.23-format.patch (from Redhat/Fedora) removes that format
> > problem; the patch nonreturn-in-nonvoid.patch (from OpenSuse) adds a
> > missing default:-part in a switch-statement.

> > Additionally, I attached a patch cc.patch for setting gcc-4.6 as compiler.
> > Of course, gcc-4.6 must be added to Build-Depends.
> 
> I don't think that's the correct way to solve this issue; first it
> only papers over the problem, and second I don't think we'll have
> gcc-4.6 in Debian for much longer.

The problem is ip_in_cksum() in util.c, which starts with

    register long sum = 0;  /* assumes long == 32 bits */

That assumption isn't correct on 64-bit architectures and apparently
breaks with newer gcc versions at -O2 (-O0 still works OK.)

Minimal patch attached, but there may well be other similar problems
lurking. I wonder how well this module works on big endian (particularly
64 bit big endian!) systems.
-- 
Niko Tyni   ntyni at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Use-the-U32-type-instead-of-long-to-fix-problems-on-.patch
Type: text/x-diff
Size: 1067 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20140331/8fefe5e0/attachment-0001.patch>


More information about the pkg-perl-maintainers mailing list