Commit Graph

7740 Commits

Author SHA1 Message Date
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š
788720abec libnm-util: add a property for IPv6 Privacy Extensions to NMSettingIP6Config
ip6-privacy
2012-02-27 16:28:11 +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
Weiping Pan
0878546df0 vlan: add compatible functions for libnl1
If we want to support vlan without libnl3,
then we can use ioctl.

Changelog:
V2: fix identation and comments.

Signed-off-by: Weiping Pan <wpan@redhat.com>
2012-02-24 14:31:41 -06:00
Priit Laes
4fdc64a8c5 Makefile.glib: Fix locale-specific issues
When using Estonian (et_EE) locale, 'a-z' range skips 'tuv...'

https://bugzilla.gnome.org/show_bug.cgi?id=654395
2012-02-24 08:17:38 -05:00
Thomas Bechtold
015fe77b2c core: add missing system includes
for:
open(2), close(2), etc.
for types like ssize_t
2012-02-24 12:10:35 +01:00
Dan Williams
2735205eb0 core: remove invalid bond MAC address filter
There's no way to specify the MAC address bond interfaces have
since they take the MAC address of their slaves, so NMDeviceBond
doesn't implement hwaddr_matches().  This check would always
return FALSE, and thus we'd never match.
2012-02-23 00:04:00 -06:00
Dan Williams
0109ed62e9 core: const-ify nm_device_wired_get_hwaddr() 2012-02-23 00:03:50 -06:00
Colin Walters
74ec56d956 build: fix srcdir != builddir for new generated headers 2012-02-22 16:27:28 -06:00
Dan Williams
7902787263 wifi: fix compatibility with wpa_supplicant 0.7.x
The standard D-Bus PropertiesChanged signals are only in 1.0 and
later, so we also have to listen to the deprecated signals for
older supplicant versions.  We can revert this commit when we
drop support for wpa_supplicant 0.7.x.
2012-02-22 14:45:19 -06:00
Dan Winship
258d0b397c libnm-util: fix a docs typo 2012-02-21 11:22:24 -05:00
Dan Williams
92412357c3 wifi: ensure APs remain in scan list when supplicant updates them
The port to the new supplicant D-Bus API for NM 0.9 had one unfinished
piece, which was to remove old APs from the scan list when the
supplicant returned no scan results or there was a scan error.  In
this case, the removal code would not be called.  This wasn't much
of a problem until 836f7d177e which
began removing APs from the scan list correctly in this case.

This uncovered a bug in NM's wpa_supplicant management code, which
was that NM only updates its internal AP object 'last seen' timestamp
when the AP is reported by the supplicant as a completely new BSS
(in merge_scanned_ap()).  But the new supplicant D-Bus interface
only reports the BSS as "new" when the supplicant doesn't know about
the BSS, either because it is a new BSS or because it's been removed
from the supplicant's scan list at some point in the past.

Thus for BSSes that are consistently kept in the supplicant's scan
list, because the wifi driver is actually doing its job and reporting
them consistently in scan results, NM would not be updating the
'last seen' value for the corresponding NM AP objects.  Due to
836f7d177e this would cause APs that
should be kept to be removed from the NM scan list.

To fix this, have the NMAccessPoint object track which supplicant
dbus object it came from, and have NMSupplicantInterface listen for
PropertyChanged signals for those APs the supplicant knows about.
When something changes (like signal strength as the result of updated
scan results) update the AP's 'last seen' timestamp since it clearly
still exists in the scan list.  This way we update the timestamp both
when the supplicant finds a new AP and when it updates the properties
of existing APs.
2012-02-20 15:06:05 -06:00
Dan Winship
2c6bade5b9 libnm-glib: fix some property-handling warnings
Fix handle_object_array_property() to deal with receiving an empty
list correctly (rather than warning and leaving the property with its
previous value still set).

