NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: port-arm/46898: t_nat_ipf_exec
The following reply was made to PR port-arm/46898; it has been noted by GNATS.
From: Masanobu SAITOH <msaitoh%execsw.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: Masanobu SAITOH <msaitoh%execsw.org@localhost>,
port-arm-maintainer%netbsd.org@localhost,
gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Subject: Re: port-arm/46898: t_nat_ipf_exec
Date: Wed, 05 Sep 2012 09:11:07 +0900
test program:
=============================================================
#include <stdio.h>
#include <stdint.h>
#include <arpa/inet.h>
uint32_t wrapsum(uint32_t);
int sum = 0x00000102;
uint32_t
wrapsum(uint32_t sum)
{
sum = ~sum & 0xFFFF;
return htons(sum);
}
int
main(int argc, char *argv[])
{
uint32_t wsum = wrapsum(sum);
printf("0x%08x\n", wsum);
return 0;
}
=============================================================
On i386:
> % gcc -O2 pkt.c -o pkt
> % ./pkt
> 0x0000fdfe
On arm:
> $ gcc -O2 pkt.c -o pkt
> $ ./pkt
> 0x0000ffff
--
-----------------------------------------------
SAITOH Masanobu (msaitoh%execsw.org@localhost
msaitoh%netbsd.org@localhost)
Home |
Main Index |
Thread Index |
Old Index