Commit graph

13297 commits

Author SHA1 Message Date
Thomas Haller 98c37fed43 wifi: reimplement use of libnl-genl-3 library 2015-11-01 17:28:07 +01:00
Thomas Haller a2e58e6e91 wifi/trivial: fix whitespace and indention in "wifi-utils-nl80211.c" 2015-11-01 17:28:07 +01:00
Thomas Haller 59af27ddb9 dnsmasq/tests: minor refactoring in test 2015-11-01 17:28:07 +01:00
Thomas Haller abd607257b macros: add nm_sprintf_buf() helper macro 2015-11-01 17:28:07 +01:00
Thomas Haller 204fcd33d8 macros: add nm_clear_g_cancellable() utility 2015-11-01 17:28:07 +01:00
Thomas Haller 88a2f1c93b tests: handle no_expect_message also for tests without assert-logging 2015-11-01 17:28:07 +01:00
Thomas Haller d5ef08e01e tests: add nmtst_rand_perm() utility 2015-11-01 17:28:07 +01:00
Thomas Haller 09983442bd tests: add nmtst_assert_ip4_address() and nmtst_assert_ip6_address() utility method 2015-11-01 17:28:07 +01:00
Thomas Haller 59ae981b22 platform: fix reading dst-port and src-port-range for vxlan
This was broken since introducing vxlan support.
2015-11-01 17:28:07 +01:00
Thomas Haller 1a6f4d08ba vpn-connection: fix parsing IPv4 routes
Fixes: 3b145a33b7
2015-11-01 17:23:24 +01:00
Lubomir Rintel 6a5595fc1a merge: branch 'lr/tunnelled-route'
https://bugzilla.gnome.org/show_bug.cgi?id=757287
2015-11-01 11:31:23 +01:00
Lubomir Rintel 3b145a33b7 vpn-connections: allow the plugin to specify route preferred src
Tunnelled VPNs can need that so that correct source address is used for tunnel
routes.
2015-11-01 11:28:10 +01:00
Lubomir Rintel 698f54456f platform: correct the type for route.pref_src
It's an IPv4 address.
2015-11-01 11:28:10 +01:00
Lubomir Rintel 5c1c577c31 vpn-connections: set ifname for tunelled VPN configuration
The configuration is going to be applied on the parent interface.

If we didn't do this, an attempt to add a route would result in an assertion
failure:

  nm-ip4-config.c:1475:nm_ip4_config_add_route: assertion failed: (priv->ifindex)
2015-11-01 11:28:10 +01:00
Lubomir Rintel 6e5fbf096a test: don't fail if setting /sys as a slave mount doesn't succeed
Maybe it's not mounted in the first place. We could be running in a chroot
without /sys mounted, etc.

Also, the error message was wrong.
2015-10-31 22:38:24 +01:00
Thomas Haller ea00693b00 systemd/lldp: avoid compiler warnings in lldp_tfl_package_read* functions
gcc 5.1.1 wrongly warns about uninitialized variable @r2 when compiling
with -Og. Refactor the code to avoid the warnings.

Related: https://github.com/systemd/systemd/pull/1735
2015-10-31 14:39:04 +01:00
Thomas Haller da7cc97f5e libnm/tests: avoid invalid compiler warning about uninitialized variable
make[5]: Entering directory './NetworkManager/libnm-core/tests'
    CC       test-general.o
  test-general.c: In function ‘test_g_hash_table_get_keys_as_array’:
  test-general.c:4552:69: error: ‘length’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  test-general.c:4543:8: note: ‘length’ was declared here
    guint length;
          ^
