Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
G
gdut-drcom
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
gdut-drcom
Commits
dd4534ca
Commit
dd4534ca
authored
Nov 06, 2016
by
chenhaowen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed up kepp alive 2 packet's checksum
parent
68eeee50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
src/auth.c
src/auth.c
+10
-3
No files found.
src/auth.c
View file @
dd4534ca
...
...
@@ -5,7 +5,7 @@
#ifdef WIN32
#include <winsock2.h>
//#define SOCKET int
#else
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
...
...
@@ -524,15 +524,22 @@ int make_keep_alive2_pkt2(char *buf, unsigned char cnt, char *flag,\
memset
(
buf
+
index
,
0
,
4
);
index
+=
4
;
gen_ka2_checksum
(
buf
,
index
,
buf
+
index
);
//checksum
int
checksum_p
=
index
;
memset
(
buf
+
index
,
0
,
4
);
index
+=
4
;
// gen_ka2_checksum(buf, index, buf+index);
// index += 4;
memcpy
(
buf
+
index
,
host_ip
,
4
);
index
+=
4
;
memset
(
buf
+
index
,
0
,
8
);
index
+=
8
;
gen_ka2_checksum
(
buf
,
index
,
buf
+
checksum_p
);
return
index
;
}
...
...
@@ -547,6 +554,6 @@ void gen_ka2_checksum(char *data, int len, char *checksum)
}
checksum_tmp
&=
0xffff
;
checksum_tmp
*=
0x2c7
;
memcpy
(
checksum
,
(
char
*
)
&
checksum
,
4
);
memcpy
(
checksum
,
(
char
*
)
&
checksum
_tmp
,
4
);
}
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