From 4200c122259c12720643733b7e824db141d2ea15 Mon Sep 17 00:00:00 2001 From: chn <897331845@qq.com> Date: Sun, 3 Nov 2019 14:58:24 +0800 Subject: [PATCH] fix Makefile and Kconfig issue --- Makefile | 8 ++++---- src/Kconfig | 2 +- src/Makefile | 2 +- src/common.h | 2 +- src/rkp-ua.c | 3 +++ 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 9943099..d475908 100644 --- a/Makefile +++ b/Makefile @@ -2,19 +2,19 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=rkp-ua -PKG_RELEASE:=28 +PKG_RELEASE:=33 include $(INCLUDE_DIR)/package.mk EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ - -DVERSION $(PKG_RELEASE) + -DVERSION=$(PKG_RELEASE) --verbose MAKE_OPTS:=$(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ - CONFIG_rkp-ua=m + CONFIG_RKP_UA=m define KernelPackage/rkp-ua SUBMENU:=Other modules @@ -28,4 +28,4 @@ define Build/Compile $(MAKE) -C "$(LINUX_DIR)" $(MAKE_OPTS) modules endef -$(eval $(call KernelPackage, rkp-ua)) \ No newline at end of file +$(eval $(call KernelPackage,rkp-ua)) \ No newline at end of file diff --git a/src/Kconfig b/src/Kconfig index e0030f5..5c32677 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -1,2 +1,2 @@ -config rkp-ua +config RKP_UA tristate "rkp-ua" \ No newline at end of file diff --git a/src/Makefile b/src/Makefile index eac476b..c8c0f1a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1 +1 @@ -obj-${CONFIG_rkp-ua} += rkp-ua.o \ No newline at end of file +obj-${CONFIG_RKP_UA} += rkp-ua.o \ No newline at end of file diff --git a/src/common.h b/src/common.h index f4d5cd5..7847040 100644 --- a/src/common.h +++ b/src/common.h @@ -17,7 +17,7 @@ const unsigned char* str_ua_start = "User-Agent: "; const unsigned char* str_ua_end = "\r\n"; const unsigned char* str_head_end = "\r\n\r\n"; -const unsigned char* str_ua_rkp = "RKP/" VERSION; +const unsigned char str_ua_rkp[7]; time_t now() { diff --git a/src/rkp-ua.c b/src/rkp-ua.c index a598be7..9ad2838 100644 --- a/src/rkp-ua.c +++ b/src/rkp-ua.c @@ -32,6 +32,9 @@ static int __init hook_init(void) rkpm = rkpManager_new(); last_flush = now(); + memcpy(str_ua_rkp, "RKP/", 4); + memcpy(str_ua_rkp, VERSION, 3); + nfho.hook = hook_funcion; nfho.pf = NFPROTO_IPV4; nfho.hooknum = NF_INET_POST_ROUTING;