Commit graph

13991 commits

Author SHA1 Message Date
Thomas Haller 34050e9c0b travis: move build script to a separate script and improve debugging for failed tests 2016-01-22 11:06:09 +01:00
Thomas Haller 0c7fa89439 libnm: assert against valid dest in NMIPRoute 2016-01-22 10:14:02 +01:00
Dan Williams 356b4ce29c platform: fix leak when netlink dump is too large 2016-01-21 12:28:13 -06:00
Thomas Haller 778207f23e core: truncate parent ifname when constructing virtual ifname for VLAN
https://bugzilla.redhat.com/show_bug.cgi?id=1300755
2016-01-21 18:49:02 +01:00
Thomas Haller 944065c115 core: check generated virtual interfaceplatform name
https://bugzilla.redhat.com/show_bug.cgi?id=1300755
2016-01-21 18:38:52 +01:00
Dan Williams f2399a6976 libnm-glib: fix leak in get_permissions_reply() 2016-01-21 11:35:00 -06:00
Dan Williams 3254965067 libnm,tests: fix error leak 2016-01-21 11:31:31 -06:00
Beniamino Galvani a4492f4145 manager: fix a couple of memory leaks
Fixes: 4dbaac4ba2
Fixes: d8e1590c50
2016-01-21 18:23:53 +01:00
Thomas Haller e1f395834a wifi/supplicant: refactor logging to use _LOG() macros 2016-01-21 17:41:32 +01:00
Thomas Haller e59c4117c4 wifi/supplicant: implement _LOG() macros 2016-01-21 17:41:32 +01:00
Lubomir Rintel e80346fff7 utils: fix error open() handling
CID 59376 (#2-1 of 2): Argument cannot be negative (NEGATIVE_RETURNS)
negative_returns: urandom is passed to a parameter that cannot be negative.
2016-01-21 16:56:19 +01:00
Lubomir Rintel 88da21caa1 linux-platform: fix accidental Python
Coverity: CID 59378 (#1 of 1): Nesting level does not match indentation
(NESTING_INDENT_MISMATCH) This statement is indented to column 41, as if
it were nested within the preceding parent statement, but it is not.
2016-01-21 16:53:56 +01:00
Lubomir Rintel d03322b2a5 linux-platform: fix a file descriptor leak
Coverity: CID 59384 (#3-1 of 3): Resource leak (RESOURCE_LEAK)26.
leaked_handle: Handle variable fd going out of scope leaks the handle
2016-01-21 16:32:23 +01:00
Thomas Haller de19bc20d0 wifi: merge branch 'th/supplicant-manager-fix-ref-count-rh1298007'
https://bugzilla.redhat.com/show_bug.cgi?id=1298007
2016-01-21 14:59:18 +01:00
Thomas Haller 1264fc2108 supplicant: cleanup GObject property implementation in NMSupplicantInterface
nm_supplicant_interface_new() should be merely a convenient interface
for creating the object directly.
2016-01-21 14:58:55 +01:00
Thomas Haller f1fba3eb02 wifi: fix crash due to wrong ownership handling in nm_supplicant_manager_iface_release()
nm_supplicant_manager_iface_get() would cache and reuse the supplicant
interface. But no ref-counting was in place so that the first user returning
the interface via nm_supplicant_manager_iface_release() would destroy the
instance for others.

This is broken for a very long time. Which shows that we hardly ever
have a cache-hit and usually create a new instance. So, instead of
letting nm_supplicant_manager_create_interface() check for existing
supplicant interface, always create a new instance. This also makes
sense, because we would expect that per ifname only one instance is
requested at a time. Also add an assertion that we don't return
multiple supplicant interface instances for the same ifname.

Drop nm_supplicant_manager_iface_release() in favor of requiring users
to unref the returned instance.

Also, use a GSList instead of a GHashTable for the cache.

Also, previously callers would pass @is_wireless to nm_supplicant_manager_iface_get(),
but the cache lookup did not consider that value. That doesn't matter
now as we always create a new instance.

https://bugzilla.redhat.com/show_bug.cgi?id=1298007
2016-01-21 14:58:55 +01:00
Thomas Haller 063f9185b9 supplicant: don't pass start_now argument to nm_supplicant_interface_new()
Also, don't only consider the @die_count whether to start the supplicant,
but check for is_available() -- which already considers @die_count and
@running.
2016-01-21 14:58:55 +01:00
Thomas Haller 5d64da1da2 supplicant: drop is_wireless argument from NMSupplicantInterface's interface_add() 2016-01-21 14:58:55 +01:00
Thomas Haller a8165611a8 supplicant: remove check for iface instance after nm_supplicant_interface_new()
A plain constructor for a GObject cannot fail.
2016-01-21 14:58:55 +01:00
Thomas Haller 004edecc81 wifi/supplicant: take object reference during availability_changed()
If the list is expected to be modified, it also means that possibly
instances will be unrefed. Probably, not yet visited instances will
not be unrefed so there is no real problem.

Just be extra cautious and take a reference to all instances first.
2016-01-21 14:58:54 +01:00
Thomas Haller 8dcf4d32e9 device/wifi: remove unnecessary call to remove_supplicant_interface_error_handler()
remove_supplicant_interface_error_handler() is not needed as we later disconnect
all handlers for @self.
2016-01-21 14:58:54 +01:00
Thomas Haller 84828960ff device/wifi: replace cancel_pending_scan() with nm_clear_g_source() 2016-01-21 14:58:54 +01:00
Thomas Haller 0a2ff1d16d device/ethernet: cleanup clearing handlers registered to supplicant interface 2016-01-21 14:58:54 +01:00
Thomas Haller 30f72c2753 device/ethernet: use nm_clear_g*() function in remove_supplicant_interface_error_handler() 2016-01-21 14:58:54 +01:00
Thomas Haller 2505911ad5 supplicant: remove unused function nm_supplicant_interface_get_device() 2016-01-21 14:58:54 +01:00
Thomas Haller 8cb78ac38b gitignore: ignore /src/devices/tests/test-arping
Fixes: 83b712aa42
2016-01-21 14:57:08 +01:00
Beniamino Galvani 2446da1564 release: improve NEWS 2016-01-21 11:42:42 +01:00
Lubomir Rintel c1cf3c25c8 linux-platform: treat gadget devices as ethernet devices
Also, don't manage them by default. Whatver created it should take care of
management.
2016-01-21 11:33:59 +01:00
Thomas Haller bf54a5bfba systemd: add "After=dbus.service" to NetworkManager.service
Order NetworkManager after dbus. Otherwise during shutdown, both service are killed
together and possibly NetworkManager can no longer use D-Bus during shutdown. It
will need it however to communicate with VPN plugins and wpa-supplicant.

Related: https://bugs.freedesktop.org/show_bug.cgi?id=89847#c14
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1214466
2016-01-21 11:01:36 +01:00
Beniamino Galvani 64ac910131 dns-manager: prevent DNS plugins from respawning too quickly
If dnsmasq (or another DNS plugin) exits immediately (for example due
to an already used port), the DNS manager keeps restarting it forever,
wasting system resources and filling logs.

Add a simple rate-limiting mechanism.

https://bugzilla.gnome.org/show_bug.cgi?id=760691
2016-01-21 10:40:08 +01:00
Dan Williams ec1185d6dd libnm: remove erroneous nm_manager_get_all_devices()
None of the libnm NMManager functions are exported, as they are only
used internally.

Fixes: 4db851f852
2016-01-20 12:27:05 -06:00
Dan Williams 701c05ad69 build: remove spurious comma from configure.ac 2016-01-20 12:21:40 -06:00
Dan Williams 3b3f108dfd docs, trivial: fix some documentation issues 2016-01-20 11:27:22 -06:00
Dan Williams 0a12a1711c libnm-core,core,cli: fix spelling of NM_IP_TUNNEL_MODE_UNKNOWN
Fixes: b614a5ec61
Fixes: ae8c7a8967
Fixes: 570fdce93f
2016-01-20 11:27:22 -06:00
Dan Williams b610d2dc0c docs: ignore some private libnm & libnm-core headers 2016-01-20 11:27:21 -06:00
Dan Williams d59c1d4c8a libnm,vpn: restore export of deprecated NMVpnPluginOld symbols
Deprecated of course, but shouldn't have been removed from the ABI.

Fixes: 867227dd4a
2016-01-20 11:26:49 -06:00
Lubomir Rintel 0f199943de Revert "Set the default powersave value to enabled"
libnm-core & more discussion were missing; backing out for now.

This reverts commit 15ab4bda5b.
2016-01-20 13:53:40 +01:00
Beniamino Galvani 80e8b9cca9 merge: branch 'bg/ipv4-dad-rh1259063'
Add support for detecting IPv4 duplicate addresses.

https://bugzilla.redhat.com/show_bug.cgi?id=1259063
2016-01-20 11:57:13 +01:00
Beniamino Galvani 75068a085a device: detect duplicate IPv4 addresses when method=auto 2016-01-20 11:53:47 +01:00
Beniamino Galvani 28f6e8b4d2 device: detect duplicate IPv4 addresses when method=manual 2016-01-20 11:53:47 +01:00
Beniamino Galvani 83b712aa42 core: add test for NMArpingManager 2016-01-20 11:53:47 +01:00
Beniamino Galvani 7a0fe9b21e core: add NMArpingManager
Add a new object which implements the logic for announcing IP
addresses and detecting duplicates using arping.

Based-on-patch-by: Jiří Klimeš <jklimes@redhat.com>
2016-01-20 11:53:47 +01:00
Jiří Klimeš df6b0fa99e cli: add support for new ipv4.dad-timeout property 2016-01-20 11:53:47 +01:00
Jiří Klimeš adbbf3aa5c ifcfg-rh: read/write ipv4.dad-timeout using ARPING_WAIT
ARPING_WAIT is used for DAD by Red Hat initscrips (ifup-eth).
2016-01-20 11:53:47 +01:00
Jiří Klimeš 31ea5a99cb libnm: add NMSettingIPConfig 'dad-timeout' property
The property is used to control duplicate address detection:
 * -1 means default value
 * 0 means no DAD is performed
 * > 0 means timeout (in milliseconds) for arping responses

[bgalvani: moved setting from NMSettingIP4Config]
2016-01-20 11:53:47 +01:00
Beniamino Galvani f607a16994 device/macvlan: implement dispose()
When the object gets disposed, parent must be unreferenced and signals
disconnected.

Fixes: 4de8851eca

https://bugzilla.redhat.com/show_bug.cgi?id=1299803
2016-01-20 11:41:59 +01:00
Mathieu Trudel-Lapierre 15ab4bda5b Set the default powersave value to enabled
This is an Ubuntu-specific patch to enable wireless powersave by default.

Should it not work for you for some reason, you can safely add:

powersave=0

to the section:
[802-11-wireless]

In the configuration file for your connection under
/etc/NetworkManager/system-connections/.
2016-01-20 11:27:47 +01:00
Thomas Haller 26721b8a88 core: use guint type for glib's source ids 2016-01-20 10:27:36 +01:00
Thomas Haller a99a0d194d dhcp: clear watch_id in child-watch callback 2016-01-20 10:27:36 +01:00
Beniamino Galvani 701d98acc5 device: fix check on device state in carrier_changed()
The function can now be called on unrealized devices before the
initial unmanaged flags are set and for those devices
nm_device_get_managed() will return TRUE. Since we only accept
states > UNMANAGED, return early when the condition is not met.

Fixes the following failed assertion:

carrier_changed: assertion 'priv->state >= NM_DEVICE_STATE_UNAVAILABLE' failed

https://bugzilla.gnome.org/show_bug.cgi?id=760844
2016-01-20 09:53:10 +01:00