Skip to content

Commit 4e2ee32

Browse files
palismfrench
authored andcommitted
cifs: Fix endian types in struct rfc1002_session_packet
All fields in struct rfc1002_session_packet are in big endian. This is because all NetBIOS packet headers are in big endian as opposite of SMB structures which are in little endian. Therefore use __be16 and __be32 types instead of __u16 and __u32 in struct rfc1002_session_packet. Reported-by: kernel test robot <[email protected]> Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 015683d commit 4e2ee32

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/smb/client/rfc1002pdu.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
struct rfc1002_session_packet {
2525
__u8 type;
2626
__u8 flags;
27-
__u16 length;
27+
__be16 length;
2828
union {
2929
struct {
3030
__u8 called_len;
@@ -35,8 +35,8 @@ struct rfc1002_session_packet {
3535
__u8 scope2; /* null */
3636
} __attribute__((packed)) session_req;
3737
struct {
38-
__u32 retarget_ip_addr;
39-
__u16 port;
38+
__be32 retarget_ip_addr;
39+
__be16 port;
4040
} __attribute__((packed)) retarget_resp;
4141
__u8 neg_ses_resp_error_code;
4242
/* POSITIVE_SESSION_RESPONSE packet does not include trailer.

0 commit comments

Comments
 (0)