[systemd-devel] [PATCH] networkd: don't touch global forwarding setting

Lennart Poettering lennart at poettering.net
Fri May 15 03:17:42 PDT 2015

On Wed, 13.05.15 19:19, Lennart Poettering (lennart at poettering.net) wrote:

> On Sun, 10.05.15 20:52, Benedikt Morbach (benedikt.morbach at googlemail.com) wrote:
> > This reverts commit 43c6d5abacaebf813845934ec8d5e5ee3c431854
> > (and a small part of 4046d8361c55c80ab8577aea52523b9e6eab0d0c)
> > 
> > It turns out we don't actually need to set the global ip_forward setting.
> > The only relevant setting is the one on each interface.
> Hmm, I tried to understand the kernel side for the setting to verify
> that but that code isn't particularly readable.
> How do ip_forward and conf/*/forwarding actually relate in detail? I
> mean, from playing around with it, usually echoing 1 into the global
> option also sets the local ones, and echoing 0 into the local option
> also unset the local ones, except not always: if some but not all
> local interfaces have it turned on, then setting 1 in the global
> setting doesn't do anything. Setting 0 in the global setting OTOH
> turns all off... So what are the precise semantics here?
> Also, do the local options ever propagate to the global one?
> What's the precise relation between conf/all/forwarding and
> ip_forward? It appears to do the very same thing? What's going on
> here?
> The actual IP forwarding code, does it ever check the global setting?
> Or only the local settings?
> I kinda would like to understand the actual behaviour before we fix
> this, because if we don't udnerstand the real behaviour it's really
> hard to fix this properly for good...
> Any ideas?

Benedikt, while I still don't grok this fully I think I am certain
enough now that the current code is broken, and that we should really
never touch the global option, and stick to the local ones. I have
thus merged your patch! Thanks!


Lennart Poettering, Red Hat

More information about the systemd-devel mailing list