Commit graph

3026 commits

Author SHA1 Message Date
Dan Winship
49105f7115 core: do a better job of applying bond configuration
Reset all known bond options to their default values, not just the
ones that NMSettingBond allows overriding. Also, remove any bond
slaves that were already attached to the bond before we managed it.

Only update bond parameters that need to be updated. In particular,
setting either arp_interval or miimon to 0 has the side effect of also
setting the other one to 0, so don't do that if it's already 0.

Fix the handling of arp_ip_target; the sysfs arp_ip_target node does
not work the same way as the ifcfg BONDING_OPTS line (which is what
the code was assuming before).
2012-03-22 13:12:57 -04:00
Dan Winship
4ad810fdf4 core: fix NMDeviceBond:dispose() to chain up 2012-03-22 13:12:57 -04:00
Dan Williams
925119074d wifi: work around more wl.o stupidity
Sometimes returns 0 for the current frequency when the radio is
active.  WTF?
2012-03-22 11:50:11 -05:00
Dan Williams
71ad568cfb ip6: fix setting default route with libnl3 (bgo #668286)
libnl3 wants a destination address when setting a route, so just hand
it '::' with a address len of 0 so we don't get -NLE_MISSING_ATTR
when trying to set the IPv6 default route.
2012-03-22 09:21:38 -05:00
Dan Williams
1ecc9c215c trivial: formatting fixes 2012-03-21 22:58:00 -05:00
Dan Williams
2290a70385 firewall: set interface zone before IP configuration (rh #805405)
We need to set the interface's firewall zone before we kick off
any sort of IP configuration, so that rules for stuff like
DHCP are already handled by the time that these services are started.
2012-03-21 15:10:11 -05:00
Dan Williams
43f449824a mobile: ensure IPv4 timeout fails activation
With the switch to IPv4 being allowed to fail by default we need
to clean up this old code a bit.  PPP failure during IP config
should trigger a timeout, and the core code will handle whether
to fail the device completely or not.  But if we got a valid IPv4
config and PPP failed later, the device gets failed.  Previously
the device would just sit in IP_CONFIG state because now IPv4
defaults may-fail to TRUE, and when PPP failed the
nm_device_ip_config_should_fail() check would obviously not pass.
2012-03-20 23:21:17 -05:00
Jiří Klimeš
5238aa4107 utils: override VPN plugin's never-default when ignoring auto routes (rh #804563)
Setting never-default ito TRUE when VPN server provides routes was done
in https://bugzilla.gnome.org/show_bug.cgi?id=621698
2012-03-20 17:17:49 +01:00
Dan Williams
ce6b667a68 wifi: make sure we're connected to netlink before using it
This should fix the warning "failed to allocate link cache" when a
new device is added.  It doesn't affect WiFi operation, and the
code would fall back to non-nl80211 mechanisms of detecting whether
a device was wifi or not, so it corrects this check and quiets the
error message.
2012-03-19 16:09:46 -05:00
Mathieu Trudel-Lapierre
1a531b7ecf keyfile: fix testcases after InfiniBand transport-mode default change 2012-03-19 10:10:36 -05:00
Dan Williams
69247a00ea wifi: disable Ad-Hoc WPA connections (lp:905748)
The kernel is broken for Ad-Hoc WPA, and creates the connections
as open connections instead.  Yeah, eventually we can use
wpa_supplicant with RSN support, but for now we just have to
disable Ad-Hoc WPA because it's a problem to say we're creating
a protected network but then have the kernel not do that for
us.  Will be re-enabled once all the necessary bits have been
fixed.

Note that Ad-Hoc WPA has been broken since at least 2.6.32 with
mac80211-based drivers, which is what most users will be using.
2012-03-16 17:58:23 -05:00
Dan Williams
c455eafbef infiniband: fix missing sentinal in 04959c39aa 2012-03-16 15:20:58 -05:00
Dan Winship
04959c39aa Add a workaround for a problem creating InfiniBand connections
It is currently not possible to create a connection where the
connection-type-specific NMSetting has all default values. This hasn't
been a problem in the past because each type had at least one property
that either had no default value or had a default value that didn't
pass verify(). But NMSettingInfiniband didn't have that property, so
it's impossible to create an InfiniBand connection unless you change
the value of at least InfiniBand-specific setting.

Work around this for now by making the default value of
NMSettingInfiniband:transport-mode be NULL, so it needs to be
overridden.
2012-03-16 14:13:52 -04:00
Dan Williams
6b9511f6e9 core: treat missing IPv6 setting as AUTO
Like IPv4, if the connection contains no IPv6 setting, perform
IPv6 addressing.  Since may-fail defaults to TRUE for IPv6, failure
should have no consequence.
2012-03-16 09:43:16 -05:00
Dan Williams
43ba4eb04b ifcfg-rh: fix testcase after 4abb300c96 2012-03-15 17:56:34 -05:00
Evan Broder
447342744e vpn: add a new field so VPN plugins can specify multiple domains 2012-03-15 17:10:15 -05:00
Mathieu Trudel-Lapierre
956e63a673 dnsmasq: allow proxying dnssec data (lp:946093)
This will allow DNSSEC data to be visible in browsers, which would otherwise
not be the case by default because of dnsmasq acting as a middle-man for
resolution.

Otherwise, we have a regression from the libc resolver behavior.
2012-03-15 16:58:19 -05:00
Andrew Bird
34aef8aaaa gsm: pass the PPP auth preferences for STATIC and DHCP device use
When using the either DHCP or STATIC IpMethods the modem manager
or device itself negotiates the PPP session so we need to pass
the authentication preferences through to MM.

Notes:
        1/ Using a bitfield now that happens to match the Ericsson
in the lower orders so that it's far more tidy.
        2/ Devices that wish to utilise this should observe the
following:
        If the bitfield doesn't exist in the dict, then MM uses the
modem default, if it does, MM tries to fulfill the request. If the
modem can only accept one value (Qualcomm-type devices accept only
None, PAP or CHAP with AT$QCPDPP) then MM picks the appropriate one
from the dict if only one of PAP or CHAP was given, otherwise we
default to PAP.

(dcbw: make enum a bitfield instead of the bit position)
2012-03-15 16:19:43 -05:00
Tore Anderson
4abb300c96 core: allow IPv4 to fail by default
(comments by dcbw)
This allows out-of-the-box connectivity	on IPv6-only networks.
Once caveat is that connections	where the user currently
expects	no IPv4	connectivity to	terminate the connection and
retry will no longer do	so until IPv6 also times out, and if
that network where IPv4	is expected to fail also has an IPv6
router sending advertisements, the connection will succeed
instead	of failing.  That can be resolved by setting the
right bit in the connection's config file; and it's expected
that the number	of users who expect IPv4 failure on a
network	with usable IPv6 connectivity is quite small
compared to the	benefit	of OOB IPv6 connectivity.
2012-03-15 15:58:24 -05:00
Dan Williams
04b2a74336 wifi: yet another nl80211 processing fix
Make the meaning of done actually reflect what's happening,
and make sure that when we get an error in the error handler,
that the processing loop breaks out and returns that error.
This wasn't happening for Ad-Hoc connections, which apparently
return various errors for things, leading to blocking in
recv() in the kernel waiting for more data that would never
come, because we'd already gotten an error.
2012-03-15 15:01:30 -05:00
Dan Williams
b44b0321a0 core: fix carrier-triggered state re-entrancy issue (rh #800690)
Carrier checking can be synchronous, like when bringing up the device.
If the carrier changes as a result of the sync carrier state checking,
the code might change state.  Unfortunately brining up a device
happens in response to a state change already, and we can't change
state from within handlers for the device state change signal, so
we need to queue up the new state change that results from a
carrier change.
2012-03-14 12:20:23 -05:00
Dan Williams
50a9cfd8f7 core: fix queued state change debug message
Show the actual ID, not 0.
2012-03-14 12:20:23 -05:00
Dan Williams
cfa1536fa8 ifcfg-rh: fix distcheck 2012-03-13 14:50:36 -05:00
Jiří Klimeš
a0b658281f ifnet: use nm_connection_get_setting_connection() to get 'connection' setting 2012-03-13 12:23:40 +01:00
Dan Winship
54ef8f3224 Fix names of error enum values
When NM was registering all of its enum types by hand, it was using
NamesLikeThis rather than the default names-like-this for the "nick"
values. When we switched to using glib-mkenums, this resulted in
dbus-glib using different strings for the D-Bus error names, causing
compatibility problems.

Fix this by using glib-mkenums annotations to manually fix all the
enum values back to what they were before. (This can't be done in a
more automated way, because the old names aren't 100% consistent. Eg,
"UNKNOWN" frequently becomes "UnknownError" rather than just
"Unknown".)
2012-03-12 15:29:52 -04:00
Dan Williams
8a6d2aa7e9 trivial: fix completed VLAN connection name
VLAN is an acronym and thus should be capitalized.
2012-03-09 17:39:58 -06:00
Mu Qiao
e7380561d5 ifnet: remove system prefix
As all connections are system connection so the prefix is meaningless.
Drop it now.
2012-03-09 12:46:49 -06:00
Mu Qiao
e3a1b6e065 ifnet: ignore per-user connections
Ifnet currently does not deal with user agent service. Any connection
that comes with flagged secrets or is not system connection will be
ignored by the plugin. Thanks to David Narvaez for his great help on
this problem.
2012-03-09 12:45:25 -06:00
Dan Williams
7f717f905b build: make VLAN code compatible with older kernels
Apparently VLAN_FLAG_LOOSE_BINDING isn't in older kernels like 2.6.32.
2012-03-09 12:20:42 -06:00
Dan Williams
6f19e1e18c wifi: fix typo in wifi detection code (bgo #671276)
Would affect non-nl80211 drivers since all nl80211 drivers have the
phyX link in sysfs and thus this code wouldn't get run for them.

Found by Dmitri <mitya@mageia.org>
2012-03-09 11:10:32 -06:00
Dan Williams
bba834f842 wifi: fix entering possible endless loop
Clarify how we're supposed to break out of the nl_recvmsgs() loop
and also break out if we get an error from nl_recvmsgs().  What's
supposed to happen is that one of the callbacks we've registered
figures out that we're done and sets the 'done' flag, which then
breaks out of the recvmsgs() loop.  Using 'err' there previously
was pretty unclear.
2012-03-08 12:48:46 -06:00
Dan Williams
25e011b5cf Revert "wifi: fix entering an endless loop"
This reverts commit 84403ab84a.

It appears we want to loop until one of the callback says we're
done, while this patch would exit too early (possibly before we'd
received a reply) since nl_recvmsgs() returns 0 on success.  What
we really want do do here is wait for one of the callbacks we've
registered to tell us that they've successfully handled the message
and gotten a reply.
2012-03-08 12:41:15 -06:00
Dan Williams
dc6341acec vlan: try harder to get carrier state at device creation time
The carrier signal might be delayed a bit, so if we're creating
the device as a result of activating a connection, make sure the
carrier is up-to-date so we can proceed with activation.
2012-03-07 10:15:30 -06:00
Jiří Klimeš
84403ab84a wifi: fix entering an endless loop 2012-03-07 15:31:19 +01:00
Jiří Klimeš
79757f10f3 ifcfg-rh: use single quotes when quoting WPA passphrases (WPA_PSK) (rh #798102)
Single quotes ensure we don't break initscripts (bash processing) when the
string contains special characters. Special handling is necessary for single
quotes characters. They have to be escaped and the whole string has to be
prepended with '$' character so that bash is happy.
This change also filters out CR and LF characters as they break WPA_PSK
variable and could pose security issues.
2012-03-07 14:45:37 +01:00
Dan Winship
49214066a4 Fix capitalization of "InfiniBand"
"InfiniBand" has a capital "B". Fix that everywhere it's being used as
a human-readable string.

In particular, the RH initscripts recognize "TYPE=infiniband" and
"TYPE=InfiniBand", but not "TYPE=Infiniband", which is what we were
writing before.
2012-03-06 13:23:29 -05:00
Dan Williams
11da5fb6bc core: handle NULL device path for activation
For virtual interfaces and other cases we won't necessarily have
a device path, which means clients will be passing "/" instead.
Fix that up the same way we fix up the specific object.
2012-03-06 12:00:41 -06:00
Dan Williams
3567e6f9ea core: remove some redundant code and add some argument checks
ifindex is already passed to the function, no need to look it
up again.
2012-03-06 11:38:03 -06:00
Dan Williams
cd2c721762 core: use a second startup pass to detect all VLAN interfaces
We can't guarantee the ordering of devices that udev sends to us
on startup.  Thus, a VLAN interface could be sent before its
parent is, and we won't be able to find the parent in the device
list.  But that's fine; all parents will be detected during the
first pass, and we silently fail the VLAN interface.  Then we
do a second pass where any remaining VLAN interfaces will be
created because we found the parents during the first pass.
2012-03-06 11:07:15 -06:00
Dan Williams
8c3ac9bdd8 trivial: s/master/parent for VLAN interface info function 2012-03-06 11:07:15 -06:00
Dan Williams
723bab41ea ifcfg-rh: remove duplicate tests 2012-03-06 00:36:55 -06:00
Dan Williams
0d2aac2021 wifi: remove unused nl80211 attributes that break build on older kernels 2012-03-06 00:38:57 -06:00
Dan Winship
51f2bd0198 ifcfg-rh: don't write out a fake minimal IP4 config for bond slaves
The writer had code to fake up a simple IP4 config if the connection
didn't already have one. Make sure we don't do that in the bond case.
2012-03-05 15:55:43 -05:00
Dan Williams
a6809b0253 ip6: set binary NL address prefix too
There's both nl_addr_set_prefixlen() to set the binary address's
prefix length and rtnl_addr_set_prefixlen() to set the container
RTNL address's prefix length.  When the addresses come in from
the kernel these are the same, but when sending addresses to
the kernel, NM wasn't setting them to the same thing.  Do that,
since apparently libnl wants that when matching addresses in
nm-system.c:sync_addresses() here:

	if (addrs[i] && nl_object_identical (match, (struct nl_object *) addrs[i]))
		break;

otherwise the kernel addres (match) doesn't match the NM-derived
address (addrs[i]) that we got from the IP6Manager when reading
back kernel IPv6 addresses in response to netlink events.
2012-03-05 10:28:18 -06:00
Dan Williams
a9c3fe021a ip6: print out prefix in some debug messages 2012-03-05 10:28:17 -06:00
Jiří Klimeš
74d962e8c4 trivial: spacing fix 2012-03-05 13:19:47 +01:00
Dan Williams
5cd9b1e22f wifi: don't remove APs still known to the supplicant
Because the supplicant doesn't have a BSS property for "last seen"
we have to fake that by listening to PropertiesChanged events for
stuff like signal strength, which usually changes a bit from scan
to scan.  But in case it doesn't change, we'll never get that PC
signal, and thus we'll never update our internal 'last seen'
timestamp, and thus the AP will get removed from the NM scan list
even if it was in the supplicant's last scan results.

So, if the AP if we haven't receieved a BssRemoved signal for the
AP yet don't remove it from the NM scan list.  One caveat is that
if the supplicant's DEFAULT_BSS_EXPIRATION_AGE value is greater
than NM's AP expiration age, NM will by consequence use the
supplicant's value instead.  At the moment the supplicant sets
DEFAULT_BSS_EXPIRATION_AGE to 180 seconds while NM's is 360.
2012-03-02 18:17:34 -06:00
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