I download the source code of openwrt using git clone, then I run make menuconfig and choose my router then I run make.
After the compilation, a build_dir folder appear which contain netfilter that has .c files about networking like iptables, nat, filter …etc.
My question is: I want to edit the .c files in build_dir then to install the .bin on the router. So, Can I edit these files and how I to install the newest editing on the router? Should I recompile again ?
will go in /openwrt/target/linux/x86/patches-5.4 (if your target is x86 and kernel version is 5.4) if they were created with
quilt new platform/010-main_code_fix.patch
and the ones you create with quilt new generic/010-main_code_fix.patch will go in a subfolder of /openwrt/target/linux/generic, I don't know exactly but you can find it easily.
The patches in /openwrt/target/linux/generic are applied to all devices built by OpenWrt, the patches in /openwrt/target/linux/x86/patches-5.4 are applied to only that target, so in this example only to x86