Commit Graph

13873 Commits

Author SHA1 Message Date
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
Thomas Haller
58fc4381ff ifcfg-rh: remove another unused variable in parse_ethtool_option() 2015-10-20 17:43:05 +02:00
Thomas Haller
f840d9465f ifcfg-rh: remove unused variable in parse_ethtool_option() 2015-10-20 17:40:30 +02:00
Thomas Haller
fd7d57be03 platform/trivial: rename "auto_nmp_obj" macro to "nm_auto_nmpobj"
A define in a header file should have an "NM" prefix. Also,
let's have "nm_auto_" as a prefix for cleanup macros beside
libgsystem's "gs_".
2015-10-20 14:43:54 +02:00
Thomas Haller
638528d312 platform: move static asserts from header to source file
No point in having every user of the header file evaluate the
static assertion.
2015-10-20 14:08:04 +02:00
Jiří Klimeš
91dde2c865 nmcli: fix bash completion of words containing colon (rh #1271271)
Test:
$ sudo ip link add a🅱️c type dummy
$ nmcli device delete<Tab><Tab>
$ nmcli device delete a<Tab>

See also:
http://stackoverflow.com/questions/28479216/how-to-give-correct-suggestions-to-tab-complete-when-my-words-contains-colons
http://stackoverflow.com/questions/2805412/bash-completion-for-maven-escapes-colon/12495727

Related: https://bugzilla.gnome.org/show_bug.cgi?id=745157

https://bugzilla.redhat.com/show_bug.cgi?id=1271271
2015-10-20 12:00:39 +02:00
Christian Kirbach
817ce6f72c po: update German (de) translation (bgo #756768)
https://bugzilla.gnome.org/show_bug.cgi?id=756768
2015-10-19 17:00:48 +02:00
Thomas Haller
e5f7fa314c core: merge branch 'th/wait-carrier-rh1079353'
The wait-for-carrier patches from rh#1079353 had several
issues. With this, the feature should work mostly.

https://bugzilla.redhat.com/show_bug.cgi?id=1079353
2015-10-19 15:45:38 +02:00
Thomas Haller
839330cd39 device: properly cancel queued activation request
We would leak the NMActivationRequest when carrier didn't
come within timeout. We must properly set the state of the
activation request.

https://bugzilla.redhat.com/show_bug.cgi?id=1079353
Fixes: 0bfe635119
2015-10-19 15:17:42 +02:00
Thomas Haller
118de885ea device: don't wait for carrier when activating static connection
When the connection to be activated doesn't require carrier,
don't queue it to wait for it.

https://bugzilla.redhat.com/show_bug.cgi?id=1079353
Fixes: 0bfe635119
2015-10-19 14:45:17 +02:00
Thomas Haller
c89fd1ea76 device: refactor using nm_clear_g_source() for priv->carrier_wait_id 2015-10-19 14:26:52 +02:00
Thomas Haller
cff3e93527 manager: fix activation without specified device
For an explicit user-request, we relax some checks when searching for a suitable
device; such as requiring-carrier.

Without this patch, a connection-up while the device has no carrier yet,
would fail right away with "No suitable device found for this connection."

https://bugzilla.redhat.com/show_bug.cgi?id=1079353
Fixes: 0bfe635119
2015-10-19 14:16:50 +02:00
Thomas Haller
8a6afe92c1 platform: fix link-detection for s390 CTC-type devices
Commit 02c6a93343 (rh#1212118)
introduced detection of CTC devices based on the driver name.

That was broken a while ago while refactoring.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1212118
https://bugzilla.redhat.com/show_bug.cgi?id=1272974

Fixes: ddaea22332
2015-10-19 12:24:39 +02:00
Beniamino Galvani
571f0dba38 core: fix conversion of nameservers to GValue in NMIP6Config
Fixes: 6c8f860820
2015-10-18 15:19:35 +02:00
Beniamino Galvani
2f780dc1b5 libnm: define NMLldpNeighbor as boxed type
GLib introspection requires all types returned by public functions to
be GObjects, basic types or boxed types in order to correctly manage
resources. NMLldpNeighbor was a plain struct and GI complained with:

Warning: NM: nm_lldp_neighbor_new: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)

To fix this define NMLldpNeighbor as a boxed type.

Fixes: d3d2b49400
2015-10-16 17:33:12 +02:00
Beniamino Galvani
1136de4221 libnm,libnm-core: fix GTK-Doc warnings 2015-10-16 17:33:12 +02:00
Beniamino Galvani
b088898814 merge: branch 'bg/wol-add-ignore-option-bgo755182'
https://bugzilla.gnome.org/show_bug.cgi?id=755182
2015-10-16 17:26:27 +02:00
Thomas Haller
bd1c0086bd ifcfg-rh: improve parsing of Wake-on-LAN options
Initscripts do:
    oldifs=$IFS;
    IFS=';';
    [ -n "${ETHTOOL_DELAY}" ] && /bin/usleep ${ETHTOOL_DELAY}
    for opts in $ETHTOOL_OPTS ; do
        IFS=$oldifs;
        if [[ "${opts}" =~ [[:space:]]*- ]]; then
            /sbin/ethtool $opts
        else
            /sbin/ethtool -s ${REALDEVICE} $opts
        fi
        IFS=';';
    done
    IFS=$oldifs;

thus, we want to split on ';', otherwise we parse
  "wol d;something else"
wrong.

Also, g_strsplit_set() returns multiple empty tokens. So
we must skip over empty tokens in case of "wol    d".

The @use_password was wrong, because we would warn if sopass is specified
before wol:
  "sopass AA:BB:CC:DD:EE:FF wol g"

More resilently handle wrong configurations:
  "wol pu wol m" => gives m.
  "wol pu wol" => should give NONE and warn (instead of "pu").

Also accept tab as separator.
2015-10-16 17:11:43 +02:00
Beniamino Galvani
e587dcb16e wake-on-lan: add option to keep existing settings
Add a new 'ignore' option to NMSettingWired.wake-on-lan which disables
management of wake-on-lan by NetworkManager (i.e. the pre-existing
option will not be touched). Also, change the default behavior to be
'ignore' instead of 'disabled'.

https://bugzilla.gnome.org/show_bug.cgi?id=755182
2015-10-16 17:11:26 +02:00
Guido Günther
35802ac01c platform: fix compilation if we don't have INET6_ADDR_GEN_MODE_* constants
As in src/platform/nm-linux-platform.c

https://mail.gnome.org/archives/networkmanager-list/2015-October/msg00023.html
2015-10-15 17:44:44 +02:00
Beniamino Galvani
e9c9d02452 cli: fix creation of VLANs with a given MAC address
When a VLAN connection was added with command:

  nmcli c add type vlan ifname v10 id 10 dev 00:11:22:33:44:55

nmcli tried to assign a byte-array value to the ethernet.mac-address
string property, resulting in a invalid connection which failed to
verify. Fix this and set the value as plain string.
2015-10-15 14:30:24 +02:00
Thomas Haller
c3ccc9975e keyfile: merge branch 'th/keyfile-path-bgo755995'
https://bugzilla.gnome.org/show_bug.cgi?id=755995
2015-10-14 20:23:54 +02:00
Thomas Haller
2144457fab keyfile: make the keyfile location configurable
https://bugzilla.gnome.org/show_bug.cgi?id=755995
2015-10-14 20:23:38 +02:00
Thomas Haller
0c0cdb1c46 keyfile: remove "common.h" header
It only contained a few defines. Move them over to "utils.h".
2015-10-14 20:23:38 +02:00
Lubomir Rintel
7209356c4f manager: export the VPN connections when activating them
The vpn manager assumes it has a DBus path already.
2015-10-14 19:48:59 +02:00