Also, add two more untracked properties that shouldn't be warned about
(NMDevice:device-type and NMActiveConnection:vpn, both of which are
only used at construct time).
2012-02-20 11:48:31 -05:00
Jiří Klimeš
7b9c728b85 docs: correct NMSettingBond documentation errors 2012-02-20 12:12:40 +01:00
Jiří Klimeš
261d760a8b netlink: fix build on libnl1/2 2012-02-20 10:55:01 +01:00
Dan Williams
0e6de5d2cf modem: get ip-timeout during modem creation
Grab it from the GetAll call where it'll already be instead
of asking for it separately.
2012-02-17 15:32:27 -06:00
Dan Williams
002155fb09 modem: get modem properties using GetAll
More efficient and less error-prone; get all the properties
in one call instead of individually.
2012-02-17 15:32:27 -06:00
Aleksander Morgado
b574524da4 modem: query desired IP timeout value
Different modem implementations in ModemManager are now able to specify specific
maximum durations of the IP configuration setup. This is useful when specific
modems need durations greater than the default 20s (for example, for Satellite
network based modems, where delays are pretty high).
2012-02-17 15:32:22 -06:00
Dan Williams
0be930c0fc core: flush timestamp cache to disk only on activate/deactivate
To suppress periodic disk wakeups, only write timestamps to disk
when a device gets activated or deactivated.  Timestamps are
still updated periodically in memory, just not flushed to disk
at that time.
2012-02-17 09:49:35 -06:00
Dan Williams
78a8afac6c release: bump version to 0.9.3.990 2012-02-16 15:39:08 -06:00
Dan Williams
cf6482baea release: update NEWS 2012-02-16 15:39:03 -06:00
Dan Williams
46eee484f9 core: fix matching VLAN connections to interfaces
The check for virtual interface name was too loose, so
restrict it to VLAN only which is what actually uses it,
and ensure we have an interface name to compare against
the device.

Found by Weiping Pan <wpan@redhat.com>
2012-02-16 15:20:51 -06:00
Dan Williams
0c61a51614 bond: move bond master interfaces to NMDeviceBond
This way clients know it's a bond master, and it allows us to more
cleanly separate the code for bonding and non-bonding cases.
2012-02-16 15:20:50 -06:00
Dan Williams
fdd44b8e00 core: handle explicit device creation on connection activation
If the connection describing the virtual device isn't set to
autoconnect, the device may not yet have been created.  In that
case, create it.
2012-02-16 15:20:50 -06:00
Dan Williams
b35afe4d0f core: automatically create VLAN interfaces when needed 2012-02-16 15:20:50 -06:00
Dan Williams
13c8d2c51e core: add NMDevice hwaddr_matches() class method
Match the device's hardware address with a connection.
2012-02-16 15:20:50 -06:00
Dan Williams
c1a66936f3 core: don't create virtual interfaces we already have
Make sure we don't already have an NMDevice for this interface
before creating it, and also when creating the interface, make
a new NMDevice for it immediately to prevent a race between
telling the kernel to create the interface via netlink, and when
udev later tells us about it.  In between there we could be
triggered to try creating the interface again.
2012-02-16 15:20:50 -06:00
Dan Williams
add5f97b38 core: make the Ethernet class aware of VLAN interfaces
Also track the VLAN ID and master interface index and validate
connections using those.
2012-02-16 15:20:50 -06:00
Dan Williams
fcce9daa15 core: add utility function nm_utils_is_uuid() 2012-02-16 15:20:50 -06:00
Weiping Pan
ccea442504 ifcfg-rh: add ifcfg-vlan writer
add write_vlan_setting() and modify test-ifcfg-rh.c to test it.

Signed-off-by: Weiping Pan <wpan@redhat.com>

(updates by dcbw for changes made to original patch series)
2012-02-16 15:20:50 -06:00
Dan Williams
0c3efb1787 vlan: rework VLAN interface creation/deletion
First make it build on libnl1/2.  Second, the VLAN
virtual interface name might not always be given in the
NMConnection (if the master is a UUID and thus the name
is determined automatically) so just take the interface
name instead.  And make sure we verify it's a VLAN
interface before deleting it.

Lastly, construct the VLAN interface name if it's not
given in the NMConnection.  This means we need to know
the master interface name when creating the connection,
which we always will since you can't create the VLAN
interface without it's master being present.  That also
means we need to return the name to the caller so it
can be used to create the NMDevice for the VLAN interface
after we've created it in the kernel.
2012-02-16 15:05:55 -06:00
Weiping Pan
ab43b7b41d vlan: create/delete kernel vlan device
We make use of libnl (>=3.2.1) to create/delete kernel vlan device,
and it can set vlan id, vlan flags and ingress/egress priority mapping.

V3:
1 nm_netlink_iface_to_index() should use slave name

V2:
1 use existing nm_netlink_iface_to_index()

Signed-off-by: Weiping Pan <wpan@redhat.com>
2012-02-16 15:05:55 -06:00
Dan Williams
b2d9fa2ecd ifcfg-rh: fix parsing of REORDER_HDR
It's a boolean value not a string.  Second, apparently the
kernel turns it on by default these days, so if it's missing
then assume it's supposed to be TRUE.
2012-02-16 15:05:55 -06:00
Dan Williams
ca689a0287 ifcfg-rh: clean up master interface/connection handling
VLAN and bonding both need it so putting these bits in the
code that creates the NMSettingConnection isn't quite right.
2012-02-16 15:05:55 -06:00