diff options
Diffstat (limited to 'fs/cifs/netmisc.c')
-rw-r--r-- | fs/cifs/netmisc.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c index a92af41d4411..f7814689844b 100644 --- a/fs/cifs/netmisc.c +++ b/fs/cifs/netmisc.c | |||
@@ -133,7 +133,6 @@ static const struct smb_to_posix_error mapping_table_ERRHRD[] = { | |||
133 | int | 133 | int |
134 | cifs_inet_pton(int address_family, char *cp,void *dst) | 134 | cifs_inet_pton(int address_family, char *cp,void *dst) |
135 | { | 135 | { |
136 | struct in_addr address; | ||
137 | int value; | 136 | int value; |
138 | int digit; | 137 | int digit; |
139 | int i; | 138 | int i; |
@@ -190,8 +189,7 @@ cifs_inet_pton(int address_family, char *cp,void *dst) | |||
190 | if (value > addr_class_max[end - bytes]) | 189 | if (value > addr_class_max[end - bytes]) |
191 | return 0; | 190 | return 0; |
192 | 191 | ||
193 | address.s_addr = *((__be32 *) bytes) | htonl(value); | 192 | *((__be32 *)dst) = *((__be32 *) bytes) | htonl(value); |
194 | *((__be32 *)dst) = address.s_addr; | ||
195 | return 1; /* success */ | 193 | return 1; /* success */ |
196 | } | 194 | } |
197 | 195 | ||
@@ -815,7 +813,7 @@ map_smb_to_linux_error(struct smb_hdr *smb) | |||
815 | if (smb->Flags2 & SMBFLG2_ERR_STATUS) { | 813 | if (smb->Flags2 & SMBFLG2_ERR_STATUS) { |
816 | /* translate the newer STATUS codes to old style errors and then to POSIX errors */ | 814 | /* translate the newer STATUS codes to old style errors and then to POSIX errors */ |
817 | __u32 err = le32_to_cpu(smb->Status.CifsError); | 815 | __u32 err = le32_to_cpu(smb->Status.CifsError); |
818 | if(cifsFYI) | 816 | if(cifsFYI & CIFS_RC) |
819 | cifs_print_status(err); | 817 | cifs_print_status(err); |
820 | ntstatus_to_dos(err, &smberrclass, &smberrcode); | 818 | ntstatus_to_dos(err, &smberrclass, &smberrcode); |
821 | } else { | 819 | } else { |
@@ -870,7 +868,14 @@ unsigned int | |||
870 | smbCalcSize(struct smb_hdr *ptr) | 868 | smbCalcSize(struct smb_hdr *ptr) |
871 | { | 869 | { |
872 | return (sizeof (struct smb_hdr) + (2 * ptr->WordCount) + | 870 | return (sizeof (struct smb_hdr) + (2 * ptr->WordCount) + |
873 | BCC(ptr)); | 871 | 2 /* size of the bcc field */ + BCC(ptr)); |
872 | } | ||
873 | |||
874 | unsigned int | ||
875 | smbCalcSize_LE(struct smb_hdr *ptr) | ||
876 | { | ||
877 | return (sizeof (struct smb_hdr) + (2 * ptr->WordCount) + | ||
878 | 2 /* size of the bcc field */ + le16_to_cpu(BCC_LE(ptr))); | ||
874 | } | 879 | } |
875 | 880 | ||
876 | /* The following are taken from fs/ntfs/util.c */ | 881 | /* The following are taken from fs/ntfs/util.c */ |