Commit graph

14594 commits

Author SHA1 Message Date
Thomas Haller 6fb80e1060 contrib/rpm: improve build_clean.sh to explicitly set $SOURCE_FROM_GIT
Presiouvly, when there was a tarball file in the top git-tree, it would
have been choosen and no easy way to overwrite the decision to build
from a git-archive. Now you can safely build current HEAD by simply calling

  ./contrib/fedora/rpm/build_clean.sh -g

Contrary to the regular build which calls `make dist`, this doesn't
require a clean working copy and no need to purge it with git-clean.
2016-04-01 09:25:11 +02:00
Thomas Haller 5aba6db676 exported-object: merge branch 'th/exported-object-rework-interfaces' 2016-04-01 08:58:19 +02:00
Thomas Haller 603e6dc006 exported-object: reorder includes 2016-04-01 08:58:19 +02:00
Thomas Haller 8fd3a2b893 exported-object/trivial: move code 2016-04-01 08:58:19 +02:00
Thomas Haller 61f3c9890f exported-object: static variable prefix_counters from global scope to _create_export_path() 2016-04-01 08:58:19 +02:00
Thomas Haller d4d72e2bda exported-object: inline find_dbus_property_type() in nm_exported_object_notify()
nm_exported_object_notify() is not that large of a function. Having it
all at one place makes it clearer what it does.
2016-04-01 08:58:19 +02:00
Thomas Haller 429cc30607 exported-object: allocate temporary buffer in nm_exported_object_signal_hook() using alloca
The size of GValue is about 24 bytes. The number of arguments
for a signal is also small. No problem allocating the temporary buffer
on the stack.
2016-04-01 08:58:19 +02:00
Thomas Haller 05d4faf334 exported-object: cache signal-id for "property-changed" in InterfaceData
Instead of looking up the signal-id every time, cache it.
g_signal_lookup() requires a g_quark_try_string() and a
lock a lock on a global mutex.

Downside is that the InterfaceData structure grows.
2016-04-01 08:58:19 +02:00
Thomas Haller 6a42e18d53 exported-object: refactor list of interfaces from GSList to an array
NMExportedObject is the center of every D-Bus exported object in
NetworkManager's core. It makes sense to optimize it.

Transform the GSList of interfaces to be a array. The array is still
allocated via the slice allocator (as we expect that there are only few
types in the list). This saves the overhead to allocate a GSList item
for each entry.

Another advantage is that the interfaces list is now strongly typed
instead of an opaque data pointer.
2016-04-01 08:58:18 +02:00
Thomas Haller efae518e3c exported-object: sort fields in emitted "property-changed" data variant
The fields of the variant should have a consistent sort order.
2016-04-01 08:58:18 +02:00
Thomas Haller 2b9462f172 exported-object: reorder fields in NMExportedObjectPrivate struct
For now, this doesn't change the overall size of the struct.
But with the next commits this ordering allows tighter packing.
2016-04-01 08:58:18 +02:00
Jan Alexander Steffens (heftig) 89f3f6ade0 docs: fix build without ifcfg-rh 2016-03-31 22:26:02 -05:00
Thomas Haller 05f17ace71 man: fix typo in NetworkManager.conf manual and 10-ifcfg-rh-routes.sh comment 2016-03-31 20:46:52 +02:00
Nikolay Martynov 28e9ec499a device: renew dhcp leases on awake for software devices
This makes sure that devices like bond get their dhcp renewed

[thaller@redhat.com: original patch modified to rename
 now-public function update_dynamic_ip_setup()]

https://bugzilla.gnome.org/show_bug.cgi?id=764398
2016-03-31 16:31:34 +02:00
Thomas Haller 4db69c5b52 man: discourage use of monitor-connection-files=yes in NetworkManager.conf manual
https://bugzilla.gnome.org/show_bug.cgi?id=764402
Related: https://bugzilla.redhat.com/show_bug.cgi?id=754677
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1272617
2016-03-31 14:51:24 +02:00
Thomas Haller 05326c2051 device: merge branch 'th/unmanaged-external-down-bgo763236' (early part)
https://bugzilla.gnome.org/show_bug.cgi?id=761389
https://bugzilla.gnome.org/show_bug.cgi?id=763236
2016-03-31 10:45:11 +02:00
Thomas Haller 3c8ffa766c device: refactor by adding set_unmanaged_external_down() function
No functional change.
2016-03-31 10:38:39 +02:00
Thomas Haller f7523ae6e2 device: refactor setting unmanaged flag EXTERNAL_DOWN
This should not actually change how we handle EXTERNAL_DOWN
unmanaged devices.
2016-03-31 10:38:38 +02:00
Thomas Haller 2d472657bd device: add nm_device_get_unmanaged_mask() 2016-03-31 10:38:38 +02:00
Thomas Haller c1f58e9bb6 device: trival refactoring in can_unmanaged_external_down()
Swap order of operands so that the "cheaper" is evaluated first.
2016-03-30 18:50:52 +02:00
Thomas Haller 03fd18cde0 cli: fix setting 'slave-type' for nmcli connection add type *-slave
$ nmcli connection add type bond-slave ifname eth1 con-name bond0.0 master nm-bond
  Error: Failed to add 'bond0.0' connection: connection.slave-type: Cannot set 'master' without 'slave-type'

