Commit Graph

18368 Commits

Author SHA1 Message Date
Thomas Haller
6dfb3e9ffb cli/trivial: remove whitespace between N_ macro and parenthesis
For _() and N_() we don't have a space before the parenthesis.
Be consistent about that.
2017-04-19 18:27:19 +02:00
Piotr Drąg
fbf40a23ad po: update Polish (pl) translation (bgo #780277)
https://bugzilla.gnome.org/show_bug.cgi?id=780277

[thaller@redhat.com: with `make -C po NetworkManager.pot update-po`]
2017-04-19 17:33:37 +02:00
Piotr Drąg
b54c60c176 po: update Polish (pl) translation (bgo #780277)
https://bugzilla.gnome.org/show_bug.cgi?id=780277
2017-04-19 17:21:25 +02:00
Thomas Haller
e68b024fb6 po: make update-po 2017-04-19 14:48:54 +02:00
Piotr Drąg
a2f621265c po: update Polish (pl) translation (bgo #780277)
https://bugzilla.gnome.org/show_bug.cgi?id=780277
2017-04-19 14:48:07 +02:00
Thomas Haller
6207090e71 po: import Zanata translations 2017-04-19 14:46:54 +02:00
Thomas Haller
19626cabc9 po: make update-po 2017-04-19 12:10:38 +02:00
Thomas Haller
9b7c393246 po: fix project-version for nm-1-8 branch in zanata.xml 2017-04-19 11:53:31 +02:00
Thomas Haller
865205650b gitignore: ignore generated files from master branch 2017-04-19 11:53:31 +02:00
Thomas Haller
0f14c2bdcc gitignore: ignore .zanata-cache directory
(cherry picked from commit b4b8e81153)
2017-04-19 11:53:26 +02:00
Thomas Haller
4f5464a914 po: make update-po 2017-04-19 11:52:28 +02:00
Piotr Drąg
70eb4c3dba po: update Polish (pl) translation (bgo #780277)
https://bugzilla.gnome.org/show_bug.cgi?id=780277
2017-04-19 11:52:28 +02:00
Thomas Haller
ef6787364a po: import Zanata translations 2017-04-19 11:52:27 +02:00
Thomas Haller
ef25459377 po: make update-po 2017-04-19 11:52:26 +02:00
Thomas Haller
b4b8e81153 gitignore: ignore .zanata-cache directory 2017-04-19 11:52:26 +02:00
Beniamino Galvani
2bb62945a3 supplicant: fix detection of PMF support
Fixes: a72ffe230b
2017-04-19 10:36:21 +02:00
Thomas Haller
d105a610d6 device: use define for "sriov-num-vfs" config entry 2017-04-19 10:29:04 +02:00
Beniamino Galvani
3cabd60b96 merge: branch 'bg/sriov-numvfs-rh1398934'
https://bugzilla.redhat.com/show_bug.cgi?id=1398934
(cherry picked from commit 45e4cc67b3)
2017-04-19 08:50:48 +02:00
Beniamino Galvani
5413d3bcc7 device: re-apply sriov_numvfs after SIGHUP
(cherry picked from commit 264624f91d)
2017-04-19 08:49:37 +02:00
Beniamino Galvani
0c2576e4bf core: allow setting SR-IOV num_vfs
(cherry picked from commit 32975b6aa5)
2017-04-19 08:49:37 +02:00
Beniamino Galvani
2409de0bb1 all: detect SR-IOV device support
(cherry picked from commit f13fd4524c)
2017-04-19 08:49:37 +02:00
Beniamino Galvani
2511e27e76 platform: detect SR-IOV support and allow changing the number of VFs
(cherry picked from commit 0a7694cf81)
2017-04-18 23:28:59 +02:00
Beniamino Galvani
45e4cc67b3 merge: branch 'bg/sriov-numvfs-rh1398934'
https://bugzilla.redhat.com/show_bug.cgi?id=1398934
2017-04-18 23:25:30 +02:00
Beniamino Galvani
264624f91d device: re-apply sriov_numvfs after SIGHUP 2017-04-18 23:10:36 +02:00
Beniamino Galvani
32975b6aa5 core: allow setting SR-IOV num_vfs 2017-04-18 23:10:36 +02:00
Beniamino Galvani
f13fd4524c all: detect SR-IOV device support 2017-04-18 22:48:34 +02:00
Beniamino Galvani
0a7694cf81 platform: detect SR-IOV support and allow changing the number of VFs 2017-04-18 22:47:32 +02:00
Thomas Haller
785b51ed02 device: leave device up when setting it as unmanaged by user
Before, setting a device to unmanaged causes it to go down and clear
the interface state.

It may be useful to instruct NetworkManager not to touch the device
anymore but leave the current state up. Changing behavior for

  nmcli device set "$DEV" managed no

To get the previous behavior, one has to first disconnect the interface
via

  nmcli device disconnect "$DEV"
  nmcli device set "$DEV" managed no

Note that non-permanent addresses like from DHCP will eventually time
out because NetworkManager stops the DHCP client. When instructing
NetworkManager to let go of the device, you have to take it over in
any way you see fit.

https://bugzilla.redhat.com/show_bug.cgi?id=1371433
(cherry picked from commit 9e8218f99a)
2017-04-18 21:48:01 +02:00
Thomas Haller
6d3ce7557e core: merge branch 'th/netns-singleton-rh1440089'
https://bugzilla.redhat.com/show_bug.cgi?id=1440089

(cherry picked from commit a31ddcfca5)
2017-04-18 15:53:28 +02:00
Thomas Haller
c2297fb66c core: enable "log-with-ptr" by default for platform and route-manager
Arguably, we currently only have one instance of NMPlatform,
NMRouteManager, NMDefaultRouteManager -- the one owned by the
NMNetns singleton.

Hence, all these instances we create with "log-with-ptr" set explicitly
to false.

In the future we want to support namespaces, and it will be be common to
have multiple instances. For that we have "log-with-ptr" so we are able
to disambiguiate the logging.

Change the default to TRUE because it makes more sense. It has currently
no effect as the default is never used.

(cherry picked from commit 41148caba8)
2017-04-18 15:53:11 +02:00
Thomas Haller
7b91e8b6db device: don't use platform singleton getter in device subclasses
Reduce the use of NM_PLATFORM_GET / nm_platform_get() to get
the platform singleton instance.

For one, this is a step towards supporting namespaces, where we need
to use different NMNetns/NMPlatform instances depending on in which
namespace the device lives.

Also, we should reduce our use of singletons. They are difficult to
coordinate on shutdown. Instead there should be a clear order of
dependencies, expressed by owning a reference to those singelton
instances. We already own a reference to the platform singelton,
so use it and avoid NM_PLATFORM_GET.

(cherry picked from commit 94d9ee129d)
2017-04-18 15:53:11 +02:00
Thomas Haller
8a6eef6aa7 device: keep NMNetns instance per device
This also ensures that we own a reference to the
NMPlatform, NMRouteManager and NMDefaultRouteManager
instances. See bug rh#1440089 where we might access
the singleton getter after destroing the singleton
instance of NMRouteManager. This is prevented by
keeping a reference to those instances -- indirectly
via the netns instance.

Later, we may add support for multiple namespaces. Then it might
make sense to swap the NMNetns instance of a device when moving
the device between namespaces.

Also, drop the use of singelton instances.

https://bugzilla.redhat.com/show_bug.cgi?id=1440089
(cherry picked from commit c48a19b7c6)
2017-04-18 15:53:11 +02:00
Thomas Haller
d37b9d79bc core: add NMNetns to bundle platform and route managers
NMPlatform, NMRouteManager and NMDefaultRouteManager are singletons
instances. Users of those are for example NMDevice, which registers
to GObject signals of both NMPlatform and NMRouteManager.

Hence, as NMDevice:dispose() disconnects the signal handlers, it must
ensure that those singleton instances live longer then the NMDevice
instance. That is usually accomplished by having users of singleton
instances own a reference to those instances.
For NMDevice that effectively means that it shall own a reference to
several singletons.

NMPlatform, NMRouteManager, and NMDefaultRouteManager are all
per-namespace. In general it doesn't make sense to have more then
one instances of these per name space. Nnote that currently we don't
support multiple namespaces yet. If we will ever support multiple
namespaces, then a NMDevice would have a reference to all of these
manager instances. Hence, introduce a new class NMNetns which bundles
them together.

(cherry picked from commit 0af2f5c28b)
2017-04-18 15:53:11 +02:00
Thomas Haller
9e8218f99a device: leave device up when setting it as unmanaged by user
Before, setting a device to unmanaged causes it to go down and clear
the interface state.

It may be useful to instruct NetworkManager not to touch the device
anymore but leave the current state up. Changing behavior for

  nmcli device set "$DEV" managed no

To get the previous behavior, one has to first disconnect the interface
via

  nmcli device disconnect "$DEV"
  nmcli device set "$DEV" managed no

Note that non-permanent addresses like from DHCP will eventually time
out because NetworkManager stops the DHCP client. When instructing
NetworkManager to let go of the device, you have to take it over in
any way you see fit.

https://bugzilla.redhat.com/show_bug.cgi?id=1371433
2017-04-18 15:52:44 +02:00
Thomas Haller
a31ddcfca5 core: merge branch 'th/netns-singleton-rh1440089'
https://bugzilla.redhat.com/show_bug.cgi?id=1440089
2017-04-18 15:52:01 +02:00
Thomas Haller
41148caba8 core: enable "log-with-ptr" by default for platform and route-manager
Arguably, we currently only have one instance of NMPlatform,
NMRouteManager, NMDefaultRouteManager -- the one owned by the
NMNetns singleton.

Hence, all these instances we create with "log-with-ptr" set explicitly
to false.

In the future we want to support namespaces, and it will be be common to
have multiple instances. For that we have "log-with-ptr" so we are able
to disambiguiate the logging.

Change the default to TRUE because it makes more sense. It has currently
no effect as the default is never used.
2017-04-18 15:49:14 +02:00
Thomas Haller
94d9ee129d device: don't use platform singleton getter in device subclasses
Reduce the use of NM_PLATFORM_GET / nm_platform_get() to get
the platform singleton instance.

For one, this is a step towards supporting namespaces, where we need
to use different NMNetns/NMPlatform instances depending on in which
namespace the device lives.

Also, we should reduce our use of singletons. They are difficult to
coordinate on shutdown. Instead there should be a clear order of
dependencies, expressed by owning a reference to those singelton
instances. We already own a reference to the platform singelton,
so use it and avoid NM_PLATFORM_GET.
2017-04-18 15:49:14 +02:00
Thomas Haller
c48a19b7c6 device: keep NMNetns instance per device
This also ensures that we own a reference to the
NMPlatform, NMRouteManager and NMDefaultRouteManager
instances. See bug rh#1440089 where we might access
the singleton getter after destroing the singleton
instance of NMRouteManager. This is prevented by
keeping a reference to those instances -- indirectly
via the netns instance.

Later, we may add support for multiple namespaces. Then it might
make sense to swap the NMNetns instance of a device when moving
the device between namespaces.

Also, drop the use of singelton instances.

https://bugzilla.redhat.com/show_bug.cgi?id=1440089
2017-04-18 15:49:14 +02:00
Thomas Haller
0af2f5c28b core: add NMNetns to bundle platform and route managers
NMPlatform, NMRouteManager and NMDefaultRouteManager are singletons
instances. Users of those are for example NMDevice, which registers
to GObject signals of both NMPlatform and NMRouteManager.

Hence, as NMDevice:dispose() disconnects the signal handlers, it must
ensure that those singleton instances live longer then the NMDevice
instance. That is usually accomplished by having users of singleton
instances own a reference to those instances.
For NMDevice that effectively means that it shall own a reference to
several singletons.

NMPlatform, NMRouteManager, and NMDefaultRouteManager are all
per-namespace. In general it doesn't make sense to have more then
one instances of these per name space. Nnote that currently we don't
support multiple namespaces yet. If we will ever support multiple
namespaces, then a NMDevice would have a reference to all of these
manager instances. Hence, introduce a new class NMNetns which bundles
them together.
2017-04-18 15:49:14 +02:00
Beniamino Galvani
a39fac2248 manager: set interface as removed when the link disappears
Set the device state as removed when the link disappears, so that in
the call to unrealize() when the device is unmanaged we also perform a
cleanup of it and especially, we terminate any DHCP client instances
running on the device.

If we keep DHCP clients running, we can hit assertions later when we
start another instance on the same interface, because we kill the old
dhclient from the pidfile, and the g_child_watch_add() done by the
first client instance is not able to waitpid() it, complaining with:

  GChildWatchSource: Exit status of a child process was requested but
  ECHILD was received by waitpid(). Most likely the process is
  ignoring SIGCHLD, or some other thread is invoking waitpid() with a
  nonpositive first argument; either behavior can break applications
  that use g_child_watch_add()/g_spawn_sync() either directly or
  indirectly.

https://bugzilla.redhat.com/show_bug.cgi?id=1436602
(cherry picked from commit df537d2eac)
2017-04-18 15:10:45 +02:00
Beniamino Galvani
df537d2eac manager: set interface as removed when the link disappears
Set the device state as removed when the link disappears, so that in
the call to unrealize() when the device is unmanaged we also perform a
cleanup of it and especially, we terminate any DHCP client instances
running on the device.

If we keep DHCP clients running, we can hit assertions later when we
start another instance on the same interface, because we kill the old
dhclient from the pidfile, and the g_child_watch_add() done by the
first client instance is not able to waitpid() it, complaining with:

  GChildWatchSource: Exit status of a child process was requested but
  ECHILD was received by waitpid(). Most likely the process is
  ignoring SIGCHLD, or some other thread is invoking waitpid() with a
  nonpositive first argument; either behavior can break applications
  that use g_child_watch_add()/g_spawn_sync() either directly or
  indirectly.

https://bugzilla.redhat.com/show_bug.cgi?id=1436602
2017-04-18 15:09:15 +02:00
Beniamino Galvani
afca8a4c0f clients: fix setting of enum properties
Ensure we call G_IS_ENUM_CLASS() or G_IS_FLAGS_CLASS() only on classed
types.

 $ nmcli connection modify foobar wifi.powersave 1
 Thread 1 "nmcli" received signal SIGSEGV, Segmentation fault.
 0x0000000000440a4d in _set_fcn_gobject_enum at
 clients/common/nm-meta-setting-desc.c:985
 985                 || G_IS_ENUM_CLASS (gtype_prop)) {

Fixes: f53218ed7c
2017-04-18 13:40:02 +02:00
Thomas Haller
297ad945f5 test: fix undefined behavior shifting signed integer in test
(cherry picked from commit d58d8d7518)
2017-04-18 09:45:03 +02:00
Lubomir Rintel
928d68d04a m4: disable -Wmissing-braces for newer clang
src/NetworkManagerUtils.c:347:18: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
          NMIPAddr a1 = { 0 }, a2 = { 0 };
                          ^
                          {}

Should we initialize unions this way? I think it's all right -- the initializer
works well and { { { 0 } } } is probably not what we'd like to see.

(cherry picked from commit 43012156a3)
2017-04-18 09:44:45 +02:00
Lubomir Rintel
fcad4fba16 platform: fix a typo
(cherry picked from commit c76ee5883d)
2017-04-18 09:43:43 +02:00
Dan Williams
589fc0179e ppp: allow disabling IPv4 too
https://bugzilla.redhat.com/show_bug.cgi?id=1439360
(cherry picked from commit a12b3f06cb)
2017-04-18 09:41:44 +02:00
Dan Williams
a12b3f06cb ppp: allow disabling IPv4 too
https://bugzilla.redhat.com/show_bug.cgi?id=1439360
2017-04-18 09:40:31 +02:00
Thomas Haller
d58d8d7518 test: fix undefined behavior shifting signed integer in test 2017-04-17 13:19:47 +02:00
Lubomir Rintel
bacb68f3f6 wifi/test-general: don't do g_message() in test
An unexpected message causes the test to abort after the first line of
output.
2017-04-15 12:30:05 +02:00
Lubomir Rintel
738c2fcefc clients/meta-setting-desc: fix an unintentional fallthrough
Fixes: ddfff04a45
2017-04-15 12:30:02 +02:00