Commit Graph

7740 Commits

Author SHA1 Message Date
Dan Williams
445e8755bc bridge: allow independent IPv4 and IPv6 configuration with no slaves
When no slave is present, dynamic IP configuration (DHCPv4, DHCPv6,
IPv6 autoconf) cannot proceed.  But static and link-local
configuration can.  So if IPv4 requires DHCP but IPv6 is static,
it makes no sense to block IPv6 configuration from proceeding
just because DHCPv4 cannot.
2012-11-30 13:21:51 -06:00
Dan Williams
dcecc41327 bond: allow independent IPv4 and IPv6 configuration with no slaves
When no slave is present, dynamic IP configuration (DHCPv4, DHCPv6,
IPv6 autoconf) cannot proceed.  But static and link-local
configuration can.  So if IPv4 requires DHCP but IPv6 is static,
it makes no sense to block IPv6 configuration from proceeding
just because DHCPv4 cannot.
2012-11-30 13:21:51 -06:00
Dan Williams
54f9a670f7 core: allow device subclasses to postpone IPv4 or IPv6 configuration
If, for example, a bond interface has dynamic IPv4 configuration
and static IPv6 configuration, then without slaves IPv6 config
can proceed but IPv4 cannot until a slave is present.  Allow
subclasses to postpone a specific IP configuration path until
they're ready, but let others proceed.
2012-11-30 13:21:51 -06:00
Dan Williams
a421a8c026 trivial: describe NM_ACT_STAGE_RETURN_* values 2012-11-30 13:21:51 -06:00
Dan Williams
b4a11a86f7 core: rework master/slave handling 2012-11-30 13:21:51 -06:00
Dan Williams
1472532f28 core: clarify bond enslave/release function names 2012-11-30 13:21:51 -06:00
Dan Williams
b50a141fb7 core: trivial code reorganization 2012-11-30 13:21:51 -06:00
Dan Williams
6116a84048 core: simplify nm_device_activate()
We don't need to check device state here because the manager, which
is the only thing that calls nm_device_activate() in
internal_activate_device() ensures that the device is deactivated
before starting a new activation request.
2012-11-30 13:21:51 -06:00
Jiří Klimeš
0ada524a82 keyfile: add some tests for bridges 2012-11-30 13:21:51 -06:00
Jiří Klimeš
1a7f9e661a core,libnm-glib: expose "slaves" property on NMDeviceBridge 2012-11-30 13:21:51 -06:00
Thomas Graf
789f8c730d cli: add bridge support 2012-11-30 13:21:51 -06:00
Dan Williams
c091415bff core: leave disabled devices up on shutdown
Bridge/bond slaves don't really need to be taken down when we quit.
2012-11-30 13:21:51 -06:00
Thomas Graf
cfff5a63d9 bridge: add bridge device type
This adds a new device type 'bridge'. Kernel devices are created
on demand.
2012-11-30 13:21:51 -06:00
Dan Williams
20e60deccb ifcfg-rh: add support for reading/writing bridge port connections
Allows to attach any connection to a bridge using the BRIDGE= key.
IP configuration is optional for bridge components but not
prohibited. Test case included.
2012-11-30 13:21:51 -06:00
Thomas Graf
6bc5213b66 ifcfg-rh: add support for reading/writing bridge connections
Including testcase.
2012-11-30 13:21:51 -06:00
Dan Williams
d723457ac7 libnm-util: add NMSettingBridgePort 2012-11-30 13:21:50 -06:00
Dan Williams
8ecded9a9b libnm-util: add NMSettingBridge 2012-11-30 13:21:50 -06:00
Thomas Graf
679212c03d bridge: API to to create, delete, attach, and detach bridges
Provides functions to create and delete bridging devices and
to attach/detach slaves from bridging devices.

It currently relies on the ioctl() kernel interface. The long
term goal is to use the netlink interface for this.
2012-11-30 13:21:50 -06:00
Dan Williams
3e3cffd0bd core: pass slave connection to master when enslaving 2012-11-30 13:21:50 -06:00
Dan Williams
a021e40e33 core: fix semantics of nm_utils_do_sysctl()
This function gets used for both /proc/sys (ie, sysctl) and for
sysfs attributes.  There are two issues with it:

1) most sysctl values don't care about a trailing LF, but some
sysfs attributes (infiniband) do; so we always have to add the
trailing LF.  Just move that into the function to ensure that
callers don't forget to add it.

