On Thu, Oct 24, 2024 at 12:41:03PM +0200, Florian Westphal wrote: > Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote> > since _OIF and _OIFNAME was restricted to prerouting, nf hookfn has NULL > > > output interface, so there is nothing we could compare against. > > > > > > Now its available in forward too so it could be selectively relaxed for > > > this, but, what is the use case? > > > > > > Do a RPF in forward, then we need to compare vs. incoming interface. > > > > This is for an esoteric scenario: Policy-based routing using input > > interface as key. The fib rule for RPF does not work from prerouting > > because iif cannot be inferred, there is no way to know if route in > > the reverse direction exists until the route lookup for this direction > > is done. > > Yes, that internally sets fibs iif to the oif. Yes, oif is used for the reverse lookup as iif. > > > But for outgoing interface, we'd do a normal route lookup, but the stack > > > already did that for us (as packet is already being forwarded). > > > > > > So what would be the desired outcome for a 'fib daddr . oif' check? > > > > Hm, this always evaluates true from forward and any later hook. > > > > I missing now, what is the point of . oif in general? > > Its for use with the 'type' output, i.e. consult fib to determine > the type of the daddr (multicast, broadcast etc). Is it possible to use skb_dst for this case to safe the fib lookup? This is not possible because it depends on the fib tuple, correct? > I don't see an application for the fib case, with exception > of the 'rpf lookup in forward' case. OK. New patch round to address my silly nitpicks? Thanks