mirror of
https://github.com/opnsense/src.git
synced 2026-04-29 18:32:49 -04:00
Simpler version of the previous commit.
This commit is contained in:
parent
f97a705a99
commit
6c7faee24f
1 changed files with 2 additions and 5 deletions
|
|
@ -110,7 +110,6 @@ TcpChecksum(struct ip *pip)
|
|||
struct tcphdr *tc;
|
||||
int nhdr, ntcp, nbytes;
|
||||
int sum, oddbyte;
|
||||
void *v;
|
||||
|
||||
nhdr = pip->ip_hl << 2;
|
||||
ntcp = ntohs(pip->ip_len) - nhdr;
|
||||
|
|
@ -132,12 +131,10 @@ TcpChecksum(struct ip *pip)
|
|||
sum += oddbyte;
|
||||
}
|
||||
/* "Pseudo-header" data */
|
||||
v = &pip->ip_dst;
|
||||
ptr = v;
|
||||
ptr = (void *)&pip->ip_dst;
|
||||
sum += *ptr++;
|
||||
sum += *ptr;
|
||||
v = &pip->ip_src;
|
||||
ptr = v;
|
||||
ptr = (void *)&pip->ip_src;
|
||||
sum += *ptr++;
|
||||
sum += *ptr;
|
||||
sum += htons((u_short) ntcp);
|
||||
|
|
|
|||
Loading…
Reference in a new issue