acozzette / BUSE

A block device in user space for Linux
GNU General Public License v2.0
240 stars 47 forks source link

user operations errors should be properly converted to network byte order #5

Open rutsky opened 8 years ago

rutsky commented 8 years ago

Currently all errors are set like this:

reply.error = aop->write(chunk, len, from, userdata);

which requires to use ntohl inside user buse_operations.

I suggest to handle byte order on BUSE side, e.g.:

reply.error = htonl(aop->write(chunk, len, from, userdata));
CaesarJeries commented 5 years ago

I have a question: Doesn't the order of received byte sent after a write request need to be reversed as well ? If not, why?