tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: dkwedge: checksum before swapping?



mouse%Rodents-Montreal.ORG@localhost (Mouse) writes:

>But that comment clearly indicates that _someone_ thought it
>reasonable to checksum before swapping, so I can't help wondering what
>use case that's appropriate for.

It's a checksum over the 16bit words in native byte order. So when
you access the words in opposite byte order, you need to swap the
checksum too.

Unlike the regular disklabel code (which ignores other-endian disklabels)
the wedge autodiscover code will accept either.

As for padding, the structure is nowadays defined with fixed size types
and explicit padding fields, so we may still assume that the compiler
won't add any further padding by itself.



Home | Main Index | Thread Index | Old Index