Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Core
Tor
Commits
9fe1ed26
Commit
9fe1ed26
authored
21 years ago
by
Roger Dingledine
Browse files
Options
Downloads
Patches
Plain Diff
get network/host order working right again for socks4
svn:r476
parent
ed51df74
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/or/buffers.c
+3
-3
3 additions, 3 deletions
src/or/buffers.c
src/or/or.h
+1
-1
1 addition, 1 deletion
src/or/or.h
with
4 additions
and
4 deletions
src/or/buffers.c
+
3
−
3
View file @
9fe1ed26
...
...
@@ -281,8 +281,8 @@ int fetch_from_buf_socks(char *buf, int *buf_datalen,
/* an inlined socks4_unpack() */
socks4_info
.
version
=
*
buf
;
socks4_info
.
command
=
*
(
buf
+
1
);
socks4_info
.
destport
=
*
(
uint16_t
*
)(
buf
+
2
);
socks4_info
.
destip
=
*
(
uint32_t
*
)(
buf
+
4
);
socks4_info
.
destport
=
ntohs
(
*
(
uint16_t
*
)(
buf
+
2
)
)
;
socks4_info
.
destip
=
ntohl
(
*
(
uint32_t
*
)(
buf
+
4
)
)
;
if
(
socks4_info
.
version
!=
4
)
{
log_fn
(
LOG_NOTICE
,
"Unrecognized version %d."
,
socks4_info
.
version
);
...
...
@@ -294,7 +294,7 @@ int fetch_from_buf_socks(char *buf, int *buf_datalen,
return
-
1
;
}
port
=
ntohs
(
socks4_info
.
destport
)
;
port
=
socks4_info
.
destport
;
if
(
!
port
)
{
log_fn
(
LOG_NOTICE
,
"Port is zero."
);
return
-
1
;
...
...
This diff is collapsed.
Click to expand it.
src/or/or.h
+
1
−
1
View file @
9fe1ed26
...
...
@@ -219,7 +219,7 @@
typedef
struct
{
unsigned
char
version
;
/* socks version number */
unsigned
char
command
;
/* command code */
uint16_t
destport
;
/* destination port,
network
order */
uint16_t
destport
;
/* destination port,
host
order */
uint32_t
destip
;
/* destination address, host order */
/* userid follows, terminated by a \0 */
/* dest host follows, terminated by a \0 */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment