diff --git a/Makefile.cc b/Chaos_Calmer.Makefile similarity index 98% rename from Makefile.cc rename to Chaos_Calmer.Makefile index 2d62a15..747cee4 100644 --- a/Makefile.cc +++ b/Chaos_Calmer.Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=xmurp-ua -PKG_RELEASE:=30 +PKG_RELEASE:=31 include $(INCLUDE_DIR)/package.mk diff --git a/Makefile b/Makefile index 10c2021..18b3842 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=xmurp-ua -PKG_RELEASE:=30 +PKG_RELEASE:=31 include $(INCLUDE_DIR)/package.mk diff --git a/compile.md b/compile.md index 00f40e3..441a091 100644 --- a/compile.md +++ b/compile.md @@ -60,10 +60,10 @@ make package/xmurp-ua/compile V=sc ARCH=mips CROSS_COMPILE=/home/chn/Desktop/led #### 使用旧版 Makefile -对于 Openwrt 15.05(Chaos Calmer),Makefile 的格式与最新版本不同。使用 `Makefile.cc` 代替 `Makefile` 再编译。 +对于 Openwrt 15.05(Chaos Calmer),Makefile 的格式与最新版本不同。使用 `Chaos_Calmer.Makefile` 代替 `Makefile` 再编译。 ```bash -cp package/xmurp-ua/Makefile.cc package/xmurp-ua/Makefile +cp package/xmurp-ua/Chaos_Calmer.Makefile package/xmurp-ua/Makefile ``` #### 失效的 host 命令 diff --git a/src/xmurp-ua.c b/src/xmurp-ua.c index 7a0b31a..92e58f0 100644 --- a/src/xmurp-ua.c +++ b/src/xmurp-ua.c @@ -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_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; @@ -200,8 +200,13 @@ unsigned int hook_funcion(void *priv, struct sk_buff *skb, const struct nf_hook_ return NF_ACCEPT; // 确保 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_ua_modify_faild++; catch_next_frag = 0;