mount_smbfs

John-Mark Gurney jmg at funkthat.com
Fri Jan 23 21:40:31 UTC 2015


Daisuke Aoyama wrote this message on Sat, Jan 24, 2015 at 06:28 +0900:
> Thank you for a comment.
> I didn't think about endian functions.
> 
> >Please use {l,b}e16dec, or if the code is suppose to be native endian,
> >make it dependant on __NO_STRICT_ALIGNMENT and add the proper endian
> >swap, not __arm__ as there are other arches that require the same fix...
> 
> I make a patch again for supporting BE CPU.
> 
> man page don't mention about strict alignment, if le16enc is not using byte access,
> you need expand it like this:

le16enc is documented to work any alignment... from byteorder(9):
     The be16enc(), be16dec(), be32enc(), be32dec(), be64enc(), be64dec(),
     le16enc(), le16dec(), le32enc(), le32dec(), le64enc(), and le64dec()
     functions encode and decode integers to/from byte strings on any
								  ^^^
     alignment in big/little endian format.
     ^^^^^^^^^

> 
> +                       le16enc(cp, le16toh(NBENCODE(toupper(*name))));
> vvvvvv
> +                       *(cp + 0) = le16toh(NBENCODE(toupper(*name))) & 0xffU;
> +                       *(cp + 1) = (le16toh(NBENCODE(toupper(*name))) >> 8) & 0xffU;

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-arm mailing list