summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLu Qiuwen <[email protected]>2019-07-03 01:31:23 +0800
committerLu Qiuwen <[email protected]>2019-07-03 01:31:23 +0800
commitc498d300713af5c8077973193da83856fb327191 (patch)
treeb19c985e88c95e5a1e2665eec509ce79acd7d237
parentc0aa0c35568f72ebc36903484bec23af5f0c7a66 (diff)
修正tcprestore内存没有初始化的问题,修改启用判断窗口扩大选项的条件为客户端、服务器均需启用。v1.0.0-20190806
-rw-r--r--.gitignore1
-rw-r--r--core.c4
-rw-r--r--dkms.conf2
3 files changed, 3 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index a969912..fd16afe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,7 +49,6 @@
modules.order
Module.symvers
Mkfile.old
-dkms.conf
# compile_commands.json
compile_commands.json
diff --git a/core.c b/core.c
index 8ae9e69..6316c47 100644
--- a/core.c
+++ b/core.c
@@ -273,7 +273,7 @@ static int __tcp_restore_fd_create(struct net * netspace, const struct tcp_resto
nr_tcp_repair_opts++;
}
- if (endpoint->wscale_perm)
+ if (endpoint->wscale_perm && peer->wscale_perm)
{
tcp_repair_opts[nr_tcp_repair_opts].opt_code = TCPOPT_WINDOW;
tcp_repair_opts[nr_tcp_repair_opts].opt_val = (endpoint->wscale << 16 ) | peer->wscale;
@@ -583,7 +583,7 @@ int tfe_kernel_tcp_queue_outfn(struct nf_queue_entry *entry, unsigned int queuen
cmsg_payload = tcp_payload + cmsg_offset;
cmsg_payload_len = tcp_payload_len - cmsg_offset;
- restore_info = (struct tcp_restore_info *)kmalloc(sizeof(struct tcp_restore_info), GFP_ATOMIC);
+ restore_info = (struct tcp_restore_info *)kzalloc(sizeof(struct tcp_restore_info), GFP_ATOMIC);
if(unlikely(restore_info == NULL))
{
pr_err("Failed at alloc memory for restore info, drop it.\n");
diff --git a/dkms.conf b/dkms.conf
index a8a4e7a..c453f6b 100644
--- a/dkms.conf
+++ b/dkms.conf
@@ -1,5 +1,5 @@
PACKAGE_NAME="tfe-kmod"
-PACKAGE_VERSION="8d05746"
+PACKAGE_VERSION="c0aa0c3"
BUILT_MODULE_NAME[0]="tfe_kmod"
DEST_MODULE_LOCATION[0]="/kernel/extra/"
AUTOINSTALL="yes"