Netipv4ipforwardc

static int ip_forward_finish(struct sk_buff *skb) { }

This is possible because the GNU C compiler has become able to perform an additional optimization technique: procedure tail calls. They originate from functional languages and are, for instance, mandatory for implementations of the Scheme language. When a function is called as the last statement of another function, it is not necessary that the callee returns to the caller after it has finished its work — there is nothing left to do in the caller. This allows for performing some simplifications of the call mechanism that lead to an execution that is as fast as with the old inline mechanism, without the need to duplicate code by inlining, and thus without increasing the size of the kernel. However, this optimization is not performed by gcc for all hook functions, and a small number of them still remain inlined.

If the netfilter configuration is enabled, scanning of the nf_hooks array makes no sense, and the nf_hook macro is then defined differently:

Continue reading here: Netnetfiltercorec

Was this article helpful?

0 0