Page MenuHomeFreeBSD

D37300.id112804.diff
No OneTemporary

D37300.id112804.diff

diff --git a/sys/netinet/libalias/alias_ftp.c b/sys/netinet/libalias/alias_ftp.c
--- a/sys/netinet/libalias/alias_ftp.c
+++ b/sys/netinet/libalias/alias_ftp.c
@@ -754,7 +754,7 @@
/* Compute TCP checksum for revised packet */
tc->th_sum = 0;
#ifdef _KERNEL
- tc->th_x2 = 1;
+ tc->th_x2 = (TH_RES1 >> 8);
#else
tc->th_sum = TcpChecksum(pip);
#endif
diff --git a/sys/netinet/libalias/alias_irc.c b/sys/netinet/libalias/alias_irc.c
--- a/sys/netinet/libalias/alias_irc.c
+++ b/sys/netinet/libalias/alias_irc.c
@@ -458,7 +458,7 @@
/* Compute TCP checksum for revised packet */
tc->th_sum = 0;
#ifdef _KERNEL
- tc->th_x2 = 1;
+ tc->th_x2 = (TH_RES1 >> 8);
#else
tc->th_sum = TcpChecksum(pip);
#endif
diff --git a/sys/netinet/libalias/alias_proxy.c b/sys/netinet/libalias/alias_proxy.c
--- a/sys/netinet/libalias/alias_proxy.c
+++ b/sys/netinet/libalias/alias_proxy.c
@@ -368,7 +368,7 @@
tc->th_sum = 0;
#ifdef _KERNEL
- tc->th_x2 = 1;
+ tc->th_x2 = (TH_RES1 >> 8);
#else
tc->th_sum = TcpChecksum(pip);
#endif
diff --git a/sys/netinet/libalias/alias_skinny.c b/sys/netinet/libalias/alias_skinny.c
--- a/sys/netinet/libalias/alias_skinny.c
+++ b/sys/netinet/libalias/alias_skinny.c
@@ -216,7 +216,7 @@
tc->th_sum = 0;
#ifdef _KERNEL
- tc->th_x2 = 1;
+ tc->th_x2 = (TH_RES1 >> 8);
#else
tc->th_sum = TcpChecksum(pip);
#endif
@@ -259,7 +259,7 @@
tc->th_sum = 0;
#ifdef _KERNEL
- tc->th_x2 = 1;
+ tc->th_x2 = (TH_RES1 >> 8);
#else
tc->th_sum = TcpChecksum(pip);
#endif
@@ -289,7 +289,7 @@
tc->th_sum = 0;
#ifdef _KERNEL
- tc->th_x2 = 1;
+ tc->th_x2 = (TH_RES1 >> 8);
#else
tc->th_sum = TcpChecksum(pip);
#endif
diff --git a/sys/netinet/libalias/alias_smedia.c b/sys/netinet/libalias/alias_smedia.c
--- a/sys/netinet/libalias/alias_smedia.c
+++ b/sys/netinet/libalias/alias_smedia.c
@@ -404,7 +404,7 @@
tc->th_sum = 0;
#ifdef _KERNEL
- tc->th_x2 = 1;
+ tc->th_x2 = (TH_RES1 >> 8);
#else
tc->th_sum = TcpChecksum(pip);
#endif
@@ -451,7 +451,7 @@
/* Compute TCP checksum for revised packet */
tc->th_sum = 0;
#ifdef _KERNEL
- tc->th_x2 = 1;
+ tc->th_x2 = (TH_RES1 >> 8);
#else
tc->th_sum = TcpChecksum(pip);
#endif
diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h
--- a/sys/netinet/tcp.h
+++ b/sys/netinet/tcp.h
@@ -72,6 +72,9 @@
#define TH_ECE 0x40
#define TH_CWR 0x80
#define TH_AE 0x100 /* maps into th_x2 */
+#define TH_RES3 0x200
+#define TH_RES2 0x400
+#define TH_RES1 0x800
#define TH_FLAGS (TH_FIN|TH_SYN|TH_RST|TH_PUSH|TH_ACK|TH_URG|TH_ECE|TH_CWR)
#define PRINT_TH_FLAGS "\20\1FIN\2SYN\3RST\4PUSH\5ACK\6URG\7ECE\10CWR\11AE"
diff --git a/sys/netpfil/ipfw/ip_fw_nat.c b/sys/netpfil/ipfw/ip_fw_nat.c
--- a/sys/netpfil/ipfw/ip_fw_nat.c
+++ b/sys/netpfil/ipfw/ip_fw_nat.c
@@ -418,7 +418,7 @@
struct tcphdr *th;
th = (struct tcphdr *)(ip + 1);
- if (th->th_x2)
+ if (th->th_x2 & (TH_RES1 >> 8))
ldt = 1;
}
@@ -438,7 +438,7 @@
* Maybe it was set in
* libalias...
*/
- th->th_x2 = 0;
+ th->th_x2 &= ~(TH_RES1 >> 8);
th->th_sum = cksum;
mcl->m_pkthdr.csum_data =
offsetof(struct tcphdr, th_sum);

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 23, 9:43 PM (16 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32046236
Default Alt Text
D37300.id112804.diff (3 KB)

Event Timeline