Commit Graph

15047 Commits

Author SHA1 Message Date
Dan Williams
4a6ded1cfd supplicant: fix handling of 'freq_list' option and band locking (bgo #737795)
The supplicant has a custom parsing function for freq_list which
handles the list as a string.  Having NM marshal the option
as TYPE_BYTES causes the supplicant to interpret the values that
NM passes (which are in ASCII) as a byte-array and thus the
supplicant gets a bogus frequency list.  Instead, NM should
marshal freq_list as a simple string (using TYPE_KEYWORD without
value checking).

https://bugzilla.gnome.org/show_bug.cgi?id=737795
2014-10-08 21:55:20 -05:00
Thomas Haller
f77297ec85 ifnet: fix parsing dhcp configuration
- fix memleaks if the script contains duplicate lines
- only accept either dhclient or dhcpcd syntax, depending
  on the file
- be more strikt in parsing:
  - don't use strstr() when parsing dhcpcd.conf. It wrongly
    accepts "# send dhcp-client-identifier".
  - enfore that keyword are terminated by space. Would no longer
    accept "hostnameHOSTNAME"
- be less strict in parsing:
  - accept any number of spaces between "send" and "host-name"/
    "dhcp-client-identifier"

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-08 23:02:12 +02:00
Nilamdyuti Goswami
b6cf21543e po: update Assamese (as) translation (bgo #738105)
https://bugzilla.gnome.org/show_bug.cgi?id=738105

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-08 22:41:57 +02:00
Dan Winship
81e236455d tui: master/slave deletion fixes (rh #1131574) 2014-10-08 10:20:28 -04:00
Dan Winship
66f19feef9 tui: when deleting a bridge/bond/team, delete its slaves too (rh #1131574) 2014-10-08 10:20:18 -04:00
Dan Winship
27650c2198 tui: show orphaned slaves in the connection editor list
If a master is deleted but its slaves are left behind, show those
slaves in the appropriate part of the connection list, so they can be
deleted. (This code is just copied from nm-connection-editor.)
2014-10-08 10:20:18 -04:00
Dan Winship
754a5d01f0 tui: fix multiple route editor bugs (rh #1149175)
Fix nmtui route editor bugs introduced in 98375657.
2014-10-08 10:18:42 -04:00
Dan Winship
4f9f33fc35 tui: fix some valgrind warnings
nmt_newt_grid_size_allocate() depends on nmt_newt_grid_size_request()
having been called immediately prior, which would normally be true,
except that NmtNewtSection adjusts the label widgets in its border to
match its allocation, so when its size changes, it will end up calling
size_allocate() on the border with out-of-date requisition data. Fix
that by re-size_requesting the border after modifying it.

https://bugzilla.gnome.org/show_bug.cgi?id=738010
2014-10-07 07:54:47 -04:00
sray
9c02e1c742 po: update Bengali bn_IN translation (rh #738055)
https://bugzilla.gnome.org/show_bug.cgi?id=738055

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-07 12:31:28 +02:00
Dimitris Spingos
c2cd6c8315 po: update Greek (el) translation (bgo #737972)
https://bugzilla.gnome.org/show_bug.cgi?id=737972

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-07 11:39:17 +02:00
Jiří Klimeš
f4cd7dec11 cli: fix setting secrets flags 2014-10-06 17:03:22 +02:00
Thomas Haller
50bd216a50 test: fix check-local in Makefile to print newline after message
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-06 16:42:51 +02:00
Jiří Klimeš
0fa6e75b14 cli: fix setting SSID property in the editor
SSID is now GBytes, not GByteArray.
2014-10-06 15:43:37 +02:00
Jiří Klimeš
e7666a8532 tui: fix accessing NULL in g_bytes_get_data()
GLib-CRITICAL **: g_bytes_get_size: assertion 'bytes != NULL' failed
GLib-CRITICAL **: g_bytes_get_data: assertion 'bytes != NULL' failed
libnm-CRITICAL **: nm_utils_ssid_to_utf8: assertion 'ssid != NULL' failed
GLib-CRITICAL **: g_bytes_get_size: assertion 'bytes != NULL' failed
GLib-CRITICAL **: g_bytes_get_data: assertion 'bytes != NULL' failed
libnm-CRITICAL **: nm_utils_ssid_to_utf8: assertion 'ssid != NULL' failed

Additional fixes to commit 4359e556e4.
2014-10-06 13:52:43 +02:00
Thomas Haller
33e50e817b logging: merge branch 'th/bgo737593_log_trace'
https://bugzilla.gnome.org/show_bug.cgi?id=737593

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-05 20:31:59 +02:00
Thomas Haller
1ac3a1de23 core/dbus: log messages in nm-dbus-manager.c with "TRACE" priority
The messages logged by nm-dbus-manager.c are not very useful, but amount to
a significant part of DEBUG logging. Log those messages with the lower TRACE priority.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-05 18:24:36 +02:00
Thomas Haller
bdea7d61d0 logging: add new logging level "TRACE"
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-05 18:24:36 +02:00
Dan Winship
c9e0e66a80 libnm, libnm-glib: clarify nm_client_activate_connection() semantics
nm_client_activate_connection() and
nm_client_add_and_activate_connection() return when the activation has
*started*, not when it *finishes*. Clarify this a bit more in the
libnm docs, and copy that clarification to libnm-glib as well.

https://bugzilla.gnome.org/show_bug.cgi?id=736233
2014-10-05 11:21:16 -04:00
Lubomir Rintel
5a040b4058 device: drop leftover bad assert
NetworkManager:ERROR:devices/nm-device.c:7089:nm_device_update_hw_address: assertion failed: (hwaddrlen <= sizeof (priv->hw_addr))
Aborted (core dumped)

Breaks 32-bit, works on 64-bit by dumb luck.

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

Fixes: b019348fdd
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-05 11:29:33 +02:00
Dan Winship
9bd603b4d2 libnm: make use of GParamSpecFlags and GParamSpecEnum (bgo #737485) 2014-10-03 17:23:20 -04:00
Dan Winship
a91e60902e libnm-core: make NMSettingSerial:parity an enum
NMSettingSerial:parity was defined as a char-typed property that could
have the (case-sensitive!) values 'n', 'E', or 'o'. This is zany. Add
an NMSettingSerialParity enum, and use that instead.
2014-10-03 09:36:28 -04:00
Dan Winship
fcfb4b40ba libnm: make use of GParamSpecFlags and GParamSpecEnum
Make enum- and flags-valued properties use GParamSpecEnum and
GParamSpecFlags, for better introspectability/bindability.

This requires no changes outside libnm-core/libnm since the expected
data size is still the same with g_object_get()/g_object_set(), and
GLib will internally convert between int/uint and enum/flags GValues
when using g_object_get_property()/g_object_set_property().
2014-10-03 09:36:28 -04:00
Dan Winship
ad25e5c970 libnm: reorganize demarshal_generic(), make unrecognized type a warning
Redo the HANDLE_TYPE macro in demarshal_generic() in a more
syntactically-sane way (both to help the editor with indentation and
to make it not look so weird).

Also, if demarshal_generic() is asked to handle a property of a type
that it doesn't know how to handle, that's a programmer error, so do a
g_warning() in that case (as opposed to being asked to demarshal a
value of the wrong D-Bus type, which could just be a bug in the peer
that sent the data, so that stays as a debug message).
2014-10-03 09:36:28 -04:00
Dan Winship
5c2d2eed30 libnm: fix properties-changed debug logging
The code was mistakenly still using G_VALUE_TYPE_NAME() instead of
g_variant_get_type_string().

Also, refer to the properties with standard gtk-doc punctuation:
"TypeName:property-name".
2014-10-03 09:36:27 -04:00
Thomas Haller
3b1528417a bond: fix setting bond option 'lacp_rate'
Setting 'lacp_rate' is only possible in '802.3ad' (4) mode.
Otherwise writing to sysctl fails and results in the following
error log:

    <error> [1412337854.026285] [platform/nm-linux-platform.c:2093] sysctl_set(): sysctl: failed to set '/sys/class/net/nm-bond/bonding/lacp_rate' to '0': (13) Permission denied
    <warn>  (nm-bond): failed to set bonding attribute 'lacp_rate' to '0'

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

Fixes: 47555449fa
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 14:53:06 +02:00
Jiří Klimeš
b365a38bc3 build: fix compilation with GLib 2.32 2014-10-03 13:57:44 +02:00
Thomas Haller
a64de150c3 contrib/rpm: detect ppp version based on installed package
Also fixes build failure if user had no /sbin/pppd in its $PATH.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 12:49:19 +02:00
Thomas Haller
d4cd8b5785 libnm: merge branch 'th/bgo737725-libnm-private-dbus-connection'
https://bugzilla.gnome.org/show_bug.cgi?id=737725

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 12:46:24 +02:00
Thomas Haller
97b2c1b0d1 libnm: share private DBUS connection
Cache the private DBUS connection and reuse it. Otherwise we end up
creating several private connnections, as an NMObject instance creates
a new connection (unless it is passed in as NMObject:dbus-connection
property).

We already pass the existing "parent" DBUS connection when creating
the proxy objects. However, when creating two independent objects
(e.g. nm_client_new() and nm_remote_settings_new()), their private
DBUS connections were not shared.

Implement this sharing inside nm-dbus-helpers.c

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 11:21:40 +02:00
Thomas Haller
df57b6b4d1 libnm: add NMObject:dbus-connection property to inject DBUS connection
Commit b732380d1e removed the gobject
property "NMObject:connection". However, this property is still needed
to inject the DBUS connection when creating new proxy objects. Without it,
we call _nm_dbus_new_connection() in the constructor for every proxy NMObject.

In case of non-private connections, g_bus_get_sync() already returns the same
connection. However for private connections, g_dbus_connection_new_for_address_sync()
would create a separate DBUS connection.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 11:21:17 +02:00
Thomas Haller
284a14d62f libnm: assert for interface name in _nm_object_class_add_interface()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 11:21:17 +02:00
Thomas Haller
94331184d8 libnm: remove unused variable NMObjectPrivate:private_connection
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 11:21:17 +02:00
Thomas Haller
52ccce8c2c core/dbus: debug log unix file descriptor when closing private dbus connection
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 11:21:17 +02:00
Thomas Haller
20a746f68a contrib/rpm: fix --quick option of build_clean.sh
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-03 11:02:46 +02:00
Dan Williams
e80d03b5fa merge: fix DHCP 'expire' state handling (rh #1139326) (bgo #737225) 2014-10-02 15:03:00 -05:00
Dan Williams
90a77565d4 dhcp: treat lease expiry as failure (rh #1139326)
Lease expiry means that the DHCP configuration is no longer valid, and
that all attempts to renew/rebind the lease have failed.  The IP config
needs to be removed.  NetworkManager also sets prefered/valid lifetimes
on addresses, so the kernel will remove them when the lease expires
anyway.  That causes removal of the default route, if the default route
was through the device whose config has now expired.

DHCP clients will typically move to the 'renew' or 'rebind' states when
nearing lease expiry, then if no answer is received move to the 'expire'
state.  Eventually they move to the 'fail' state when all attempts to
contact the server have failed.

Previously, since NM ignored the 'expire' DHCP state it would not clear
out the DHCP IP4 config immediately when the lease expired, instead
waiting for the DHCP client to move to the 'fail' state.  But if the
DHCP server appeared between the 'expire' and 'fail' states, NM would
not notice and the device's NMIP4Config would not change, and thus the
Policy would not get the "ip4-config-changed" signal to re-add the
default route that the kernel had previously removed due to the valid
lifetime reaching zero when the lease expired.

https://bugzilla.redhat.com/show_bug.cgi?id=1139326
2014-10-02 15:02:44 -05:00
Dan Williams
acee2eb9e4 dhcp: fail the device if DHCP fails after having succeeded earlier (rh #1139326)
If DHCP fails to renew or rebind a lease, fail the device since the
IP config is no longer valid.  Commit e2b7c482 was actually wrong for
dhcp[4|6]_fail(), since (ip_state == IP_FAIL) will never be true if
DHCP has ever been started, as IP_FAIL is only set from
nm_device_activate_ip[4|6]_config_timeout(), which obviously will not
be called in DHCP code paths if DHCP has previously succeeded.
2014-10-02 15:02:43 -05:00
Dan Winship
e2f5343b08 tui: fix an NmtMacEntry bug introduced when changing hwaddrs to strings
https://bugzilla.redhat.com/show_bug.cgi?id=1148921
2014-10-02 13:18:26 -04:00
Thomas Haller
90b5b4d892 merge branch 'th/rh1061702_bond_options'
Add bonding option 'lacp_rate'.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-02 16:38:21 +02:00
Thomas Haller
b662fbf450 cli: support new bond option 'lacp_rate'
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-02 16:36:11 +02:00
Thomas Haller
47555449fa libnm: add bonding option "lacp_rate" to NMSettingBond
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-02 16:36:03 +02:00
Lubomir Rintel
53b9504544 contrib/rpm: don't hardwire a single ppp version
Build against whatever is actually present.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-02 16:31:05 +02:00
Thomas Haller
ca2145bef2 core: minor fix in nm_utils_kill_child_sync() having side-effects in MIN() macro (again)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-02 11:27:22 +02:00
Thomas Haller
1e4dd48698 core: minor fix in nm_utils_kill_child_sync() having side-effects in MIN() macro
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-01 16:29:21 +02:00
Thomas Haller
aadae3256e cli: fix NetworkManager.pot after renmaing network-manager.[ch] to general.[ch]
Fixes: f585085907
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-01 14:34:56 +02:00
Jiří Klimeš
7e67fd2b24 libnm: return errors in nm_client_networking_set_enabled()
and do not print an error in the library. The caller can decide what to do
on an error.
2014-10-01 11:53:07 +02:00
Jiří Klimeš
8919a8572a cli: strip errors from D-Bus before presenting to a user 2014-10-01 11:53:07 +02:00
Jiří Klimeš
f585085907 cli: rename network-manager.[ch] to general.[ch] 2014-10-01 11:53:07 +02:00
Jiří Klimeš
cf72286421 libnm: fix argument type passed to RequestScan() D-Bus call
GLib-ERROR **: g_variant_new: expected GVariant of type `a{sv}' but received value has type `aa{sv}'
2014-10-01 11:53:07 +02:00
Michael Biebl
8f6317f88a build: support building against libsystemd >= 209 library
In systemd v209, the various libraries were merged into a single
libsystemd library [1].
Add support for building against this new library and fall back to the
old library names if not found.

[1] http://lists.freedesktop.org/archives/systemd-devel/2014-February/017146.html
2014-09-30 12:34:24 -05:00