Commit graph

2979 commits

Author SHA1 Message Date
Jiří Klimeš
960621c400 vlan: add missing includes 2012-03-02 08:56:46 +01:00
Jiri Popelka
128695c447 firewall-manager: changing the zone an interface belongs to
When we want to change the zone an interface belongs to
we can't use firewalld's addInterface() because this one
doesn't allow to add interface to zone when it already
has been part of some other/same zone.
We need to use changeZone() method instead - hopefuly
this is the final name of this method.
2012-03-01 18:02:00 -06:00
Jiri Popelka
b2d4f66dd3 firewall-manager: add interfaces to zones after firewall (re)start
Because firewalld has no idea what interface is part of which zone
we need to inform it after it (re)starts what interface belongs to which
zone.
2012-03-01 18:01:56 -06:00
Mathieu Trudel-Lapierre
86a8fa4a79 dns: dnsmasq plugin: update command-line parameters for starting dnsmasq
Drop --strict-order; dnsmasq is intelligent enough to ask nameservers in
an order that makes the best of possibly slow nameservers (or broken ones),
and interrogating them in strict order breaks this.

Add --no-hosts: by default dnsmasq will read /etc/hosts as a list of things
to resolve statically; this is something we want to avoid as nsswitch.conf
already lists files as the first data store to look at; where the entries
in /etc/hosts will already have been returned if that's what the user wants
to see. If the /etc/hosts file then changes, dnsmasq would have to be restarted
before the user would get the new value resolved externally. Avoid this, let
/etc/hosts override DNS entries normally through the resolver and show
changes as soon as the file is updated.
2012-03-01 18:00:03 -06:00
Dan Williams
84ef2acdd0 bond: set bond device options during activation 2012-03-01 17:40:18 -06:00
Dan Williams
b3f7b20a99 core: set unspecified bond options to their default value
Otherwise if another connection was subsequently activated on a
bond interface, and didn't specify all options, ones set for the
previous connection could stay set for the new connection.
2012-03-01 17:40:18 -06:00
Dan Williams
33d0cff3e4 core: use active connection dependency master instead of manually setting it
We already have the master device kept in the active connection, so
we can just use that instead of having the Policy determine and set
it manually.  This also should allow slaves to auto-activate their
master connections if the master is able to activate.
2012-03-01 17:40:18 -06:00
Dan Williams
9146d4e8c6 core: move slave handling to device subclasses
Let the master control how the slave gets enslaved and released
since that's dependent on the virtual interface type of the master.
2012-03-01 17:40:17 -06:00
Dan Williams
58227d0136 wired: check carrier immediately after bringing device up
Virtual devices that we might create when their slave is started
(like bonds) have a virtual carrier that often isn't set on when
until the device is brought up.  The device is brought up during
creation, but the initial carrier check happens before the device
is up, so the initial carrier state from the constructor isn't
quite accurate in some cases.

