Commit Graph

8762 Commits

Author SHA1 Message Date
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
Pavel Šimerda
1a7e7c9031 dhcp: check for distribution dhclient.conf at runtime
For NetworkManager, dhclient is a runtime dependency. Distribution dhclient
configuration is either put directly into /etc or in /etc/dhcp. It is much
safer to check this at runtime than to guess the location from distribution
name.

Additionally, the distribution dhclient configuration files can be overriden
by a configuration file in /etc/NetworkManager.

TODO: Functions get_dhclient_config() and merge_dhclient_config() should
be also used for IPv6.
2012-11-16 15:27:22 -06:00
Pavel Šimerda
20d4125cfc dhcp: store NetworkManager-specific dhclient leases in /var/lib/NetworkManager/
DHCP lease file names are built by NetworkManager and contain connection UUID
which makes them NM-specific. Their new location belongs to NetworkManager and
doesn't have to be guessed. With no guessing, we don't need distribution-specific
conditionals.

Note: This change may require modifications to the selinux policy. But after all
these files actually belong to NetworkManager as well as the instance of dhclient
that uses them.
2012-11-16 15:27:22 -06:00
Pavel Šimerda
ffb60cdba4 dhcp: improve DHCP client selection in configure.ac
This patch is mostly just a cleanup. It removes some obsolete processing
related to DHCP client support.
2012-11-16 15:27:22 -06:00
Pavel Šimerda
077fafa870 dhcp: drop support for dhclient 3.x
ISC DHCP client 3.x doesn't support DHCP for IPv6 and is not used
in current distributions.
2012-11-16 15:27:22 -06:00
Pavel Šimerda
a52fba46fe dhcp: do not require dhclient to support '-4' option (bgo #679428)
dhclient only supports '-4' option when built with IPv6 support. In all
cases it defaults to IPv4 when it is not specified.

Inspired by Gentoo.
2012-11-16 15:27:22 -06:00
Pavel Šimerda
9e7eceeca5 build: fix nmdatadir in configure.ac
And print NetworkManager directories.
2012-11-15 10:41:41 +01:00
Pavel Šimerda
2750b0759f build: don't write systemd unit file outside of prefix 2012-11-15 10:40:50 +01:00
Pavel Šimerda
86f857325e trivial: quote configure.ac string so that vim's highlighting works 2012-11-14 23:55:08 +01:00
Pavel Šimerda
aa0c7d863d build: srcdir != builddir issues in plugins 2012-11-14 19:39:23 +01:00
Pavel Šimerda
2a900e2d0d build: fix plugin options for 'make distcheck' 2012-11-14 02:13:55 +01:00
Pavel Šimerda
1b0b943663 build: clean all files on 'make distclean' 2012-11-13 23:13:25 +01:00
Pavel Šimerda
04297230e6 build: fix gtk-doc srcdir != builddir issues 2012-11-13 22:39:53 +01:00
Pavel Šimerda
e6d1fc8755 build: fix more srcdir != builddir issues 2012-11-13 22:00:28 +01:00
Dan Williams
4eb4402c01 build: fix srcdir != builddir issue 2012-11-13 14:18:04 -06:00
Pavel Šimerda
e7b6fb2630 build: autogen.sh can now configure from another directory
Example:

$ mkdir -p _build
$ cd _build
$ ../autogen.sh ...configure-options...
$ make
2012-11-13 21:11:50 +01:00
Pavel Šimerda
ec1bd3a936 build: fix bad AM_CONDITIONAL
Introduced by commit faa1bcb.
2012-11-13 20:48:22 +01:00
Pavel Šimerda
2d7f9f3d10 build: build with all plugins for 'make distcheck' 2012-11-13 20:23:06 +01:00
Pavel Šimerda
faa1bcb540 build: improve documentation and test configure options
Use --enable-doc and --enable-tests instead of --with-docs and
--with-tests. This is consistent with other features and with
--enable-gtk-doc option. Support current variants as fallback.

Don't build tests unless --enable-tests is specified.
2012-11-13 20:23:06 +01:00
Pavel Šimerda
e19ef483b7 build: avoid -Wshadow
NM wouldn't build on Gentoo with GCC 4.6.3.
2012-11-13 19:53:32 +01:00
Jiří Klimeš
e9e2c5645f cli: replace 'dev' and 'con' OBJECTs by 'device', resp. 'connection'
Shorter forms work as previously. Thus, all of these commands are valid:
nmcli device, nmcli devic, nmcli devi, nmcli dev, nmcli de, nmcli d
nmcli connection, nmcli connectio, ..., nmcli conn, nmcli con, ..., nmcli c
2012-11-13 15:41:20 +01:00
Jiří Klimeš
c8974bc32d cli: allow more forms of "help" command showing OBJECTs' description
allow "-[h]elp" and "--[h]elp" in addition to "help"
2012-11-13 15:41:20 +01:00
Pavel Šimerda
c225a6397f build: fix nl80211.h check 2012-11-13 15:39:03 +01:00
Dan Winship
6c57060d36 trivial: fix typo in comment 2012-11-12 13:32:23 -05:00
Sandeep Shedmake
a9f54df179 po: updated Marathi (mr) translation (bgo #687246) 2012-11-12 13:50:58 +01:00
Christian Kirbach
64a232dee9 po: updated German translation (bgo #687627) 2012-11-12 13:44:46 +01:00
Pavel Šimerda
7a92eff69c keyfile: improve address and route tests
Add tests for the new address/route format. Simplify the test program

TODO test new routing format
2012-11-07 16:39:54 +01:00
Pavel Šimerda
cca9cfc84d keyfile: read and write a nicer format for IPv4 and IPv6 addresses and routes
You can now use 'address=' even for IPv6 and it's the encouraged way
to set up a single address manually. For multiple addresses,
'address0=', 'address1=', etc, should be preferred.

Example:

  address=10.0.0.15/24/10.0.0.1
  address0=192.168.0.1/24
  address1=10.0.0.16/32

Example (backward compatibility):

  addresses=10.0.0.15/24/10.0.0.1
  addresses0=192.168.0.1/24
  addresses1=10.0.0.16/32
2012-11-07 16:39:54 +01:00
Pavel Šimerda
0d82ca5c04 keyfile: unify IPv4/IPv6 address and routing configuration (bgo #682943)
IPv4 and IPv6 address configuration is now handled together and supports
the following syntax (slashes can be replaced with semicolons):

  address/plen
  address/plen,gateway

IPv4 and IPv6 route configuration is also handled uniformly and supports
the following syntax:

  address/plen (for device routes)
  address/plen,gateway (for gateway routes)
  address/plen,gateway,metric (for gateway routes with metric)

For compatibility reasons, slash (/), comma (,) and semicolon (;) are
considered equal by the parser. The /plen part is optional for both
addresses and routes for compatibility reasons.

Leaving out the prefix length is not considered a good idea. IPv6
addresses default to 64 and IPv4 now defaults to 24 which is the closest
possible IPv4 counterpart. Routes default to single addresses.

Example 1:

  [ipv4]
  method=manual
  addresses1=192.168.56.5/24,192.168.56.1
  addresses2=192.168.57.5/24
  routes1=4.5.6.0/24
  routes2=1.2.3.0/24,4.5.6.7
  routes3=7.8.9.0/24,4.5.6.7,99

  [ipv6]
  method=manual
  addresses1=2001:db8:a🅱️:3/64,2001:db8:a🅱️:1
  addresses2=2001:db8:c:d::3/64
  routes1=2001:db8:e:f::/64,2001:db8:a🅱️:4

Example 2 (equivalent):

  [ipv4]
  method=manual
  addresses1=192.168.56.5;24;192.168.56.1
  addresses2=192.168.57.5;24
  routes1=4.5.6.0;24
  routes2=1.2.3.0;24;4.5.6.7
  routes3=7.8.9.0;24;4.5.6.7;99

  [ipv6]
  method=manual
  addresses1=2001:db8:a🅱️:3;64;2001:db8:a🅱️:1
  addresses2=2001:db8:c:d::3;64
  routes1=2001:db8:e:f::;64;2001:db8:a🅱️:4

For writing, I have arbitrarily chosen one of the formats 'reader'
can parse. Address and prefix length are separated by slash (/),
everything else is separated by comma (,).

	addresses1=address/plen,gateway
	routes1=address/plen,gateway,metric

Note: The modified 'reader' exposes a bug in the 'writer' and ignores
out badly-formatted routes. This problem is also fixed by this
commit. Keyfile tests now pass.
2012-11-07 16:39:54 +01:00