Commit Graph

8762 Commits

Author SHA1 Message Date
Dan Williams
8ed4b5109a bridge: device availability shouldn't depend on carrier state
The bridge master's carrier follows IFF_UP when no ports are added
and the ports' carrier when ports are added, so we shouldn't
depend on carrier when deciding whether to activate a bridge which
may not have any ports.  Also when the
2013-02-04 10:37:46 -06:00
Dan Williams
dfef198801 bond: device availability shouldn't depend on carrier state
Bond master carrier state follows slave carriers, so clearly we
can't depend on carrier when deciding whether we can activate a
bond connection which doesn't yet have any slaves.  Also, when
the bond's carrier goes down, we don't want to deactivate the
connection because this is normal in some failover modes and
could be the user reconfiguring slaves.
2013-02-04 10:37:46 -06:00
Dan Williams
8aee650cd1 core: allow Wired device subclasses to override carrier handling
Bond devices, for example, don't want carrier state to affect
connection state.  Allow subclasses to override the Wired class'
handling if they want.
2013-02-04 10:37:46 -06:00
Dan Williams
e64bcae092 core: add IS_MASTER property to NMDevice
We can't just check whether there are slaves or not, because the
master device may be started before any slaves exist, and the
slaves get added later.
2013-02-04 10:37:46 -06:00
Dan Williams
d4f5c40abe core: emit NMDeviceWired carrier change after logging it
Less confusing in the logs to see the change logged before listeners
have a chance to emit other log messages that may depend on the new
carrier state.
2013-02-04 10:37:46 -06:00
Dan Williams
aa8aeb197f bridge: update log domains for LOGD_BRIDGE 2013-02-04 10:37:46 -06:00
Dan Williams
fab66119dc logging: add BRIDGE log domain 2013-02-04 10:37:46 -06:00
Dan Williams
01acf46df8 trivial: quiet useless log message
Managed/unmanaged status is conveyed by the immediate state change,
so no need to redundantly log it.
2013-02-04 10:37:46 -06:00
Dan Williams
7837e62d16 bond: set slave IFF_UP after releasing it
The kernel bonding code calls "closes" (which clears IFF_UP) the slave
and restores some of its attributes (MAC address, MTU, etc), but doesn't
bring it back up.  This breaks things like carrier detection, and
indeed when the device is closed, its carrier is also cleared, which
leads us to think the device is not available for activation.

To ensure that further events are noticed by the device, and that its
carrier state is accurately represented, make sure the device is still
IFF_UP after it  has been released.
2013-02-04 10:37:46 -06:00
Dan Williams
7651c77b78 core: update hardware address when slaves change
The hardware address of a device often changes when slaves change,
for example with bond interfaces, which take the hardware address of
their first slave.  Make sure that's always up-to-date.
2013-02-04 10:37:46 -06:00
Dan Williams
a11771dfe6 core: preserve errno in nm_utils_do_sysctl()
Callers may need the error to determine their course of action
in response to a failure.
2013-02-04 10:37:46 -06:00
Dan Williams
763b6c31d4 core: ignore carrier changes on enslaved interfaces
It's not very helpful to deactivate a slave of a bond or a bridge
port because the carrier is lost.  Carrier failures are normal
operation when using various bonding failover modes.  For bridge
ports, it's probably not very helpful either.  Given that the
masters are all virtual interfaces and have been explicitly
configured and started by a user, the configuration should
generally be left alone unless explicitly deactivated or changed.
2013-02-04 10:37:46 -06:00
Dan Williams
39bd9f893a core: log when last slave is removed 2013-02-04 10:37:46 -06:00
Dan Williams
b6f8ecb330 core: handle slave deactivation more gracefully
Two things:

1) When the slave was deactivated, nm_device_deactivate() runs before
the master gets the slave's state-changed signal, and thus priv->master
is cleared long before nm_device_notify_enslaved() is called.  Which
would trigger the g_assert (priv->master).

2) If the slave is already deactivated, there's no point in re-queueing
a state change to deactivated.