Since we want to use virtual interfaces that we create right after
we create them, we want them to be available too, and that usually
requires the carrier to be on.  So recheck the carrier right after
bringing the interface up, so that the carrier state is accurate
immediately after the device is created.
2012-03-01 17:40:17 -06:00
Dan Williams
28edd78f89 core: don't require an error argument to nm_device_check_connection_compatible() 2012-03-01 17:40:17 -06:00
Dan Williams
db94e37eb5 core: wait for dependencies before continuing with device activation
Before jumping to activation stage 1, make sure dependencies are activated.
2012-03-01 17:40:17 -06:00
Dan Williams
0b8ff52fdd core: track active connection dependencies
Track a master active connection and emit wait/ready/fail when
it changes state.  This signal is intended for devices to
delay their activation until a master device is ready.
2012-03-01 17:40:17 -06:00
Dan Williams
d08b33bb01 core: ensure master connections are available for dependence
If the connection requires a master connection or master device,
find that connection, and activate it if it's not already
activated.
2012-03-01 17:40:17 -06:00
Dan Williams
0eb09bc99b core: don't assert in nm_device_get_connection()
This function used to be used only from activation paths, so it
was fine to assert there because we always expected that there
would be an activation request.  These days we'd like to use it
in more places, so just return NULL if there's no connection.
2012-03-01 17:40:17 -06:00
Dan Williams
fbfdecf380 core: reorganize activation flow by splitting out VPN activation work
Just split the VPN-specific stuff out to its own function so that
nm_manager_activate_connection() isn't so large.
2012-03-01 17:40:17 -06:00
Dan Williams
7aa2a8271d core: use NMActiveConnection objects throughout activation paths
They are the basic class that tracks active connections, and we're
going to use them for connection dependencies.  So use the fact that
both NMVPNConnection and NMActRequest have the same base class
instead of using object paths.
2012-03-01 17:40:17 -06:00
Dan Williams
65a13f9d8a core: convert VLAN interfaces to a device subclass
Many different interface types can support VLANs, including
Infiniband, WiFi, etc.  So we have to create a new device class
for them instead of keeping the support in NMDeviceEthernet.
2012-03-01 17:40:17 -06:00
Dan Williams
5ee7841475 core: extend nm_device_hwaddr_matches() to match specific addresses
We'll want to eventually match (for VLAN) a given hardware address
that's not the device's hardware address.  Only the device itself
knows which NMSetting should contain it's hardware address (ie
the 'wired' setting for NMDeviceEthernet, 'infiniband' for
NMDeviceInfiniband, etc) and VLANs take their hardware address
from the parent interface.  So eventually we'll have VLAN
interfaces use these new arguments to ask their parent interface
to match the VLAN hardware address in a connection, since the
VLAN doesn't know (or need to know) what kind of interface it
really is underneath.
2012-03-01 17:40:17 -06:00
Dan Williams
29672c3f7d core: move IP config matching to NMDevice superclass
It's useful for more than just NMDeviceWired and subclasses.
2012-03-01 17:40:17 -06:00
Dan Williams
57b77b10b6 core: fix parent/master confusion in some argument names
It's the parent, not the master, that we care about here.
2012-03-01 17:40:17 -06:00
Dan Williams
51edc6ae97 core: use VLAN parent instead of master for creating the virtual interface
The 'parent' property of NMSettingVlan is now what describes the
interface from which the VLAN gets created, not master.
2012-03-01 17:40:17 -06:00
Dan Williams
10b32be37b ifcfg-rh: various VLAN cleanups
Add some testcases checking for DEVICE/PHYSDEV/VLAN_ID variations,
and read/write the new VLAN_ID tag, which we can use in
combination with the 'parent' property to determine the interface
name if no interface name/DEVICE is given.
2012-03-01 17:40:17 -06:00
Thomas Graf
cf597e698a ifcfg-rh: writer support for bonding connections
For bonding-master:
  TYPE=bond
  BONDING_MASTER=yes
  DEVICE=<NAME>
  BONDING_OPTS="..."

For bonding-slaves:
  MASTER=<NAME>

v2: Resolved test failures after feedback from Jirka.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-03-01 17:32:51 -06:00
Colin Walters
a3ca1f8e17 build: wifi: add missing builddir to INCLUDES
Necessary when building from git srcdir != builddir.
2012-03-01 13:54:49 -06:00
Jiri Popelka
64753b9b3a trivial: fix unused variable ‘priv’ 2012-03-01 12:37:19 -06:00
Jiří Klimeš
ff0e71607d build: fix build 2012-03-01 17:48:31 +01:00
Dan Williams
57d8ab0ae7 wifi: add forgotten makefile 2012-03-01 08:52:08 -06:00
Dan Williams
ca3c39abd3 wifi: let WEXT be disabled with --with-wext=no
It's still enabled by default if you don't pass --with-wext=no.
But now it's possible to build without WEXT entirely.
2012-02-29 23:11:04 -06:00
Dan Williams
330eb2f74b core: additional connectivity checking debug messages 2012-02-27 10:56:51 -06:00
Dan Williams
5937861ca7 core: fix up connectivity state checks
We want to start the connectivity checks when any device gets
activated, and stop them when all devices get deactivated.  We
also want to make sure it's running if a device gets deactivated
but other devices are still active.  If multiple devices are
activated and if the default device gets deactivated, the other
device may become the default device and we'll need a connectivity
check for that device since we can't do per-device checks yet.

