cifs: clarify SMB1 code for UnixCreateHardLink
[sfrench/cifs-2.6.git] / fs / cifs / cifssmb.c
index 58ebec4d44138d47643d72a2c0c2ff38d50eca51..ea12fa6eacb67925e992cf991ce6331a8175f82d 100644 (file)
@@ -3009,7 +3009,8 @@ createHardLinkRetry:
                                InformationLevel) - 4;
        offset = param_offset + params;
 
-       data_offset = (char *) (&pSMB->hdr.Protocol) + offset;
+       /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */
+       data_offset = (char *)pSMB + offset + 4;
        if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
                name_len_target =
                    cifsConvertToUTF16((__le16 *) data_offset, fromName,