Fixes: 8ad218e71c
2016-03-30 18:36:07 +02:00
Thomas Haller 6fa521b384 cli/trivial: fix indention and whitespace 2016-03-30 18:15:03 +02:00
Beniamino Galvani 1422ce0a6a ifcfg-rh: don't chain up after failure of replace_and_commit()
If replace_and_commit() found existing route files (and the callback
has potentially already been invoked), it is wrong to chain up to
parent class and continue the update.

Fixes: f79d62692e
2016-03-30 18:12:32 +02:00
Thomas Haller 5f83ef9925 build: drop internal field __nm_git_sha from libraries
The problem is that you cannot be sure which patches
were applied on top of a source tree, so the __nm_git_sha
value is unreliable.

Also, after running autoreconf during the package build,
NM_GIT_SHA is reset as well.
2016-03-30 15:48:56 +02:00
Thomas Haller 3b6fc5cbda contrib/rpm: add comments to build.sh to list script arguments 2016-03-30 15:00:02 +02:00
Thomas Haller a348bda6ea contrib/rpm: fix obtaining SOURCE via git-archive
- when user provided a $SOURCE argument, do call abs_path on
  it. abs_path allows the user to provide relative paths in
  the original directory.

- don't call abs_path on "$GITDIR/NetworkManager-$VERSION".tar.xz
  abs_path is there to verify user input and it will abort the script
  if the file doesn't exist.

- when creating a temporary tarball via git-archive, put it
  into the output directory and not overwriting files in
  $GITDIR.

- fix abs_path to return an error code and let callers abort
  the script

- add a new parameter $SOURCE_FROM_GIT so that you can control
  whether git-archive is used. You can now specify either $SOURCE
  or $SOURCE_FROM_GIT. In case of absence of both, it tries to
  detect a tar file in the $GITDIR directory.

Fixes: 9e9ec1a3da
2016-03-30 14:50:55 +02:00
Lubomir Rintel 05e454a98d platform: don't assume that netlink message is as big as at compile time
The link_stats structure grew between 4.5 and 4.6 and this would cause
the messages to me ignored when compiling with 4.6 headers and running
on 4.5.

https://bugzilla.gnome.org/show_bug.cgi?id=764332
2016-03-30 13:25:49 +02:00
Lubomir Rintel 9e9ec1a3da contrib/rpm: allow building of a git archive
No need for a make dist.
2016-03-30 13:25:49 +02:00
Lubomir Rintel e3e0a49075 contrib/rpm: allow building w/o prebuilt documentation 2016-03-30 13:25:49 +02:00
Lubomir Rintel 6b62536ce6 manager: make some error reporting a bit more specific
Make sure there's always the device and connection as well as the reason
when a slave activation fails. The slave connection could in fact be
chosen automatically on "nmcli d connect" and the user might not be
aware activation of which connection was attempted:

  $ nmcli d connect enp0s25
  Error: Device activation failed: Master connection not found or invalid
2016-03-30 13:24:49 +02:00
Beniamino Galvani a0206a4f5e man,libnm-core: fix typos 2016-03-30 12:03:36 +02:00
Beniamino Galvani b717c5503b libnm-core: remove trailing quote from message in nm-setting-macvlan.c
Reported-by: Anders Jonsson <anders.jonsson@norsjovallen.se>
2016-03-30 00:33:20 +02:00
Dan Williams 299ef26c39 merge: branch 'dcbw/dupe-pc-signals-bgo764039' 2016-03-29 17:11:46 -05:00
Dan Williams 415e9441ab core: fix duplicate values in NM-specific PropertiesChanged signals
GVariantBuilder doesn't care if you give it multiple dict entries with
the same key.  But that causes duplicate dict entries in the legacy
D-Bus PropertiesChanged signals that NM emits.  So instead go back to
a hash table to ensure that any previous value is dropped in favor of
the new one.
2016-03-29 15:52:23 -05:00
Dan Williams 8b6a1ac62f core: don't leak ActiveConnection object on AddAndActivate failure 2016-03-29 15:52:23 -05:00
Dan Williams f2182fbf9b core: don't emit double PropertiesChanged signal for new active connections
When porting to GDBus property change notifications were converted from a
hash table to a GVariantBuilder.  GVariantBuilder doesn't care about
duplicated properties in the dict so each g_object_notify() will add
an additional item with possibly different values:

