Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
54aaf1b9
Commit
54aaf1b9
authored
Apr 22, 2004
by
Steve French
Browse files
Options
Browse Files
Download
Plain Diff
resolve merge conflict
parents
388f8f38
6ec01455
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
7 deletions
+86
-7
fs/cifs/connect.c
fs/cifs/connect.c
+11
-7
fs/cifs/rfc1002pdu.h
fs/cifs/rfc1002pdu.h
+75
-0
No files found.
fs/cifs/connect.c
View file @
54aaf1b9
/*
* fs/cifs/connect.c
*
* Copyright (C) International Business Machines Corp., 2002,200
3
* Copyright (C) International Business Machines Corp., 2002,200
4
* Author(s): Steve French (sfrench@us.ibm.com)
*
* This library is free software; you can redistribute it and/or modify
...
...
@@ -36,6 +36,7 @@
#include "cifs_fs_sb.h"
#include "ntlmssp.h"
#include "nterr.h"
#include "rfc1002pdu.h"
#define CIFS_PORT 445
#define RFC1001_PORT 139
...
...
@@ -251,13 +252,17 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
temp
=
(
char
*
)
smb_buffer
;
if
(
length
>
3
)
{
if
(
temp
[
0
]
==
(
char
)
0x85
)
{
if
(
temp
[
0
]
==
(
char
)
RFC1002_SESSION_KEEP_ALIVE
)
{
iov
.
iov_base
=
smb_buffer
;
iov
.
iov_len
=
4
;
length
=
sock_recvmsg
(
csocket
,
&
smb_msg
,
4
,
0
);
cFYI
(
0
,
(
"Received 4 byte keep alive packet "
));
}
else
if
((
temp
[
0
]
==
(
char
)
0x83
)
cFYI
(
0
,(
"Received 4 byte keep alive packet"
));
}
else
if
(
temp
[
0
]
==
(
char
)
RFC1002_POSITIVE_SESSION_RESPONSE
)
{
iov
.
iov_base
=
smb_buffer
;
iov
.
iov_len
=
4
;
length
=
sock_recvmsg
(
csocket
,
&
smb_msg
,
4
,
0
);
cFYI
(
1
,(
"Good RFC 1002 session rsp"
));
}
else
if
((
temp
[
0
]
==
(
char
)
RFC1002_NEGATIVE_SESSION_RESPONSE
)
&&
(
length
==
5
))
{
/* we get this from Windows 98 instead of error on SMB negprot response */
cFYI
(
1
,(
"Negative RFC 1002 Session Response Error 0x%x)"
,
temp
[
4
]));
...
...
@@ -285,8 +290,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
continue
;
}
}
else
if
(
temp
[
0
]
!=
(
char
)
0
)
{
cERROR
(
1
,
(
"Unknown RFC 1001 frame not 0x00 nor 0x85"
));
cERROR
(
1
,(
"Unknown RFC 1002 frame"
));
cifs_dump_mem
(
" Received Data: "
,
temp
,
length
);
cifs_reconnect
(
server
);
csocket
=
server
->
ssocket
;
...
...
fs/cifs/rfc1002pdu.h
0 → 100644
View file @
54aaf1b9
/*
* fs/cifs/rfc1002pdu.h
*
* Protocol Data Unit definitions for RFC 1001/1002 support
*
* Copyright (c) International Business Machines Corp., 2004
* Author(s): Steve French (sfrench@us.ibm.com)
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#pragma pack(1)
/* NB: unlike smb/cifs packets, the RFC1002 structures are big endian */
/* RFC 1002 session packet types */
#define RFC1002_SESSION_MESASAGE 0x00
#define RFC1002_SESSION_REQUEST 0x81
#define RFC1002_POSITIVE_SESSION_RESPONSE 0x82
#define RFC1002_NEGATIVE_SESSION_RESPONSE 0x83
#define RFC1002_RETARGET_SESSION_RESPONSE 0x83
#define RFC1002_SESSION_KEEP_ALIVE 0x85
/* RFC 1002 flags (only one defined */
#define RFC1002_LENGTH_EXTEND 0x80
/* high order bit of length (ie +64K) */
struct
rfc1002_session_packet
{
__u8
type
;
__u8
flags
;
__u16
length
;
union
{
struct
{
__u8
called_name
[
16
];
__u8
calling_name
[
16
];
}
session_req
;
struct
{
__u32
retarget_ip_addr
;
__u16
port
;
}
retarget_resp
;
__u8
neg_ses_resp_error_code
;
/* POSITIVE_SESSION_RESPONSE packet does not include trailer.
SESSION_KEEP_ALIVE packet also does not include a trailer.
Trailer for the SESSION_MESSAGE packet is SMB/CIFS header */
}
trailer
;
};
/* Negative Session Response error codes */
#define RFC1002_NOT_LISTENING_CALLED 0x80
/* not listening on called name */
#define RFC1002_NOT_LISTENING_CALLING 0x81
/* not listening on calling name */
#define RFC1002_NOT_PRESENT 0x82
/* called name not present */
#define RFC1002_INSUFFICIENT_RESOURCE 0x83
#define RFC1002_UNSPECIFIED_ERROR 0x8F
/* RFC 1002 Datagram service packets are not defined here as they
are not needed for the network filesystem client unless we plan on
implementing broadcast resolution of the server ip address (from
server netbios name). Currently server names are resolved only via DNS
(tcp name) or ip address or an /etc/hosts equivalent mapping to ip address.*/
#define DEFAULT_CIFS_CALLED_NAME "*SMBSERVER "
#pragma pack()
/* resume default structure packing */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment