Commit graph

3 commits

Author SHA1 Message Date
Beniamino Galvani
afe600caae device: set firewall zone when re-entering stage3
The ifindex of a virtual device is set when the kernel link
appears. For OVS interfaces, this happens after NM has added the
record to the ovsdb; since NM needs to know the related port and
bridge when it adds ovs-interface record, and since interfaces are
enslaved when they reach stage3, the ifindex is set during stage3.

This means that the first time
nm_device_activate_schedule_stage3_ip_config_start() is called, the
ifindex is unset. Previously we would just set the firewall state as
initialized and the zone would never be set again. Instead, allow the
zone to be set when re-entering stage3.

nm_device_activate_schedule_stage3_ip_config_start() now always check
for the ifindex. This guarantees that we don't try to change zone for
devices without a kernel link (for example, OVS bridges and ports).

Upon reaching state ip-check, the device now changes the zone also if
an ifindex is present and the zone was not set before. I'm not sure
this can actually happen, because if the device has an ifindex it
should be set during stage3. However I'm leaving this extra check for
completeness.

https://bugzilla.redhat.com/show_bug.cgi?id=1921107
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/737
2021-02-04 10:50:15 +01:00
Beniamino Galvani
a980d9916d ovs: avoid race condition when system interface is removed from ovsdb
Failing the system interface device is almost always the right thing
to do when the ovsdb entry is removed.

However, to avoid that a late device-removed signal tears down a
different, newly-activated connection, let's also check that we have a
master.  Or in alternative, that the device is assumed/external: in
such case it's always fine to fail the device

Fixes: 8e55efeb9d ('ovs: fail OVS system interfaces when the db entry gets removed')

https://bugzilla.redhat.com/show_bug.cgi?id=1923248
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/741
2021-02-04 10:47:51 +01:00
Thomas Haller
ac1a9e03e4
all: move "src/" directory to "src/core/"
Currently "src/" mostly contains the source code of the daemon.
I say mostly, because that is not true, there are also the device,
settings, wwan, ppp plugins, the initrd generator, the pppd and dhcp
helper, and probably more.

Also we have source code under libnm-core/, libnm/, clients/, and
shared/ directories. That is all confusing.

We should have one "src" directory, that contains subdirectories. Those
subdirectories should contain individual parts (libraries or
applications), that possibly have dependencies on other subdirectories.
There should be a flat hierarchy of directories under src/, which
contains individual modules.

As the name "src/" is already taken, that prevents any sensible
restructuring of the code.

As a first step, move "src/" to "src/core/". This gives space to
reorganize the code better by moving individual components into "src/".

For inspiration, look at systemd's "src/" directory.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/743
2021-02-04 09:45:55 +01:00