try fix crash issue

This commit is contained in:
chn
2019-10-20 01:40:23 +08:00
parent 78c3a1208a
commit 027b500900
4 changed files with 11 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=xmurp-ua PKG_NAME:=xmurp-ua
PKG_RELEASE:=30 PKG_RELEASE:=31
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk

View File

@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=xmurp-ua PKG_NAME:=xmurp-ua
PKG_RELEASE:=30 PKG_RELEASE:=31
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk

View File

@@ -60,10 +60,10 @@ make package/xmurp-ua/compile V=sc ARCH=mips CROSS_COMPILE=/home/chn/Desktop/led
#### 使用旧版 Makefile #### 使用旧版 Makefile
对于 Openwrt 15.05Chaos CalmerMakefile 的格式与最新版本不同。使用 `Makefile.cc` 代替 `Makefile` 再编译。 对于 Openwrt 15.05Chaos CalmerMakefile 的格式与最新版本不同。使用 `Chaos_Calmer.Makefile` 代替 `Makefile` 再编译。
```bash ```bash
cp package/xmurp-ua/Makefile.cc package/xmurp-ua/Makefile cp package/xmurp-ua/Chaos_Calmer.Makefile package/xmurp-ua/Makefile
``` ```
#### 失效的 host 命令 #### 失效的 host 命令

View File

@@ -149,7 +149,7 @@ unsigned int hook_funcion(void *priv, struct sk_buff *skb, const struct nf_hook_
static u_int32_t n_ua_modified = 0, n_ua_modify_faild = 0, n_not_modifible = 0, n_mark_matched = 0; static u_int32_t n_ua_modified = 0, n_ua_modify_faild = 0, n_not_modifible = 0, n_mark_matched = 0;
static u_int32_t n_ua_modified_lastprint = 1; static u_int32_t n_ua_modified_lastprint = 1;
static u_int8_t mark_matched = 0; static u_int8_t mark_matched = 0, not_writable = 0;
register u_int8_t jump_to_next_function = 0, ret; register u_int8_t jump_to_next_function = 0, ret;
@@ -200,8 +200,13 @@ unsigned int hook_funcion(void *priv, struct sk_buff *skb, const struct nf_hook_
return NF_ACCEPT; return NF_ACCEPT;
// 确保 skb 可以被修改,或者不可以被修改的话把它变得可修改 // 确保 skb 可以被修改,或者不可以被修改的话把它变得可修改
if(skb_ensure_writable(skb, (char*)data_end - (char*)skb -> data)) if(skb_ensure_writable(skb, (char*)data_end - (char*)skb -> data) || skb == 0 || skb -> data == 0)
{ {
if(!not_writable)
{
not_writable = 1;
printk("xmurp-ua: There is a package not wirtable. Please make sure the router has enough memory.\n");
}
n_not_modifible++; n_not_modifible++;
n_ua_modify_faild++; n_ua_modify_faild++;
catch_next_frag = 0; catch_next_frag = 0;