add fanchmwrt patch

This commit is contained in:
derry
2026-01-04 22:21:54 +08:00
parent 78b23a26c4
commit a485f4eb41
7 changed files with 101 additions and 14 deletions

View File

@@ -247,7 +247,7 @@ menu "Target Images"
config GRUB_TITLE
string "Title for the menu entry in GRUB"
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
default "OpenWrt"
default "FanchmWrt"
help
This is the title of the GRUB menu entry.
If unspecified, it defaults to OpenWrt.

View File

@@ -50,14 +50,57 @@ DEFAULT_PACKAGES.nas:=\
# @brief Default packages for @DEVICE_TYPE router.
##
DEFAULT_PACKAGES.router:=\
dnsmasq \
dnsmasq-full \
firewall4 \
nftables \
kmod-nft-offload \
odhcp6c \
odhcpd-ipv6only \
ppp \
ppp-mod-pppoe
ppp-mod-pppoe \
fwxd \
kmod-fwx \
libfwx_common \
luci \
luci-theme-fanchmwrt \
luci-app-fwx-appfilter \
luci-app-fwx-dashboard \
luci-app-fwx-feature \
luci-app-fwx-macfilter \
luci-app-fwx-network \
luci-app-fwx-record \
luci-app-fwx-resources \
luci-app-fwx-user \
luci-app-fwx-dashboard-setting \
luci-app-fwx-system \
luci-app-ddns \
luci-app-upnp \
luci-app-autoreboot \
luci-app-wol \
block-mount \
coremark \
kmod-tun \
kmod-nf-nathelper \
kmod-nf-nathelper-extra \
kmod-ipt-raw \
iptables-mod-tproxy \
iptables-mod-extra \
kmod-nf-conntrack-netlink \
kmod-inet-diag \
kmod-nft-tproxy \
kmod-wireguard \
kmod-fs-ksmbd \
luci-app-uhttpd \
kmod-usb-storage \
kmod-usb-core \
kmod-fs-vfat \
kmod-fs-ext4 \
px5g-standalone \
kmod-nft-socket \
kmod-netlink-diag \
ipset \
kmod-pppol2tp \
ip-full
ifneq ($(DUMP),)
all: dumpinfo

View File

@@ -311,8 +311,9 @@ generate_static_system() {
uci -q batch <<-EOF
delete system.@system[0]
add system system
set system.@system[-1].hostname='OpenWrt'
set system.@system[-1].timezone='UTC'
set system.@system[-1].hostname='FanchmWrt'
set system.@system[-1].timezone='HKT-8'
set system.@system[-1].zonename='Asia/Hong Kong'
set system.@system[-1].ttylogin='0'
set system.@system[-1].log_size='128'
set system.@system[-1].urandom_seed='0'

View File

@@ -1,8 +1,9 @@
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
______ _ __ __ _
| ____| | | \ \ / / | |
| |__ __ _ _ __ ___| |__ _ __ __\ \ /\ / / __| |_
| __/ _` | '_ \ / __| '_ \| '_ ` _ \ \/ \/ / '__| __|
| | | (_| | | | | (__| | | | | | | | \ /\ /| | | |_
|_| \__,_|_| |_|\___|_| |_|_| |_| |_|\/ \/ |_| \__|
-----------------------------------------------------
%D %V, %C
%V, %C
-----------------------------------------------------

View File

@@ -1,4 +1,4 @@
root:::0:99999:7:::
root:$5$dp/4vCQAseJ6gAD6$j0QahiaeHnr7JTWG1Ys.PqNk/Tpq2yfRY4x9S7dHit/:20446:0:99999:7:::
daemon:*:0:0:99999:7:::
ftp:*:0:0:99999:7:::
network:*:0:0:99999:7:::

View File

@@ -98,13 +98,13 @@ set ${s}.channel='${channel}'
set ${s}.htmode='${htmode}'
set ${s}.country='${country || ''}'
set ${s}.num_global_macaddr='${num_global_macaddr || ''}'
set ${s}.disabled='${defaults ? 0 : 1}'
set ${s}.disabled='0'
set ${si}=wifi-iface
set ${si}.device='${name}'
set ${si}.network='lan'
set ${si}.mode='ap'
set ${si}.ssid='${defaults?.ssid || "OpenWrt"}'
set ${si}.ssid='${defaults?.ssid || "FanchmWrt"}'
set ${si}.encryption='${defaults?.encryption || "none"}'
set ${si}.key='${defaults?.key || ""}'

View File

@@ -0,0 +1,42 @@
diff -urN a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
--- a/include/net/netfilter/nf_conntrack.h 2025-11-27 18:06:47.320384226 +0800
+++ b/include/net/netfilter/nf_conntrack.h 2025-11-27 18:00:39.169670577 +0800
@@ -72,6 +72,13 @@
#include <net/netfilter/ipv4/nf_conntrack_ipv4.h>
#include <net/netfilter/ipv6/nf_conntrack_ipv6.h>
+struct nf_fwx_data{
+ u32 mark;
+ u32 app_id;
+ u32 match_status;
+ u8 action;
+ u8 *host;
+};
struct nf_conn {
/* Usage count in here is 1 for hash table, 1 per skb,
* plus 1 for any connection(s) we are `master' for
@@ -121,6 +128,8 @@
/* Extensions */
struct nf_ct_ext *ext;
+ /*FanchmWrt Data*/
+ struct nf_fwx_data fwx_data;
/* Storage reserved for other modules, must be the last member */
union nf_conntrack_proto proto;
};
diff -urN a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
--- a/net/netfilter/nf_conntrack_core.c 2025-11-27 18:06:38.992416159 +0800
+++ b/net/netfilter/nf_conntrack_core.c 2025-11-27 18:01:02.597598226 +0800
@@ -1655,6 +1655,12 @@
/* save hash for reusing when confirming */
*(unsigned long *)(&ct->tuplehash[IP_CT_DIR_REPLY].hnnode.pprev) = hash;
ct->status = 0;
+ /* fwx data */
+ ct->fwx_data.mark = 0;
+ ct->fwx_data.app_id = 0;
+ ct->fwx_data.match_status = 0;
+ ct->fwx_data.action = 0;
+ ct->fwx_data.host = NULL;
WRITE_ONCE(ct->timeout, 0);
write_pnet(&ct->ct_net, net);
memset_after(ct, 0, __nfct_init_offset);