Commit Graph

7207 Commits

Author SHA1 Message Date
Dan Williams
30c63ddcb7 settings: fix assertion checks 2011-05-04 17:12:35 -05:00
Dan Williams
c4b922ed21 core: emit textual descriptions of device state changes
Throw users a bone about what's happening.
2011-05-03 11:57:26 -05:00
Dan Williams
2e740fe308 core: fix up checks for s390 CTC device type (bgo #649025)
The original check had incorrect logic; correct it.
2011-05-03 10:38:32 -05:00
Dan Williams
f898dbf1a9 dispatcher: enhance dispatcher script environment (bgo #648382)
For VPN connections, the interface name would be that of the VPN's
IP interface, but the script environment would be the that of the
VPN's parent device.  Enhance the environment by adding any VPN
specific details as additional environment variables prefixed by
"VPN_".  Leave the existing environment setup intact for backwards
compatiblity.

Additionally, the dispatcher never got updated for IPv6 support,
so push IPv6 configuration and DHCPv6 configuration into the
environment too.

Even better, push everything the dispatcher needs to it instead
of making the dispatcher make D-Bus requests back to NM, which
sometimes fails if NM has already torn down the device or the
connection which the device was using.

And add some testcases to ensure that we don't break backwards compat,
the testcases here were grabbed from a 0.8.4 machine with a hacked up
dispatcher to dump everything it was given from NM.
2011-05-02 22:54:28 -05:00
Dan Williams
3620353050 core: add --version and allow it and --help to be run without root 2011-04-28 16:55:35 -05:00
Dan Williams
a0fd14500e wifi: enable background scanning for WPA Enterprise
Enable the supplicant's optimized background scanning functionality
for WPA Enterprise setups so that roaming works correctly.  Otherwise
there are issues pingponging between APs and having an up-to-date
scan list for roaming, since NM only scans every 2 minutes.  The
supplicant can trigger optimized scans based on signal quality
thresholds and such and make these roaming decisions much better
than NM can.
2011-04-27 16:22:54 -05:00
Dan Williams
aeb7123368 ppp: make prototypes more valid
So they pass -Wstrict-prototypes which we aren't using but might
some day.
2011-04-26 13:49:05 -05:00
Dan Williams
67e092abcb core: better handling of rfkill for WiMAX and WiFi (bgo #629589) (rh #599002)
This commit changes rfkill state handling slightly in the following
ways:

- when checking whether a user toggle request can change radio state,
ignore states we can change in radio_enabled_for_rstate() as a result
of the toggle; this fixes WiMAX enable/disable because a softblock
can be changed by telling wimaxd to enable the radio.  As a side-effect
this also fixes handling of WiFi when altering the rfkill state as well.

- make WiFi user toggle requests change wifi killswitch state; this has
been long requested and on the TODO list for a while and it turns out
to be a lot easier to do these days.  This provides the expected
behavior when disabling wireless from user agent menus since there's
not an easy way to do this other than dropping to shell and running
rfkill.
2011-04-22 14:56:31 -05:00
Dan Williams
8cce42f2a5 core: add GetDeviceByIpIface method
Allow clients to get a device by its IP interface name instead
of having to get the device list and iterate through each one,
and read the interface name to get what they want.
2011-04-22 12:29:07 -05:00
Dan Williams
4cae0bb0fa settings: add a GetConnectionByUuid method
If the client knows the UUID, add a convenience function to get
the connection path directly, instead of having to iterate the
whole connection list and get each connection's details and then
check the UUID.
2011-04-22 12:29:07 -05:00
Dan Williams
bb8e9a0b18 api: add "Uuid" property to ActiveConnection interface
A convenience so that clients which might key certain operations off
which connections are active (checking work mail only when on VPN for
example) can more easily get which connections are active.  This would
allow those apps to store the UUID (which they would already be doing)
and not have to create a Connection proxy and then get the connection
properties just to retrieve the UUID of the connection.  Instead they
can now get it from GetAll of the ActiveConnection object, which they
would already be doing.
2011-04-22 12:29:07 -05:00
Jiří Klimeš
e30287aa84 ifcfg-rh: fix emitting signal for unmanaged specs when removing connection (rh #698202)
The signal was emitted in case the removed connection was managed instead of
for unmanaged connection. Thus the signal had no effect.
That caused incorrect behaviour in case of changing NM_CONTROLLED=no to yes.
That didn't enable the device; only after the file was changed for the second time.
2011-04-20 12:26:20 -04:00
Dan Williams
258912524e ifcfg-rh: fix writing out WPA connection which is changed to open (rh #695604)
We need to remember to clear out keys that aren't getting used since
we're not rewriting the whole ifcfg file.
2011-04-19 15:42:08 -05:00
Dan Williams
2e33be3385 ppp: be more paranoid about cleaning PPP manager up
Make sure the dispose won't run twice for the same code and
make sure we never schedule a handler for monitor_cb() more
than once, though it's really hard to see how that could ever
happen anyway.

Another attempt to blindly fix lp:752143
2011-04-19 12:11:58 -05:00
Dan Williams
6d9c4c64b4 modem: ensure PPP manager is always cleaned up
While this should never happen while the PPP manager is alive, modems
can switch their IP method while alive, since the net port is sometimes
discovered after the serial ports have been.  This happens for some
devices that have separate drivers for the net and serial sides, like
ZTE Icera-based devices (cdc-ether and cdc-acm) and newer Sierra
devices (sierra and sierra-net).  Just be paranoid here and ensure
that the PPP manager gets cleaned up.

Partial attempt at fixing lp:752143
2011-04-19 12:01:24 -05:00
Dan Williams
ee3d29107f modem: remove dead code 2011-04-19 11:58:47 -05:00
Dan Williams
8b445c0872 policy: don't recheck auto-activation when device is UNMANAGED or UNAVAILABLE
Pointless, since we're not going to activate it anyway when it's
in one of those states.
2011-04-19 00:31:53 -05:00
Dan Williams
1eae713a63 policy: clarify device auto-activation code
Instead of having new/delete code sprinkled around, consolidate it.
2011-04-19 00:26:37 -05:00
Dan Williams
b946cbb3b8 settings: simplify some code 2011-04-19 00:26:07 -05:00
Dan Williams
6cbaf8a7ef settings: fix refcount mismatch (bgo #647066)
The default wired connection should own a reference to the device
it's made for, but that got dropped in
78df8c49a1, which used to use a
set_property handler with g_value_dup_object() which obviously
increments the reference count.  But that ref got dropped when
the object initialization was simplified.
2011-04-19 00:23:43 -05:00
Dan Williams
a234c6b80c trivial: remove some dead code 2011-04-19 00:22:46 -05:00
Dan Williams
834315eb95 dns: write usable resolv.conf on shutdown if DNS plugins are used
If any ethernet devices were left up (because we can assume control
over them seamlessly when NM starts up again) make sure we write
out a usable resolv.conf for the device on shutdown, otherwise the
users networking is broken with an empty resolv.conf.  This only
happened when DNS plugins were active, in which case the user
would be left with a localhost-pointing resolv.conf but no
local caching nameserver running since NM shut it down when NM
terminated.
2011-04-18 12:41:16 -05:00
Dan Williams
c91cda8364 wifi: use AP flag types consistently
We've got types for this stuff in NetworkManager.h, let's use them.
2011-04-15 12:24:14 -05:00
Dan Williams
688da0fe4f core: better fix for ignoring return value of write(2)
Casting to (void) still doesn't do it, so just assign it to
something and ignore it, in conjunction with
-Wno-unused-but-set-variable
2011-04-14 17:10:05 -05:00
Dan Williams
f7428864ae core: fix ignoring return value of write(2) 2011-04-14 17:09:54 -05:00
Dan Williams
8af03101b5 core: fix up easytether patch to actually compile 2011-04-14 14:42:40 -05:00
Torsten Spindler
167936f47d core: enable Easytether Android USB interfaces
These interfaces are a proprietary USB-ethernet-style virtual interface
that of course does not have proper driver links.  Given that it's so
easy to support, just do it.
2011-04-14 13:35:57 -05:00
Dan Williams
df511f74f7 build: use -Wundef and fix up cases where stuff wasn't defined (bgo #647157) 2011-04-14 13:19:12 -05:00
Jiří Klimeš
0acd1d322b ifcfg-rh: fix some memory leaks in tests (test-ifcfg-rh.c) 2011-04-14 16:57:34 +02:00
Jiří Klimeš
0937b985da ifcfg-rh: fix some memory leaks in ifcfg-rh plugin 2011-04-14 16:56:20 +02:00
Dan Williams
e116ee9d8a core: don't keep re-reading the ConsoleKit database
Due to a stupid error the cache wasn't actually getting used and
way more than one SessionMonitor was getting created.
2011-04-14 09:20:17 -05:00
Jiří Klimeš
dae8ab9be9 ifcfg-rh: fix memory leaks in tests (test-ifcfg-rh-utils.c) 2011-04-14 12:00:32 +02:00
Jiří Klimeš
92b55e709a ifcfg-rh: fix read-after-free error in reader.c 2011-04-14 11:41:55 +02:00
Jiří Klimeš
b7b5599fb3 ifcfg-rh: add testcases for IPv4 manual addresses 2011-04-14 10:53:26 +02:00
Jiří Klimeš
ccd39a8cb9 ifcfg-rh: adjust handling IPADDRn, PREFIXn (NETMASKn) and GATEWAYn (rh #658907)
Now that initscripts also support IPADDRn syntax, update the implementation
to match the intitscripts' one (see rh #633984)
Basically, writer produces IPADDR0 .. IPADDR255. reader is more tolerant and
supports older configs too: IPADDR, IPADDR0, IPADDR1 could be missing, from
IPADDR2 up the indexes have to be contiguous.
2011-04-14 10:30:51 +02:00
Dan Williams
9152c304ff wwan: fix enabled state detection (bgo #647216)
Since the user state stuff got committed in 0.8.2, WWAN enable
state has been somewhat broken.  The problem is that we want two
things: (1) that the current modem enabled state is reflected
in the WwanEnabled property, and (2) that enabled state should not
affect the user's ability to enable the modem via the UI.

The code did not properly separate these two.  For all automatic
decisions and properties (ie the WwanEnabled property, setting the
initial enabled state on startup or hotplug, etc) the ModemManager
enabled state should be respected.  But the user should be able
to override that state by turn WWAN on.

This calls for a fourth enabled check that modems have, the 'daemon'
state, distinct from the hardware and software kernel rfkill states
and from the user's chosen enabled/disabled state.  Add that new
check.

The actual problem was in manager_radio_user_toggled() where after
updating the user enabled state, new_enabled still equaled
old_enabled, because the kernel rfkill state was a combination of
both the kernel rfkill state *and* the ModemManager enabled state,
so the manager_update_radio_enabled() call would never happen and
the modem would never become enabled as a result of a user request.
2011-04-13 21:58:25 -05:00
Dan Williams
080738c432 trivial: fix WWAN killswitch name
It's an acronym and should thus be capitalized.
2011-04-13 21:34:23 -05:00
Dan Williams
832e64f8bc core: remove un-needed NMActRequest from VPN connection creation
It's not required for anything.
2011-04-13 15:37:22 -05:00
Karsten Hopp
8407a9f92c core: handle s390 CTC-type devices too (bgo #647578) (rh #641986) 2011-04-12 15:42:40 -05:00
Dan Williams
d90e6423c8 ifcfg-rh: fix up s390 CTC adapter reading and writing (bgo #647578) (rh #641986) 2011-04-12 15:38:47 -05:00
Dan Williams
5af6a4baec ifcfg-rh: add testcase for S390 CTC-type connections (bgo #647578) (rh #641986) 2011-04-12 15:03:09 -05:00
Dan Williams
ed5e466311 core: use the VPN manager from priv data
Pointless to get/unref it when we already have a pointer to it
sitting around in the private data.
2011-04-12 14:13:13 -05:00
Dan Williams
c269735e9c build: remove non-existent include directory (bgo #647159) 2011-04-11 16:44:40 -05:00
Dan Williams
08aabc2bee core: aggregate ConsoleKit sesson data (bgo #647454)
Jan Schmidt noticed that things didn't work as expected with
multiple sessions of the same user, since when inserting the
new session the old one was forgotten.  Thus bad things happened
if you were local in the old session but not in the new one
since only the new one would be considered.

Instead, make the actual data stored the aggregate of all
sessions for that user.
2011-04-11 16:43:39 -05:00
Dan Williams
5cd14f05b7 Revert "core: aggregate ConsoleKit sesson data (rh #647454)"
This reverts commit 328068c7fe.

The bug tag in the commit message is wrong, it should be
bgo and not rh.
2011-04-11 16:43:01 -05:00
Dan Williams
328068c7fe core: aggregate ConsoleKit sesson data (rh #647454)
Jan Schmidt noticed that things didn't work as expected with
multiple sessions of the same user, since when inserting the
new session the old one was forgotten.  Thus bad things happened
if you were local in the old session but not in the new one
since only the new one would be considered.

Instead, make the actual data stored the aggregate of all
sessions for that user.
2011-04-11 16:35:38 -05:00
Dan Williams
c7d1bf18c4 wifi: fix connection completion when no wifi setting is sent
In NMDeviceWifi's real_complete_connection() the wifi setting
was looked up at the start of the function, but if no wifi
setting was sent by the caller, it would be NULL.  The wifi
setting would later get added by nm_ap_utils_complete_connection(),
but after calling that the new wifi setting would not be looked
up again.  Make that clearer by moving the wifi setting add code
to the wifi device's real_complete_connection() and not burying
it in some other function.  This is more like what other device
types do.
2011-04-11 11:42:12 -05:00
Dan Williams
b6e66c8ff4 core: don't call g_main_loop_quit() from the signal handler
Besides not being technically reliable (although it mostly works)
we could get into situations where systemd would kill the cgroup
which resulted in NM getting a SIGCHLD for dhclient children before
the SIGTERM quit the mainloop.  This caused NM to think that the
dhclient process died unexpectedly, and to tear down the connection
even though what NM really wanted to do was just leave everything
running so that the connection could be taken over on restart.
2011-04-08 14:36:14 -05:00
Dan Williams
5e21728e59 core: suppress error messages if addresses/routes already exist 2011-04-05 10:19:08 -05:00
Dan Williams
5ca747316e ip6: remove useless include 2011-04-05 10:04:57 -05:00