signal time=1458571005.592811 sender=:1.10 -> destination=(null destination) serial=64451 path=/org/freedesktop/NetworkManager; interface=org.freedesktop.NetworkManager; member=PropertiesChanged
   array [
      dict entry(
         string "ActiveConnections"
         variant             array [
               object path "/org/freedesktop/NetworkManager/ActiveConnection/19"
               object path "/org/freedesktop/NetworkManager/ActiveConnection/18"
               object path "/org/freedesktop/NetworkManager/ActiveConnection/15"
               object path "/org/freedesktop/NetworkManager/ActiveConnection/0"
            ]
      )
      dict entry(
         string "ActiveConnections"
         variant             array [
               object path "/org/freedesktop/NetworkManager/ActiveConnection/24"
               object path "/org/freedesktop/NetworkManager/ActiveConnection/19"
               object path "/org/freedesktop/NetworkManager/ActiveConnection/18"
               object path "/org/freedesktop/NetworkManager/ActiveConnection/15"
               object path "/org/freedesktop/NetworkManager/ActiveConnection/0"
            ]
      )
   ]

Fix that by not emitting notify events for the manager's ActiveConnections
property until the property has actually been updated in active_connection_add().
The unexport also isn't required for VPN connections since it will get
unexported when it's disposed after _internal_activation_failed() gets called.
2016-03-29 15:52:23 -05:00
Robby Workman c0a506648f settings: add persistent hostname support for Slackware 2016-03-29 15:51:34 -05:00
Piotr Drąg 743107e163 po: update Polish (pl) translation (bgo #764317)
https://bugzilla.gnome.org/show_bug.cgi?id=764317
2016-03-29 18:20:30 +02:00
Beniamino Galvani 6e738c83f1 merge: branch 'bg/bond-options-rh1299103'
Add missing bond options and improve connection matching for bond
connections.
2016-03-29 18:10:35 +02:00
Beniamino Galvani efa559bcc8 libnm-core: add test cases for NMSettingBond
The setting well deserves some testing.
2016-03-29 18:10:05 +02:00
Beniamino Galvani 4839c747c2 libnm-core: implement option matching for NMSettingBond
We cannot simply compare the single values of option hashes to match
connections because some keys are equivalent to others and also
because keys having a default value should be ignored.

Add the compare_property method to implement custom comparison logic.
2016-03-29 18:10:05 +02:00
Beniamino Galvani 260fcc52a8 bond: add some missing options
https://bugzilla.redhat.com/show_bug.cgi?id=1299103
2016-03-29 18:10:05 +02:00
Beniamino Galvani 2324410a75 bond: fix re-assuming of connections
When a value of a TYPE_BOTH option is read back from kernel it
contains both string and numeric values ("balance-rr 0"), so we must
chop off the number before adding the option to the setting. Also
change the default values of options to the string form so that the
option matching logic works.
2016-03-29 18:10:05 +02:00
Beniamino Galvani a9241773d7 cli: allow setting multiple IPs in bond 'arp_ip_target' option
The bond 'arp_ip_target' option contains a list of comma-separated IP
addresses; but comma is also used to separate options and so at the
moment it is not possible to specify multiple IPs as the command

 $ nmcli c m b1 bond.options \
   mode=0,arp_interval=1,arp_ip_target=1.1.1.1,2.2.2.2

interprets 2.2.2.2 as the next option.

Allows spaces to be used as separators for the IPs of the
'arp_ip_target':

 $ nmcli c m b1 bond.options \
   "mode=0,arp_interval=1,arp_ip_target=1.1.1.1 2.2.2.2"
2016-03-29 18:10:05 +02:00
Beniamino Galvani 5f7d7ee497 libnm,libnm-core: add coverage support 2016-03-29 18:10:04 +02:00
Beniamino Galvani e196f2257d libnm-core: fix check in verification of NMSettingBond 2016-03-29 18:10:04 +02:00
Lubomir Rintel 24caeb33b7 release: bump version to 1.1.92 (1.2-beta3) 2016-03-29 16:23:21 +02:00
Lubomir Rintel dbdb455cc8 release: update NEWS 2016-03-29 16:10:25 +02:00
Thomas Haller ff06754fe8 core: downgrade warning logging message when creating virtual device
This can regularly happen when a virtual device depends on a parent/master
that is not yet created. We will retry later when the parent is ready, so
logging a warning about it is wrong and confusing.
2016-03-29 15:46:17 +02:00
Lubomir Rintel 0684632936 libnm: don't check if the agent is still registered when unregistering
The name_owner_chagned() unregisters the agent if NetworkManager goes away and
nmc_cleanup() also tries to unregister an agent, resulting in an assertion
failure:

  # nmcli c up conn666
  <daemon terminates>
  Error: Connection activation failed: Message recipient disconnected from message bus without replying
  (process:8746): libnm-CRITICAL **: nm_secret_agent_old_unregister: assertion 'priv->registered == TRUE' failed

_internal_unregister() already contains a priv->registered check and raising an
error on duplicate unregister attempt from a daemon after a restart is not a
problem either, since nmc_cleanup() doesn't care about the error returned
on teardown anyway.
2016-03-29 15:08:19 +02:00