Also, if connectivity checking is enabled at compile-time but
not enabled at runtime, the connectivity bits should always
report "connected" to preserve previous behavior, and this code
makes it clearer how that is handled.
2012-02-27 10:56:51 -06:00
Dan Williams
d47072a1a1 core: clean up and simplify connectivity check
We can just use property notifications instead of having
a separate connected signal.  Also clean up some formatting
and make some private variable names shorter.
2012-02-27 10:56:51 -06:00
Dan Williams
d62f712d6e core: bound connectivity check operations with a socket timeout 2012-02-27 10:56:51 -06:00
Dan Williams
2619c017dd core: make connectivity checking selectable at build-time
Just in case you really don't want to install libsoup.
2012-02-27 10:56:51 -06:00
Dan Williams
7703170673 core: connectivity check cleanups; check response headers too
Clean up some memleaks and fix some possible lifecycle issues
for strings.  Also add a short-circuit check using the HTTP
headers.
2012-02-27 10:56:51 -06:00
Dan Williams
854c2894c4 trivial: whitespace and formatting cleanups 2012-02-27 10:56:51 -06:00
Thomas Bechtold
267bc993a7 core: add internet connectivity check
* use libsoup to compare a http response from a given
  uri with a given response (use g_str_has_prefix () to compare)
* do periodically check the connectivity. Check interval is configurable
* check connectivity when device state change
  from/to NM_DEVICE_STATE_ACTIVATED
2012-02-27 10:56:51 -06:00
Jiří Klimeš
5ea7e6086a core: use glib's CLAMP() macro to simplify ipv6_privacy boundary check 2012-02-27 16:42:07 +01:00
Jiří Klimeš
d376270bfe core: add support for IPv6 Privacy Extensions for SLAAC (RFC4941) (bgo #633233) 2012-02-27 16:35:19 +01:00
Jiří Klimeš
96378dfa82 backends: add a function reading systemwide IPv6 Privacy Extensions configuration
It is distro-specific, but mostly it's net.ipv6.conf.default.use_tempaddr
in /etc/sysctl.conf
2012-02-27 16:28:41 +01:00
Jiří Klimeš
88dc641e6e ifcfg-rh: read/write IPV6_PRIVACY and IPV6_PRIVACY_PREFER_PUBLIC_IP 2012-02-27 16:28:25 +01:00
Jiří Klimeš
785b6fb807 utils: more flexible reading of /proc/sys/net
- changes nm_utils_get_proc_sys_net_value() to allow all values, not just 0,1
- adds nm_utils_get_proc_sys_net_value_with_bounds() for limiting valid values
2012-02-27 16:27:44 +01:00
Jiří Klimeš
23b73b1354 supplicant: fix an error in demarshalling object path
This message was printed:
GLib-GObject-CRITICAL **: g_value_get_string: assertion `G_VALUE_HOLDS_STRING (value)' failed
It showed out it came from g_cclosure_marshal_VOID__STRING() in BSSRemoved signal.
The signal parameter is object path, so use g_cclosure_marshal_VOID__BOXED instead.
2012-02-27 16:17:13 +01:00
Jiří Klimeš
1e8448e377 wifi: fix a crash when nm_ap_get_supplicant_path() returns NULL
nm_ap_get_supplicant_path() can return NULL, so handle the return value
correctly while using it.
2012-02-27 16:13:59 +01:00
Dan Williams
e41218caaa ifnet: misc fixes (constness, error initialization) (bgo #670508) 2012-02-25 20:50:29 -06:00
Mu Qiao
4641649cc1 ifnet: backup configuration files before writing (bgo #670508) 2012-02-25 20:50:27 -06:00
Mu Qiao
cd867534da ifnet: remove wep_tx_keyidx only when necessary (bgo #670508)
Always removing wep_tx_keyidx will cause wpa_supplicant.conf being
written even if nothing has been changed. Now it will be removed only
when wep is not used anymore.
2012-02-25 20:50:24 -06:00
Mu Qiao
28047305db ifnet: fix IP comparison (bgo #670508)
IP comparison was not working due to different IP formats. Now this is
fixed.
2012-02-25 20:50:18 -06:00
Dan Williams
750cb8bb89 ifnet: add testcase for # in passphrase (bgo #670381) 2012-02-25 20:33:00 -06:00
Alexandre Rostovtsev
3feb769efa ifnet: do not truncate WPA passwords at '#' character (bgo #670381)
We need to do the same thing as wpa_supplicant's own config file parser
and ignore '#' characters that occur between the first and last '"'
characters in a config file line.

https://bugzilla.gnome.org/show_bug.cgi?id=670381
2012-02-25 20:32:39 -06:00
Weiping Pan
e8ffca398f ifcfg-rh: add "VLAN=yes" in ifcfg
Check "VLAN=yes" if "TYPE=Vlan" is missing.
They have the same meaning.

This patch is based on NM/vlan branch,
commit 703196fcdb96ad0d4bf8dac572235e65ba02e844

Signed-off-by: Weiping Pan <wpan@redhat.com>
2012-02-24 14:35:15 -06:00