[PATCH] nbd: endian annotations



Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
---

include/linux/nbd.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -75,15 +75,15 @@ struct nbd_device {
/*
* This is the packet used for communication between client and
* server. All data are in network byte order.
*/
struct nbd_request {
- u32 magic;
- u32 type; /* == READ || == WRITE */
+ __be32 magic;
+ __be32 type; /* == READ || == WRITE */
char handle[8];
- u64 from;
- u32 len;
+ __be64 from;
+ __be32 len;
}
#ifdef __GNUC__
__attribute__ ((packed))
#endif
;
@@ -91,10 +91,10 @@ struct nbd_request {
/*
* This is the reply packet that nbd-server sends back to the client after
* it has completed an I/O request (or an error occurs).
*/
struct nbd_reply {
- u32 magic;
- u32 error; /* 0 = ok, else error */
+ __be32 magic;
+ __be32 error; /* 0 = ok, else error */
char handle[8]; /* handle you got from request */
};
#endif

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Recvfrom() not returning
    ... When I call recvfromfor a UDP multicast client it runs fine on ... Windows XP, but does not return on Fedora Core 6. ... struct in_addr mcastAddr; ...
    (comp.unix.programmer)
  • Re: how to store list of varying types
    ... represent that with those in the struct definitions? ... pointer null, and the second one the CString object. ... then have to finish constructing the packet by copying the two data objects ... start with an upper-case letter (so, I would use DataElement ...
    (microsoft.public.vc.mfc)
  • Re: how to store list of varying types
    ... When there's a variable-length string, ... typedef struct { ... pointer null, and the second one the CString object. ... then have to finish constructing the packet by copying the two data objects ...
    (microsoft.public.vc.mfc)
  • [PATCH 06/19] ieee1394: coding style and comment fixes in midlayer header files
    ... struct hpsb_host *host; ... * a small, physically contiguous DMA buffer with random-access, synchronous ... quadlet of the incoming packet (containing transaction label, retry code, ... into a user-space process for zero-copy transmission and reception. ...
    (Linux-Kernel)
  • [REVS] Backdoor Spotcom Analysis
    ... Spotcom is a backdoor client application that allows a hacker to control ... The server IP address is hard-coded in ... msrsvp.exe accepts a couple of command line arguments. ... the packet payload. ...
    (Securiteam)