diff options
author | Steve French <sfrench@us.ibm.com> | 2005-10-27 16:55:12 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-10-27 16:55:12 -0400 |
commit | 0753ca7bc2b876dd136e9db11a20f85cbe4e08b1 (patch) | |
tree | 9fca686e1ca5886342232fe16292bae675a1004f /fs/cifs/rfc1002pdu.h | |
parent | 04290949b3daef35d6279dcc05f01b549ac1772b (diff) |
[CIFS] Change pragma pack(1) to attribute(packed) to allow cifs on arm to access
unaligned structures coming in off the wire
gcc on arm processors generates very odd code with pragma pack specified -
although it does pack the structures in some sense - it does not allow you
to access unaligned elements in nested structures at the right offset as other
architectures do. Oddly enough though, specifying the structures as packed
the long way - one by one with the packed attribute does work. Rather than
fighting over whether this is a gcc bug or some obscure side effect
of pragma pack, it is easier to do what most (all but 96 other places in
the kernel) do - and replace pragma pack with dozens of attribute(packed)
structure qualifiers. Much more verbose ... but at least it works.
Signed-off-by: David Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com> CG: -----------------------------------------------------------------------
Diffstat (limited to 'fs/cifs/rfc1002pdu.h')
-rw-r--r-- | fs/cifs/rfc1002pdu.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/cifs/rfc1002pdu.h b/fs/cifs/rfc1002pdu.h index 806c0ed06da9..9222033cad8e 100644 --- a/fs/cifs/rfc1002pdu.h +++ b/fs/cifs/rfc1002pdu.h | |||
@@ -21,8 +21,6 @@ | |||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #pragma pack(1) | ||
25 | |||
26 | /* NB: unlike smb/cifs packets, the RFC1002 structures are big endian */ | 24 | /* NB: unlike smb/cifs packets, the RFC1002 structures are big endian */ |
27 | 25 | ||
28 | /* RFC 1002 session packet types */ | 26 | /* RFC 1002 session packet types */ |
@@ -48,17 +46,17 @@ struct rfc1002_session_packet { | |||
48 | __u8 calling_len; | 46 | __u8 calling_len; |
49 | __u8 calling_name[32]; | 47 | __u8 calling_name[32]; |
50 | __u8 scope2; /* null */ | 48 | __u8 scope2; /* null */ |
51 | } session_req; | 49 | } __attribute__((packed)) session_req; |
52 | struct { | 50 | struct { |
53 | __u32 retarget_ip_addr; | 51 | __u32 retarget_ip_addr; |
54 | __u16 port; | 52 | __u16 port; |
55 | } retarget_resp; | 53 | } __attribute__((packed)) retarget_resp; |
56 | __u8 neg_ses_resp_error_code; | 54 | __u8 neg_ses_resp_error_code; |
57 | /* POSITIVE_SESSION_RESPONSE packet does not include trailer. | 55 | /* POSITIVE_SESSION_RESPONSE packet does not include trailer. |
58 | SESSION_KEEP_ALIVE packet also does not include a trailer. | 56 | SESSION_KEEP_ALIVE packet also does not include a trailer. |
59 | Trailer for the SESSION_MESSAGE packet is SMB/CIFS header */ | 57 | Trailer for the SESSION_MESSAGE packet is SMB/CIFS header */ |
60 | } trailer; | 58 | } __attribute__((packed)) trailer; |
61 | }; | 59 | } __attribute__((packed)); |
62 | 60 | ||
63 | /* Negative Session Response error codes */ | 61 | /* Negative Session Response error codes */ |
64 | #define RFC1002_NOT_LISTENING_CALLED 0x80 /* not listening on called name */ | 62 | #define RFC1002_NOT_LISTENING_CALLED 0x80 /* not listening on called name */ |
@@ -74,6 +72,3 @@ server netbios name). Currently server names are resolved only via DNS | |||
74 | (tcp name) or ip address or an /etc/hosts equivalent mapping to ip address.*/ | 72 | (tcp name) or ip address or an /etc/hosts equivalent mapping to ip address.*/ |
75 | 73 | ||
76 | #define DEFAULT_CIFS_CALLED_NAME "*SMBSERVER " | 74 | #define DEFAULT_CIFS_CALLED_NAME "*SMBSERVER " |
77 | |||
78 | #pragma pack() /* resume default structure packing */ | ||
79 | |||