[PATCH] firewall3: remove unnecessary fw3_has_table

Ansuel Smith ansuelsmth at gmail.com
Mon Feb 21 08:09:00 PST 2022


>
> >
> > Hi, guys,
> >
> > On Fri, 11 Feb 2022 at 19:12, Wenli Looi <wlooi at ucalgary.ca> wrote:
> > >
> > > Sorry, forgot to reply all
> > >
> > > On Fri, Feb 11, 2022 at 11:09 AM Wenli Looi <wlooi at ucalgary.ca> wrote:
> > > >
> > > > Hi Rui,
> > > >
> > > > Yes, I believe it still works. Every place where fw3_has_table is
> > > > called, we check immediately after if fw3_ipt_open succeeds, which
> > > > makes fw3_has_table superfluous?
> > > >
> > > > I added a few print statements to fw3_ipt_open to check the case you mentioned:
> > > >
> > > > root at OpenWrt:~# fw3 restart 2>/dev/null
> > > > fw3_ipt_open SUCCESS for v4 filter
> > > > fw3_ipt_open SUCCESS for v4 nat
> > > > fw3_ipt_open SUCCESS for v4 mangle
> > > > fw3_ipt_open FAILED for v4 raw
> > > > fw3_ipt_open FAILED for v6 filter
> > > > fw3_ipt_open FAILED for v6 nat
> > > > fw3_ipt_open FAILED for v6 mangle
> > > > fw3_ipt_open FAILED for v6 raw
> > > > fw3_ipt_open SUCCESS for v4 filter
> > > > fw3_ipt_open SUCCESS for v4 nat
> > > > fw3_ipt_open SUCCESS for v4 mangle
> > > > fw3_ipt_open FAILED for v4 raw
> > > > fw3_ipt_open FAILED for v6 filter
> > > > fw3_ipt_open FAILED for v6 nat
> > > > fw3_ipt_open FAILED for v6 mangle
> > > > fw3_ipt_open FAILED for v6 raw
> > > > root at OpenWrt:~# opkg install kmod-ipt-raw
> > > > Installing kmod-ipt-raw (5.10.96-1) to root...
> > > > Downloading https://downloads.openwrt.org/snapshots/targets/x86/64/kmods/5.10.96-1-d70ff298d8114a0df4de3fc8fa861191/kmod-ipt-raw_5.10.96-1_x86_64.ipk
> > > > Configuring kmod-ipt-raw.
> > > > root at OpenWrt:~# fw3 restart 2>/dev/null
> > > > fw3_ipt_open SUCCESS for v4 filter
> > > > fw3_ipt_open SUCCESS for v4 nat
> > > > fw3_ipt_open SUCCESS for v4 mangle
> > > > fw3_ipt_open SUCCESS for v4 raw
> > > > fw3_ipt_open FAILED for v6 filter
> > > > fw3_ipt_open FAILED for v6 nat
> > > > fw3_ipt_open FAILED for v6 mangle
> > > > fw3_ipt_open FAILED for v6 raw
> > > > fw3_ipt_open SUCCESS for v4 filter
> > > > fw3_ipt_open SUCCESS for v4 nat
> > > > fw3_ipt_open SUCCESS for v4 mangle
> > > > fw3_ipt_open SUCCESS for v4 raw
> > > > fw3_ipt_open FAILED for v6 filter
> > > > fw3_ipt_open FAILED for v6 nat
> > > > fw3_ipt_open FAILED for v6 mangle
> > > > fw3_ipt_open FAILED for v6 raw
> >
> > Ansuel, mind giving Wenli's fw3 patch [1] a spin on your 5.15 setup?
> > I've reverted your fix [2], tested it on 5.10 and had no regressions.
> > If it also works fine on 5.15, it's definitely a more elegant
> > solution.
>
> Sure I will test this today and give a response ASAP.
>

Hi, sorry for the delay... I reverted my patch and applied this
and I can confirm that this works correctly on linux 5.15.

> >
> > [1] https://patchwork.ozlabs.org/project/openwrt/patch/20210610045106.285820-1-wlooi@ucalgary.ca/
> > [2] https://git.openwrt.org/?p=project/firewall3.git;a=commit;h=3624c3786601699b6e7f9d18209fad0d7c6fe4e9
> >
> > Thanks in advance,
> > Rui



More information about the openwrt-devel mailing list