Commit Graph

7740 Commits

Author SHA1 Message Date
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
Pavel Šimerda
2e826b152d keyfile: cleanup IPv4/IPv6 address reading code 2012-11-07 16:39:53 +01:00
Jiří Klimeš
ffd29e69f3 man: document new log domains (BOND, VLAN) and (ALL, DHCP, IP) 2012-11-07 14:26:08 +01:00
Jiří Klimeš
1eb9c5e352 logging: add "VLAN" log domain 2012-11-07 13:58:47 +01:00
Jiří Klimeš
8437b07581 logging: add "BOND" log domain 2012-11-07 13:58:47 +01:00
Jiří Klimeš
8fbd24c9b4 logging: add new combined log domains
ALL  - for setting all log domains
DHCP - for DHCP4 combined with DHCP6
IP   - for IP4 combined with IP6
2012-11-07 13:58:47 +01:00
Jiří Klimeš
9fa1a9b8ae Revert "docs: add PPP interface API to HTML spec"
This reverts commit 2ad6dcf215.

org.freedesktop.NetworkManager.PPP is a private interface between
NM and nm-ppp-plugin and we don't want it in the documentation.
2012-11-07 13:40:24 +01:00
Dan Williams
3f179d74e2 build: decouple systemd session tracking from systemd suspend/resume
New option --with-suspend-resume=[upower|systemd] which defaults
to systemd if you have systemd >= 183 with the inhibit support,
otherwise upower.  Allows you to use systemd session tracking
simultaneously with upower for suspend/resume if you don't have
system >= 183.
2012-11-06 15:10:03 -06:00
Dan Williams
0180f461ef build: clarify systemd-login build flags
systemd gets used for more than just systemd-login.
2012-11-06 14:11:05 -06:00
Jiří Klimeš
2ad6dcf215 docs: add PPP interface API to HTML spec 2012-11-06 15:09:44 +01:00
Jiří Klimeš
2ff378b44b settings: do not emit "REMOVED" signal in do_delete() (bgo #683800)
It is emitted in nm_settings_connection_remove() called by plugins when the
connection was removed.
This prevents the signal from appearing twice on D-Bus.

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
2012-11-06 14:19:29 +01:00
Pavel Šimerda
d82669d3fd build: unify NetworkManager path handling (some paths are changed)
Use autoconf/automake variables for NetworkManager paths. Use
NetworkManager subdirectory where appropriate.

Files in /var/run (or /run on some distros) are moved into a separate
directory as is usual with other daemons. It makes the filesystem
more readable and file prefixing unnecessary.

/var/run/NetworkManager.pid -> /var/run/NetworkManager/NetworkManager.pid
/var/run/nm-dns-dnsmasq.pid -> /var/run/NetworkManager/dnsmasq.pid
/var/run/nm-dns-dnsmasq.conf -> /var/run/NetworkManager/dnsmasq.conf

The /var/run/NetworkManager directory is created at runtime, if it doesn't
exist.

Note: Path-based security policies like SELinux and AppArmor may need to
be adapted.
2012-11-05 14:01:47 +01:00
Marc Ruiz
811c87f8ae typo: replace all misstyped 'seconadary' strings with 'secondary' 2012-11-04 23:08:02 +01:00
Dan Winship
a7eb347655 ifcfg-rh: /etc/hostname should override /etc/sysconfig/network
When determining the system hostname, /etc/hostname should override
/etc/sysconfig/network, so monitor both files.

When setting the hostname, set it in /etc/hostname, and delete the
/etc/sysconfig/network HOSTNAME entry if present.

https://bugzilla.redhat.com/show_bug.cgi?id=831735
2012-11-02 11:20:31 -04:00
Pavel Šimerda
00f1d251b4 trivial: remove obsolete HAVE_SELINUX conditional sections
This macro is not defined by the build system.
2012-11-02 01:27:34 +01:00
Jiří Klimeš
8a0e928aed cli/examples: NM_802_11_MODE_AP mode is not valid for NMAccessPoint objects 2012-11-01 15:40:27 +01:00
Jiří Klimeš
a44d36e628 wifi: fix AP mode check in nm_ap_check_compatible()
AP can only be compatible with "ap"-mode connection when both mode is INFRA and
hotspot flag is set.
2012-11-01 14:52:14 +01:00
Jiří Klimeš
aa8c3d72d6 wifi: fix wifi device 'mode' property for AP mode 2012-11-01 14:52:14 +01:00
Pavel Šimerda
5980cae149 distro: fix configure error affecting SUSE netconfig support
Configure now doesn't complain about too many arguments to test.

Bug introduced in my commit:
71e5437: distro: add --with-netconfig option for SUSE
2012-11-01 13:27:44 +01:00
Jiří Klimeš
eeb19fe216 keyfile: don't rename system connection files (bgo #682570)
When updating connections, it is less confusing to reuse the existing file
instead of renaming files according to connection's ID. That reduces surprises
of moving connection files when a connection is edited.
2012-11-01 11:59:00 +01:00
Colin Walters
ceba6bf4c5 build: target GLib 2.34 (bgo #687218)
By specifying GLIB_VERSION_MAX_ALLOWED=GLIB_2_34, we tell GLib not to
warn us about e.g. g_type_init() being deprecated in 2.36.

This avoids the NM build blowing up with the default -Werror
configuration if we happen to have a newer GLib in the buildroot.
2012-10-31 22:01:36 +01:00
Colin Walters
1977fb6c49 build: clean up GLib-related pkg-config usage (bgo #687218)
We had separate checks for glib-2.0, gobject-2.0, gmodule-2.0, and
gio-unix-2.0.  It doesn't make sense to link a binary against all 4
because gio-unix-2.0 depends on glib-2.0 and gobject-2.0.  Doing this
actually breaks things in unusual circumstances.

Generally, few bits of NM actually just use glib, and not gio.  We
might as well coalesce those requirements together, even if it means
in some cases we "overlink".  Additionally, I chose for now to fold
gmodule-2.0 in as well, even though many fewer programs need it.  The
cost of overlinking is quite small.

The benefit of this is less repeated junk in Makefile.am, as well as
more centralized control over GLib.  A followup patch will allow us to
set -DGLIB_VERSION_MIN_REQUIRED in just one place, rather than having
to replicate it 4 times.

The NM configure is still suboptimal - for example, libpolkit-1
depends on gio-2.0, so really we should determine the compiler flags
all in one pass.  But it doesn't matter too much for now.
2012-10-31 21:08:18 +01:00
Colin Walters
59f2cd0f8d build: remove G_DISABLE_DEPRECATED
This functionality is (mostly) obsoleted by the newer
GLIB_VERSION_MIN_REQUIRED and GLIB_VERSION_MAX_ALLOWED defines.  With
this, your build doesn't all of a sudden blow up if we deprecate
something in GLib - you have to explicitly opt-in to the newer
version.

G_DISABLE_DEPRECATED does still apply for macros and things that can't
take __attribute__((deprecated)), but it's not really worth the pain
and cargo culting around just for that.
2012-10-31 19:41:07 +01:00