2) neither sysfs or sysctl support partial writes, while the
existing function did partial writes.  Practically, both the
write handlers for sysfs and sysctl should always handle all
the data, but if they don't, partial writes are wrong.  So
instead, try three times to write all the data.
2012-11-30 13:21:50 -06:00
Dan Williams
0a71cea59f core: allow state change queuing from inside queued state handler
Clear the queued state struct before triggering the state change, instead
of after, since the state change may queue another state change.
2012-11-30 13:21:50 -06:00
Dan Williams
a9077724a9 ifnet: allow testcase to remove backup files (fixes distcheck)
Can't leave the backup files lying around when doing 'make distcheck',
so when backup up a file, return the backup file path so that the
caller can (optionally) remove it.
2012-11-30 13:08:26 -06:00
Dan Williams
e609ca05a2 ifnet: fix srcdir != builddir issue with certificate paths
If the certificate path from the supplicant config is not absolute,
we need to make it absolute.  When building with a different builddir,
the certificate from the supplicant config is actually in the srcdir,
but the builddir is the current PWD.
2012-11-30 13:08:21 -06:00
Dan Williams
2e6cad94f3 ifnet: simplify testcase 2012-11-30 13:08:16 -06:00
Dan Williams
5ff6ad26f0 ifnet: simplify test supplicant config
Only list network blocks we're actually testing.
2012-11-30 13:08:10 -06:00
Dan Williams
cb0683f01d ifnet: use g_assert_cmpstr() in a few places 2012-11-30 13:08:02 -06:00
Jiří Klimeš
7147c3d1a3 libnm-util: return FALSE on missing NMSettingVlan:parent && NMSettingWired:mac-address
in NMSettingVlan's verify()
2012-11-29 16:39:15 +01:00
Colin Walters
4511581dba build: ensure pkglibdir exists (bgo #688806)
Recent automake versions switched to not creating empty directories,
but at the moment NetworkManager g_warning()s on startup if it doesn't
find $(pkglibdir).  So let's make it.

https://bugzilla.gnome.org/show_bug.cgi?id=688806
2012-11-28 16:36:55 -06:00
Jiří Klimeš
18fc15b7cf policy: fix setting system hostname (rh #875085)
Broken by commit 5003153297
(core: move DNS change handling to the policy and optimize DNS updates (bgo #676778))
It consolidated DNS update handling, but mistakenly removed hostname changing
from NM_DEVICE_STATE_ACTIVATED state handler.

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
2012-11-27 13:35:12 +01:00
Daniel Drake
c6fb063e09 core: don't enumerate uninitialized devices from udev (fdo #56929)
When enumerating devices, libgudev's matching by default will return
devices which udev has not yet finished initializing.

This was frequently causing boot-time races on the OLPC XO, where
NetworkManager would bring a device up before udev had renamed it,
causing the later rename to fail.

To solve this, filter the enumeration matches to only include
initialized devices. The devices that are present but uninitialized
at this time will arrive a short time later, via a uevent.

https://bugs.freedesktop.org/show_bug.cgi?id=56929

(dcbw: update gudev version check in configure.ac)
2012-11-26 16:09:23 -06:00
Pavel Šimerda
423d766b03 build: implement libnl version selection
Until we remove libnl-1.x and libnl-2.x support, it should be
possible to choose the libnl version at build time. This is
mostly important for testing legacy libnl support but it also
helps distributions that ship other tools built agains them.

(https://bugs.gentoo.org/show_bug.cgi?id=441750)
2012-11-22 18:03:16 +01:00
Dan Williams
56550a984f modem-manager: don't log so often about trying to start modem-manager
Reduce the log level to a debug log.  If you're not running MM for
whatever reason, don't spam the logs.
2012-11-21 11:48:26 -06:00
Aleksander Morgado
8e4f6a5a55 modem-manager,broadband: use the primary port as unique ID
Instead of a 'modem#' identifier, use the primary port of the modem as unique
identifier. The modem UID will be set afterwards as the Device Iface, which is
then used by libnm-glib to gather vendor/product string from the udev device
associated with the Device Iface; so it really needs to be a real port.
2012-11-21 11:48:26 -06:00
Marius B. Kotsbak
0456f617bb po: add translatable 2012-11-21 11:48:26 -06:00
Dan Williams
d3e4930177 mobile: assume IFF_NOARP when given a /32 prefix
Trying to ARP with no other machines in the broadcast domain
is pretty pointless, and in many cases doesn't work (ZTE MF691
/T-Mobile Rocket 2), so turn it off.
2012-11-21 11:48:26 -06:00
Aleksander Morgado
2a1481112c device-bt: watch both old and new ModemManager interface name owner changes 2012-11-21 11:48:26 -06:00
Aleksander Morgado
998b9295c9 modem-manager: don't report the data interface along with the IPv4 configuration
The only case where this was being used was in PPP-based connections, as the
ppp0 interface was reported by pppd once the IP setup was done. Instead, just
update the 'NM_MODEM_DATA_PORT' property, as the NMDevices already listen for
changes in that property.
2012-11-21 11:48:25 -06:00
Aleksander Morgado
c9579b1bf0 device-bt, device-modem: listen for data port changes in the `NMModem'
The new ModemManager1-based `NMModemBroadband' objects will set the data port
information only after having created the bearer as part of the connection
process. The devices, therefore, need to listen to changes in the `data-port'
property, so that the `ip-iface' in the `NMDevice' is set before finishing the
stage1 of the activation. This is required in order to have a proper ifup of the
data port.
2012-11-21 11:48:25 -06:00
Aleksander Morgado
6463904bff modem-manager, manager: avoid calling G_TYPE_INSTANCE_GET_PRIVATE() often
G_TYPE_INSTANCE_GET_PRIVATE() is known to be slow, so just call it once when
the private data is created, and keep a 'priv' pointer around for easy access.
2012-11-21 11:48:25 -06:00
Aleksander Morgado
2e74fc8cf4 modem-manager, manager: integrate the new `ModemManager1' interface support
The new `MMManager' object takes care of notifying modems added or removed from
the ModemManager1 interface.

We will listen to both the old and new ModemManager implementations, but as soon
as the first ModemManager implementation is found, the other one gets cleared,
so that we don't wait forever to appear.
2012-11-21 11:48:25 -06:00
Aleksander Morgado
a9032724cb modem-manager: new `NMModemBroadband'
This new object, which is a subclass of `NMModem', implements the basic support
of the new ModemManager1 interface.
2012-11-21 11:48:25 -06:00
Aleksander Morgado
469e1a7164 modem-manager: rename old interface symbols
The new ModemManager comes with its own headers, and defines its own symbols to
name e.g. each interface. In order not to collide with the new ones, rename the
existing ones with a 'MM_OLD_DBUS' prefix instead of just 'MM_DBUS'.
2012-11-21 11:48:25 -06:00
Aleksander Morgado
52c993dd65 build: new `--with-modem-manager-1' to check for new ModemManager1 support
The new switch will run in 'auto' mode when not explicitly specified. In this
case the new ModemManager1 support will only be available if it finds libmm-glib
through pkg-config.

Other than the 'auto' mode, 'yes' and 'no' are allowed in order to specify
explicit requirements.
2012-11-21 11:48:25 -06:00
Dan Williams
faf0f5daa1 ifnet: fix some builddir != srcdir issues in testcases 2012-11-21 11:42:06 -06:00
Dan Winship
e98d1869eb core: fix up virtual device creation on connection creation
Previously, when a new bond or VLAN connection was created, NM would
always create the virtual device right away. But on startup, it only
creates virtual devices for connections that can autoconnect. Fix
connection_added() to make that check as well.
2012-11-20 10:02:39 -05:00
Stefan Brüns
357f312cea trivial: fix typos, wrong log domain in DHCPv4 2012-11-20 08:59:55 -06:00
Jiří Klimeš
35689c7bd0 cli: allow next_arg() to move arguments past the last one 2012-11-20 15:20:38 +01:00
Sweta Kothari
dc05592b76 po: updated Gujarati (gu) translation (bgo #684191) 2012-11-20 13:50:25 +01:00
Pavel Šimerda
449ca34cb0 initscripts: remove Gentoo initscript
The Gentoo initscript is being patched downstream anyway. It
will be easier to maintain it in just one place.

See discussion at bugs.gentoo.org:

https://bugs.gentoo.org/show_bug.cgi?id=441754
2012-11-18 14:56:39 +01:00
Gene Czarcinski
90b99522d7 dhcp: fix DHCPv6 to support server-side dynamic DNS (bgo #684242)
This patch makes DHCPv6 support more or less equivalent to that
one of IPv4 DHCP.

(dcbw: fix some formatting, rearrange code so it's less convoluted,
fix up writing hostname to ifcfg files)
2012-11-16 17:26:19 -06:00