Re: Network alignment and endianness

Greg Troxel <[email protected]> Wed, 09 Nov 2016 08:57:32 -0500
Newsgroups gmane.os.netbsd.ports.evbmips,gmane.os.netbsd.ports.arm
Message-ID <[email protected]>
--=-=-=
Content-Type: text/plain


John Klos <[email protected]> writes:

> On evbmips64-eb, -current from two days ago on an EdgeRouter Lite,
> trying to ping6 the other side of a gif interface:
>
> panic: kernel diagnostic assertion "IP6_HDR_ALIGNED_P(icmp6)" failed:
> file "/usr/current/src/sys/netinet6/icmp6.c", line 485
> cpu0: Begin traceback...
> pid 268450496 not found
> cpu0: End traceback...
>
> dumping to dev 8,1 offset 1048575
> dump i/o error
>
> rebooting...
>
> This looks to be the same as this:
>
> http://mail-index.netbsd.org/port-arm/2016/10/02/msg003925.html
>
> So... What's the deal with big endian systems and alignment? Any ideas?

I'm not sure it's big endian vs stricter alignment.  Long ago, I ran
into issues where a data structure in a packet would be aligned right
(e.g. 4 byte value with two zero bits in the address) sometimes, but
sometimes, either because of some dma setup with ethernet header on some
interface, or via some encap, would end up 2 bytes off.

I think the big issue is to figure out where code should be
assuming/checking alignment, and where it should be assuming it.

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlgjK0wACgkQH9p66AmO1g69pgCeKazx80vmLhtPkniQVrBidOzm
5r4An1WLVzyJ2zIia28r82dR51Zjdqgv
=Ihkv
-----END PGP SIGNATURE-----
--=-=-=--