2015-10-31 13:42:51 +01:00
Jiří Klimeš 6cd5cc595f dispatcher: fix abort in case of an error (rh #1275813)
request_free() can be called on an error.

Oct 27 20:27:46 localhost.localdomain nm-dispatcher[2328]: #1 'pre-up': completed: invalid request: Missing or invalid required value path!
Oct 27 20:27:46 localhost.localdomain nm-dispatcher[2328]: **
Oct 27 20:27:46 localhost.localdomain nm-dispatcher[2328]: ERROR:nm-dispatcher.c:203:request_free: assertion failed (request->num_scripts_done == request->scripts->len): (0 == 1)

Fixes: 1999723241

https://bugzilla.redhat.com/show_bug.cgi?id=1275813
2015-10-30 14:00:15 +01:00
Martin Pitt b42098f4d0 systemd: stop blocking network.target in NetworkManager-wait-online.service
network.target is a very early boot target which basically says "I can start
opening sockets now". It has nothing to do with being connected to the internet
and is often required by early boot services as well.

Drop the unnecessary and wrong Wants=/Before=network.target to avoid dependency
cycles and boot delays.

https://bugzilla.gnome.org/show_bug.cgi?id=746039
https://launchpad.net/1430280
2015-10-30 11:37:09 +01:00
Martin Pitt c8ca35bff9 systemd: install NetworkManager-wait-online.service into network-online.target
This unit "implements" network-online.target, which is fairly independent from
multi-user.target, so specify the correct install target.

https://bugzilla.gnome.org/show_bug.cgi?id=746039
https://launchpad.net/1430280
2015-10-30 11:37:09 +01:00
Mathieu Trudel-Lapierre 65f6b17cbd libnm-glib: properly handle demarshalling 64-bit integers.
You can't use g_value_get_(u)int for gint64/guint64.
2015-10-30 11:36:13 +01:00
Lubomir Rintel a07f1000ba dns-unbound: use the correct path when calling dnssec-trigger-script
Debian systems don't have /usr/libexec, so the script is installed in
a different path.

Based on a patch from Arto Jantunen <viiru@debian.org>
2015-10-30 11:15:51 +01:00
Beniamino Galvani c24c5895f3 man: fix indentation in nmcli manual page
Fixes: 721e917cb6
2015-10-29 14:00:32 +01:00
Beniamino Galvani d9d77d054d platform: fix gcc warning about comparison between enums
gcc complains with the following warning:

"comparison between 'enum <anonymous>' and 'enum vlan_flags'"

Cast one side of the comparison to avoid that.

Fixes: ee7414ebc8
2015-10-27 18:26:04 +01:00
Thomas Haller d07cf5c96c vlan: merge branch 'jk/vlan-assume-and-fixes'
https://bugzilla.gnome.org/show_bug.cgi?id=754433
2015-10-27 17:26:38 +01:00
Thomas Haller ee7414ebc8 platform: NM defines for vlan header flags equal the linux headers 2015-10-27 17:24:52 +01:00
Jiří Klimeš 6142dc960b tests: add a testcase for matching VLAN connections 2015-10-27 17:17:06 +01:00
Jiří Klimeš 689de5c94a vlan: (all) add VLAN MVRP flag
http://patchwork.ozlabs.org/patch/219364/
2015-10-27 17:17:05 +01:00
Jiří Klimeš 93b8871f56 libnm: sort INGRESS_PRIORITY_MAP, EGRESS_PRIORITY_MAP properties
This fixes comparing the properties.

Priority map { 1:2, 2:5 } is actually the same as { 2:5, 1:2 }.
2015-10-27 17:17:05 +01:00
Jiří Klimeš 704930a045 libnm: do not add duplicates to VLAN priority mappings 2015-10-27 16:31:29 +01:00
Jiří Klimeš 48b8f57468 platform: remove unnecessary rtnl_link_set_type (change, "vlan")
The type is set by build_rtnl_link().
2015-10-27 16:29:18 +01:00
Jiří Klimeš 22a0136bcb ifcfg-rh: read/write VLAN GVRP flags with GVRP= ifcfg file variable
initscripts uses GVRP variable for the flag (since 2011):
https://git.fedorahosted.org/cgit/initscripts.git/commit/?id=f662d4777625cd3bedea19cccabea7741a8b45c9

But continue reading "GVRP" from VLAN_FLAG= if GVRP= is missing.
2015-10-27 16:26:37 +01:00
Jiří Klimeš db62fc9d72 platform: fix adding VLAN flags
We need to unset flags first.
2015-10-27 16:23:10 +01:00
Lubomir Rintel 3385dcdc5a gitignore: ignore more generated D-Bus glue 2015-10-27 15:31:13 +01:00
Dan Williams 0e3086e8b8 bluetooth: fix missing 'connected' notifications (rh #1255284)
Because Bluez5 dropped DUN support, NM must do that manually which
includes emulating the "connected" property for Bluetooth devices when
DUN is used.  It does this by setting priv->connected = TRUE in
nm_bluez_device_connect_finish().

But for PAN, when NM does process the 'connected' property change
notification, priv->connected is already TRUE and
_take_variant_property_connected() does nothing.  Hence the
corresponding GObject property notification is not emitted,
nm-device-bt.c::check_connect_continue() will never return success, and
the activation times out.

To fix this, ensure that GObject notifications are emitted when the
device is connected, even if emulated internally.

https://mail.gnome.org/archives/networkmanager-list/2015-October/msg00053.html
https://bugzilla.redhat.com/show_bug.cgi?id=1255284
2015-10-25 19:47:43 +01:00
Lubomir Rintel 3621c2dd1e agent-manager: fix up bad cherry-pick from 1.0
Fixes: 5d1cac81a0
2015-10-23 18:54:09 +02:00
Lubomir Rintel a5feb44a44 libnm,vpn-service-plugin: remove old connect timer when adding new one
If the plugin didn't succeed connecting once, don't let the old timer fire
during a subsequent connection.

https://bugzilla.redhat.com/show_bug.cgi?id=1271973
2015-10-23 18:24:45 +02:00
Lubomir Rintel 842889bc5b libnm-glib,vpn-plugin: remove old connect timer when adding new one
If the plugin didn't succeed connecting once, don't let the old timer fire
during a subsequent connection.

https://bugzilla.redhat.com/show_bug.cgi?id=1271973
2015-10-23 18:24:07 +02:00
Lubomir Rintel 5d1cac81a0 agent-manager: cancel secrets requests on an error
It might be that the user didn't supply the secrets in time and the dbus call
timed out. The agent should now hide the secrets dialog and we must let it know.

https://bugzilla.redhat.com/show_bug.cgi?id=1272023
2015-10-23 18:21:25 +02:00
Thomas Haller e01c17523a contrib/rpm: remove NetworkManager-devel package
NetworkManager-devel package contained development headers that
are useful without libnm-glib and without glib. But it is also
based on the legacy libnm-glib library as it has headers like
"/usr/include/NetworkManager/NetworkManager.h".

A glib-free devel package based on the new libnm library would
be needed to provide "/usr/include/libnm/nm-dbus-interface.h".

But that would amount to 4 devel packages. Instead, just move
the content of NetworkManager-devel into NetworkManager-glib-devel
package.

Note that NetworkManager-devel already contained several truely
libnm-glib dependent files, like the vala bindings (which require
libnm-glib). So that was another bug in the packaging and is fixed
by moving it all to NetworkManager-glib-devel.

https://bugzilla.gnome.org/show_bug.cgi?id=755938
2015-10-23 12:41:55 +02:00
Jiří Klimeš 696a443e98 cli: improve error reporting of missing 'ifname' parameter
Example:
before:
$ nmcli c add type gsm con-nameX aaa ifname fsd
Error: 'ifname' argument is required.

now:
$ nmcli c add type gsm con-nameX aaa ifname fsd
Error: mandatory 'ifname' not seen before 'con-nameX'.
2015-10-23 12:28:29 +02:00
Jiří Klimeš b45bd96d89 cli: trivial: correct argument description for nmc_parse_args() 2015-10-23 12:28:29 +02:00
Lubomir Rintel e9c88ba9de dbus: add strongswan to the vpn plugin bus names 2015-10-23 12:05:48 +02:00
Lubomir Rintel a426f7f396 dbus: don't do <deny send_interface="..." /> in dbus service file
It does more than intended; apart from denying messages to that particular
interface it also denies all messages non-qualified with an interface globally.
From the dbus-daemon manual:

  Be careful with send_interface/receive_interface, because the
  interface field in messages is optional. In particular, do NOT
  specify <deny send_interface="org.foo.Bar"/>! This will cause
  no-interface messages to be blocked for all services, which is almost
  certainly not what you intended. Always use rules of the form: <deny
  send_interface="org.foo.Bar" send_destination="org.foo.Service"/>

We can just safely remove those rules, since we're sufficiently protected
by the send_destination matches and method calls are disallowed by default
anyway.
2015-10-23 12:05:47 +02:00
Thomas Haller 6ae618ef97 libnm: merge branch 'th/vlan-reorder-hdr-rh1250225'
https://bugzilla.redhat.com/show_bug.cgi?id=1250225
2015-10-23 11:26:33 +02:00
Thomas Haller 21674d5bfb libnm: treat missing NMSettingVlan:flags property as old default value
We changed the default value of MSettingVlan:flags from 0 to
1 (NM_VLAN_FLAG_REORDER_HEADERS). That means, that old libnm
clients will not serialize 0 (their default).
This change broke the D-Bus API. The D-Bus API allows to omit a value
when meaning the default value. That means, we cannot change the
default value (in the D-Bus API!) without breaking previous assumptions.

A newer libnm version should treat a missing flags argument as the
old default value and thus preserve the original default value (in the
D-Bus API).

This has the downside that for the future we will continue to treat a missing
value as the old default value (0), and in order to get the new default
value (1), the client must explicitly set the flags.

We also must restore the original default value in libnm-glib.
libnm-glib does not support _nm_setting_class_override_property()
and thus it must keep thinking that the default value for the GObject
property continues to be 0. Otherwise, it would not serialize a 1, which
a new libnm would now interpret as 0.

https://bugzilla.redhat.com/show_bug.cgi?id=1250225

Fixes: 687b651598
2015-10-23 11:23:46 +02:00
Thomas Haller 7a14f19e09 libnm: always serialize NMSettingVlan:flags property for D-Bus
We changed the default value for the NMSettingVlan:flags from 0 to
1 (NM_VLAN_FLAG_REORDER_HEADERS). That means, we will no longer serialize
a value of 1 over D-Bus.

This breaks older libnm clients, which treat a missing flags property as
the old default (0).

-- old clients here means: clients that still use an older version of libnm
   or clients that don't use libnm, but depend on the previous default value
   in the D-Bus API.

Enforce to always serialize the flags properties. This workaround has almost
no downsides except that for new clients we serialize more then absolutely
necessary.
But it ensures that old clients still receive the proper value.

https://bugzilla.redhat.com/show_bug.cgi?id=1250225

Fixes: 687b651598
2015-10-23 11:22:59 +02:00
Jiří Klimeš e9bc18d2a7 wifi: do no crash when getting BSSID fails
https://bodhi.fedoraproject.org/updates/NetworkManager-1.0.6-7.fc23#comment-342089
2015-10-22 10:27:14 +02:00
Jiří Klimeš 5fa369e95c wifi: fix a problem in removing non-existing source
GLib-CRITICAL **: Source ID 4197 was not found when attempting to remove it
2015-10-22 10:19:21 +02:00
Beniamino Galvani 97b14a21e4 ifcfg-rh: fix memory leak in reading of LLDP property
Fixes: 5966e14abf
2015-10-21 13:49:27 +02:00