So just assert that priv->master is valid if the slave is going to be
enslaved, but if the slave is being released, ignore NULL priv->master
which we don't use anyway.  Also ignore redundant state changes.
2013-02-04 10:37:46 -06:00
Dan Williams
7988914e29 core: don't fail if bond slave is already a slave of the requested master
Would otherwise file if NM was restarted when a bond was active.
2013-02-04 10:37:45 -06:00
Dan Williams
43952e28c2 core: fix writing blank sysctl values
Sometimes we need to write blank values.
2013-02-04 10:37:45 -06:00
Dan Williams
ce586cc679 core: fix setting port attributes
They need to be written to the "bridge_port" directory, not the
"bridge" directory.
2013-02-04 10:37:45 -06:00
Dan Winship
17123fcc61 introspection: belatedly add NM_DEVICE_CAP_AP 2013-01-31 10:47:41 -05:00
Milo Casagrande
db32c3ab29 po: updated Italian (it) translation (bgo #692742) 2013-01-31 11:03:11 +01:00
Dan Williams
7491198138 build: clean up dbus-glib checks
dbus_glib_global_set_disable_legacy_property_access() was added in dbus-glib
0.88, and since we require 0.94 we can remove this check.
2013-01-30 11:19:15 -06:00
Jiří Klimeš
609b2d1782 cli: add missing properties (mainly secrets flags, and some others) 2013-01-30 15:27:06 +01:00
Jiří Klimeš
7881cb3252 cli: add missing 'dhcp-hostname' property to 'ipv6' setting 2013-01-30 12:27:13 +01:00
Jiří Klimeš
0215ad40f0 cli: use setting_details() to simplify printing connection details 2013-01-30 12:27:13 +01:00
Jiří Klimeš
0c7bf6ba67 cli: add generic setting_details() for printing NMSetting 2013-01-30 12:27:13 +01:00
Dan Winship
6000ccfc76 build: update NetworkManager.pc
Add "plugindir" and "configdir" variables (eg, for VPN plugins to make
use of).
2013-01-29 16:17:30 -05:00
Dan Williams
9495331a22 build: fix PolicyKit modify.system configure message
It wasn't actually checking the value, which it should have
been doing.  Thus the wrong message was printed.
2013-01-29 13:47:31 -06:00
Dan Williams
e15d161289 dhclient: add testcases for reading DUIDs from leasefiles 2013-01-29 10:18:42 -06:00
Dan Williams
62a940ab7b dhclient: save DUID to dhclient leasefiles when required
The DUID is supposed to be machine-wide, so if we're writing a new
leasefile, save the default DUID to it.  If we haven't saved a
persistent DUID yet, do that to.
2013-01-29 10:18:42 -06:00
Mathieu Trudel-Lapierre
ab4bc03de2 dhclient: read DUID from leasefiles 2013-01-29 10:18:42 -06:00
Dan Williams
dc518cf86b dhcp: add generic DUID infrastructure
Add infrastructure for generating DUID-LLT from a given device MAC and
passing it around to the DHCP client implementations.

Thanks to Mathieu Trudel-Lapierre for bug fixes in the
unescaping code, which were merged into this commit.
2013-01-29 10:16:45 -06:00
Dan Williams
c4e519bd78 dhcp: pass device hardware address to DHCP
Gets used for stuff like the interface DUID for DHCPv6.
2013-01-29 10:07:54 -06:00
Dan Winship
0b57fe0c56 core: simplify nm_device_get_best_auto_connection() implementations
Filter out non-autoconnect connections in the generic NMDevice method
rather than requiring each subclass to do it.

https://bugzilla.gnome.org/show_bug.cgi?id=688284
2013-01-29 10:14:19 -05:00
Dan Williams
c8eba44cfa core: fix GObject parent method calling for hw_is_up()
Broken by e7caad20c9.

Admittedly, GObject is opaque in this area.  But here's the
equivalent concepts in C++:

*_GET_CLASS (object)->function(object):
   - call youngest implementation of virtual function; checks current
     object for implementation and calls it, if not overridden by the
     child, walks up the inheritance chain and calls parent,
     grandparent, etc.  C++ equivalent is calling foo::function().

*_CLASS (object_parent_class)->function(object):
   - call named parent class implementation, *not* including current
     object.  C++ equivalent is calling ParentClass::function().

Using _GET_CLASS()->function() inside the child implementation of
function() recursively calls the child implementation of function()
and overflows the call stack.
2013-01-25 08:44:42 -06:00
Pavel Šimerda
dfa799cb40 netlink: clean up header includes 2013-01-25 00:13:39 +01:00
Pavel Šimerda
92716139ec core: don't return addrlen on failure 2013-01-24 23:28:22 +01:00
Dan Williams
742c3b6695 ip6: use generic device hardware address function 2013-01-24 15:06:05 -06:00
Dan Williams
cd5da9bf88 wired: move hardware address handling back to NMDeviceWired subclasses
The code flow is actually somewhat simpler this way since the
subclasses don't have to ask NMDeviceWired for the address
every time.  Plus then NMDeviceWired doesn't have to know
anything about its subclasses in the constructor.
2013-01-24 14:56:38 -06:00
Dan Williams
11d0f68b23 core: add generic way of getting device hardware addresses 2013-01-24 14:56:38 -06:00
Dan Williams
b584446837 core: consolidate reading device hardware addresses
Instead of using a mix of netlink and SIOCGIFHWADDR and doing it
in every device, create a utility function for this and have
everywhere else call that.
2013-01-24 14:53:58 -06:00
Pavel Šimerda
ff15a5e8fb netlink: workaround to build against libnl3 < 3.2.20
Commit 418a428 fixed building against libnl3 >= 3.2.20 but due to a bug
in libnl it also prevents building against libnl3 < 3.2.20.

See https://bugzilla.gnome.org/show_bug.cgi?id=692423
2013-01-24 20:40:50 +01:00
Pavel Šimerda
1495853e01 logging: add LOGD_PLATFORM 2013-01-24 19:48:01 +01:00
Pavel Šimerda
663859c180 build: drop libnl 1.x and 2.x support, require libnl >= 3.2.7 2013-01-24 19:47:53 +01:00
Alexandre Rostovtsev
418a428975 netlink: do not include object-api.h
It's no longer installed by libnl-3.0 >= 3.2.20 and isn't needed
anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=692423
2013-01-24 09:30:11 -05:00
Pavel Šimerda
f84b18d1d5 vpn: it is not a problem to flush IPv6 routes
Whether they are supported or not. We already remove all addressess.
2013-01-23 09:09:21 +01:00
Pavel Šimerda
a2462ed2f6 wimax: use shared implementation of hw_is_up, hw_bring_up and hw_take_down 2013-01-23 08:08:38 +01:00
Colin Walters
ae627737d5 Remove SIGSEGV/SIGFPE etc. handling
Modern operating systems come with systemwide "crash catching"
facilities; for example, the Linux kernel can now pipe core dumps out
to userspace, and programs like "systemd-coredump" and "abrt" record
these.

In this model, it's actively counterproductive for individual
processes to catch SIGSEGV because:

1) Trying to unwind from inside the process after arbitrary
   corruption is destined to fail.
2) It hides the fact that a crash happened at all - my OS test
   framework wants to know if any process crashed, and I don't
   want to guess by running regexps against /var/log/Xorg.0.log
   or whatever.

Signed-off-by: Colin Walters <walters@verbum.org>

https://bugzilla.gnome.org/show_bug.cgi?id=692032
2013-01-22 12:49:48 -05:00
Pavel Šimerda
e7caad20c9 device: share implementation of hw_is_up, hw_bring_up and hw_take_down 2013-01-22 18:03:25 +01:00
Jiří Klimeš
0f05bfb01f cli: fix a possible crash on missing SSID 2013-01-21 14:49:24 +01:00
Dan Williams
e7813c0451 trivial: move code to correct location
Clearing priv->master is a slave operation, not a master one.
Move the code under the right comment.
2013-01-17 17:11:04 -06:00
Dan Williams
a7edcfd3e2 core: handle bridge interface type detection for libnl < 3 2013-01-17 14:44:01 -06:00