__u16 prot_id;
};
-static struct smb_protocol smb_protos[] = {
+static struct smb_protocol smb1_protos[] = {
{
SMB21_PROT,
"\2SMB 2.1",
"SMB2_22",
SMB2X_PROT_ID
},
+};
+
+static struct smb_protocol smb2_protos[] = {
+ {
+ SMB21_PROT,
+ "\2SMB 2.1",
+ "SMB2_10",
+ SMB21_PROT_ID
+ },
{
SMB30_PROT,
"\2SMB 3.0",
int ksmbd_lookup_protocol_idx(char *str)
{
- int offt = ARRAY_SIZE(smb_protos) - 1;
+ int offt = ARRAY_SIZE(smb1_protos) - 1;
int len = strlen(str);
while (offt >= 0) {
- if (!strncmp(str, smb_protos[offt].prot, len)) {
+ if (!strncmp(str, smb1_protos[offt].prot, len)) {
+ ksmbd_debug(SMB, "selected %s dialect idx = %d\n",
+ smb1_protos[offt].prot, offt);
+ return smb1_protos[offt].index;
+ }
+ offt--;
+ }
+
+ offt = ARRAY_SIZE(smb2_protos) - 1;
+ while (offt >= 0) {
+ if (!strncmp(str, smb2_protos[offt].prot, len)) {
ksmbd_debug(SMB, "selected %s dialect idx = %d\n",
- smb_protos[offt].prot, offt);
- return smb_protos[offt].index;
+ smb2_protos[offt].prot, offt);
+ return smb2_protos[offt].index;
}
offt--;
}
int i, seq_num, bcount, next;
char *dialect;
- for (i = ARRAY_SIZE(smb_protos) - 1; i >= 0; i--) {
+ for (i = ARRAY_SIZE(smb1_protos) - 1; i >= 0; i--) {
seq_num = 0;
next = 0;
dialect = cli_dialects;
dialect = next_dialect(dialect, &next);
ksmbd_debug(SMB, "client requested dialect %s\n",
dialect);
- if (!strcmp(dialect, smb_protos[i].name)) {
- if (supported_protocol(smb_protos[i].index)) {
+ if (!strcmp(dialect, smb1_protos[i].name)) {
+ if (supported_protocol(smb1_protos[i].index)) {
ksmbd_debug(SMB,
"selected %s dialect\n",
- smb_protos[i].name);
- if (smb_protos[i].index == SMB1_PROT)
+ smb1_protos[i].name);
+ if (smb1_protos[i].index == SMB1_PROT)
return seq_num;
- return smb_protos[i].prot_id;
+ return smb1_protos[i].prot_id;
}
}
seq_num++;
int i;
int count;
- for (i = ARRAY_SIZE(smb_protos) - 1; i >= 0; i--) {
+ for (i = ARRAY_SIZE(smb2_protos) - 1; i >= 0; i--) {
count = le16_to_cpu(dialects_count);
while (--count >= 0) {
ksmbd_debug(SMB, "client requested dialect 0x%x\n",
le16_to_cpu(cli_dialects[count]));
if (le16_to_cpu(cli_dialects[count]) !=
- smb_protos[i].prot_id)
+ smb2_protos[i].prot_id)
continue;
- if (supported_protocol(smb_protos[i].index)) {
+ if (supported_protocol(smb2_protos[i].index)) {
ksmbd_debug(SMB, "selected %s dialect\n",
- smb_protos[i].name);
- return smb_protos[i].prot_id;
+ smb2_protos[i].name);
+ return smb2_protos[i].prot_id;
}
}
}
return BAD_PROT_ID;
}
-int ksmbd_negotiate_smb_dialect(void *buf)
+static int ksmbd_negotiate_smb_dialect(void *buf)
{
__le32 proto;