Commit Graph

10267 Commits

Author SHA1 Message Date
Dan Williams
aff6a70c52 dhcp: convert options testcases to g_assert() 2014-07-22 14:39:19 -05:00
Dan Williams
31d19f51d1 dhcp: filter DHCP options when setting them
Don't bother storing all the options, only store the ones we care
about and ones we export through the NMDHCP4Config and NMDHCP6Config
objects.
2014-07-22 14:39:19 -05:00
Dan Williams
4ce6e39a8f dhcp: pass IP config in state signal
Just pass it in the state change signal.
2014-07-22 14:39:19 -05:00
Dan Williams
5b4be27f4a dhcp: consolidate and simplify DHCP options tests
Previously the tests required that a NMDHCPClient object was
created, but all that's really being tested is the DHCP option
parsing and that doesn't need a client object now that the
option parsing has been split out.

Also, the options test wasn't in src/dhcp-manager/, so put it there.

Lastly, the test ran for both dhclient and dhcpcd, but the code
executed for both cases was the same, so there's no reason to keep
running the test for both clients.
2014-07-22 14:39:19 -05:00
Dan Williams
f275a66105 dhcp: split out DHCP options processing
No code changed except passing what used to use "priv->" as
function parameters.
2014-07-22 14:39:19 -05:00
Dan Williams
5b5801f268 dhcp: find existing clients by ifindex, not interface name
More robust against ifname changes, plus we save some strcmps().
For the most part, the interface name should be informational
only and unused for actual control logic.
2014-07-22 14:39:18 -05:00
Dan Williams
fec121fd9d dhcp: remove the client REMOVE signal
Instead of using a separate signal for it, just drop and release
the client object when it reaches terminate states like TIMEOUT,
FAIL, and DONE.  The 5 second removal signal timeout appears to
no longer be necessary, since the running child process is killed
synchronously.
2014-07-22 14:39:18 -05:00
Dan Williams
7262e606c4 dhcp: always signal state changes
Modify code so that listeners remove state change signal handlers
before stopping the client.  Which means we can remove the 'emit_state'
argument from nm_dhcp_client_set_state().
2014-07-22 14:39:18 -05:00
Dan Williams
180d298dea dhcp: make nm_dhcp_client_set_state() available to subclasses
Not all state changes will be done in the base NMDHCPClient class
anymore, especially with non-subprocess DHCP clients.
2014-07-22 14:39:18 -05:00
Dan Williams
a7a84d7f76 core: consolidate DHCP client termination in dhcp[4|6]_fail()
DHCP failure should just clean up the client in all cases.  This
also has the benefit of removing the signal handler for the DHCP
client's state-change signal before telling the client to terminate,
which will simplify some DHCP code later.
2014-07-22 14:39:18 -05:00
Dan Williams
9568ae52e4 dhcp: merge TIMEOUT signal with DHCP_STATE_TIMEOUT
No reason to have two signals for the same thing. Previously, the
TIMEOUT signal was used for the internal overall DHCP transaction
bound, while DHCP_STATE_TIMEOUT/DHC_TIMEOUT was a signal from
the DHCP client itself that something had timed out.  But in both
cases the results should be the same, so just collapse the
stand-alone TIMEOUT signal into the DHCP_STATE_TIMEOUT state.
2014-07-22 14:39:18 -05:00
Dan Williams
9e75e2ad0d dhcp: simplify DHCP states
The existing DHC_* states are pretty specific to dhclient, and aren't
useful for more generalized DHCP.  NetworkManager wasn't using many
of the states anyway, and doesn't need to differentiate between
states like REBOOT/REBIND/RENEW anyway.  So simplify the DHCP states
into the ones we really care about.
2014-07-22 14:39:18 -05:00
Dan Williams
30cdd1248c dhcp: handle DHCP clients that aren't subprocesses
Make the base class mostly ignorant of process IDs, except for a
few utility functions.
2014-07-22 14:39:17 -05:00
Dan Williams
37b6fc1c85 dhcp: pass ifindex to DHCP clients 2014-07-22 14:33:39 -05:00
Jiří Klimeš
5de8173584 Merge changes for SW device capability, Delete() for SW devices (rh #1034150)
https://bugzilla.redhat.com/show_bug.cgi?id=1034150
2014-07-22 14:34:07 +02:00
Jiří Klimeš
c7a567ca90 cli: add 'nmcli device delete <ifname>' command (rh #1034150)
It only works for software devices. When called for a hardware device,
an error is returned and the device is not deleted.

https://bugzilla.redhat.com/show_bug.cgi?id=1034150
2014-07-22 14:24:43 +02:00
Jiří Klimeš
576c82049b libnm-glib: implement nm_device_delete() for D-Bus device' Delete() method 2014-07-22 14:24:42 +02:00
Jiří Klimeš
3ff1477349 device: add a new D-Bus 'Delete' method for removing software devices 2014-07-22 14:24:42 +02:00
Jiří Klimeš
a0b3e4fff0 cli: show whether the device is software-based in CAPABILITIES 2014-07-22 14:24:42 +02:00
Jiří Klimeš
ddec669ad1 cli: show IS-SOFTWARE property in GENERAL section for devices 2014-07-22 14:24:42 +02:00
Jiří Klimeš
3dbe8041a7 libnm-glib: add nm_device_is_software() function to NMDevice
It says whether the device is a software one, according to device capabilities.
2014-07-22 14:24:42 +02:00
Jiří Klimeš
bbf13002d3 device: indicate software devices in NMDeviceCapabilities
It is visible by clients in 'capabilities' property.
2014-07-22 14:24:42 +02:00
Jiří Klimeš
4c36ff7062 include: add NM_DEVICE_CAP_IS_SOFTWARE capability
for marking software devices.
2014-07-22 14:24:42 +02:00
Dan Williams
d8d0b37adc platform: fix uninitialized variable usage after fdf78b3d
'address' was not initialized, so using address.ifindex was not
going to work.

==6777== Conditional jump or move depends on uninitialised value(s)
==6777==    at 0x44A6DB: check_cache_items (nm-linux-platform.c:1510)
==6777==    by 0x44AA4F: announce_object (nm-linux-platform.c:1586)
==6777==    by 0x44A59A: refresh_object (nm-linux-platform.c:1666)
==6777==    by 0x44A676: check_cache_items (nm-linux-platform.c:1517)
==6777==    by 0x44A812: announce_object (nm-linux-platform.c:1566)
==6777==    by 0x44D957: handle_udev_event (nm-linux-platform.c:3964)
==6777==    by 0x3BAFC125A7: g_closure_invoke (gclosure.c:777)
==6777==    by 0x3BAFC2465C: signal_emit_unlocked_R (gsignal.c:3586)
==6777==    by 0x3BAFC2C3E1: g_signal_emit_valist (gsignal.c:3330)
==6777==    by 0x3BAFC2C69E: g_signal_emit (gsignal.c:3386)
==6777==    by 0x3D93A03BE3: ??? (in /usr/lib64/libgudev-1.0.so.0.1.3)
==6777==    by 0x3BAF8521D5: g_main_context_dispatch (gmain.c:3066)
2014-07-21 13:09:47 -05:00
Thomas Haller
faa6c34db1 libnm-glib: evaluate assert check only once in test-remote-settings-client
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-21 12:20:56 +02:00
Dan Williams
02a5b972e6 trivial: simplify some code 2014-07-20 12:00:21 -05:00
Dan Winship
396610d14a libnm-glib: fix assertion-failure messages in test-remote-settings-client
test-remote-setting-client uses a macro:

    #define test_assert(condition) \
    do { \
        if (!G_LIKELY (condition)) \
            cleanup (); \
        g_assert (condition); \
    } while (0)

where cleanup() kills the fake remote-settings service and unrefs
settings. However, in many cases, "condition" would involve a test
against a connection that was owned by settings, so if the check
failed, the connection would end up getting freed by cleanup(), and so
then the second invocation of condition would result in the program
aborting on a failed check somewhere else (eg, "invalid unclassed
pointer in cast to 'NMConnection'") rather than displaying the failed
assertion that had gotten us to that point.

Fix this by not unreffing settings from cleanup(); in the normal exit
case we can just have main() unref it, and in the assertion-failed
case, we don't need to free things anyway.
2014-07-20 08:58:56 -04:00
Thomas Schäfer
bcd554724e dhcp: let dhclient handle requesting the 'server-id' option
Always requesting this appears to cause some devices to ignore
DHCP requests, like the ZTE 823D, ZTEMF93E, Alcatel W800Z.
dhclient probably knows better than NM when to request the
server's ID, so leave that up to dhclient.  We don't do anything
interesting with it anyway.
2014-07-17 15:53:04 -05:00
David Lechner
7f2afbbcdc vapi: add bindings for new_async methods (bgo #732253)
https://bugzilla.gnome.org/show_bug.cgi?id=732253
2014-07-16 17:11:02 -05:00
Dan Winship
dd2e751b07 tui: fix Wi-Fi section of "nmtui connect" list in non-UTF-8 locales
In locales where the Wi-Fi signal-strength characters couldn't be
represented (eg, LANG=C), the entire Wi-Fi SSID + signal strength
string would fail to convert, causing the Wi-Fi section of the
connection list to show up as a series of blank lines.

Fix this by testing beforehand whether the characters can convert, and
falling back to plain ASCII if not. (And also, fix the similar code in
nmt-newt-section.c, which got broken when nmt_newt_locale_from_utf8()
was changed to never return NULL.)

Also, for paranoia, represent the signal-strength strings via \nnn
escapes rather than actual UTF-8 data, to guarantee that they get
compiled to the expected values even if the source files get
re-encoded.

https://bugzilla.gnome.org/show_bug.cgi?id=733007
2014-07-16 12:05:44 -04:00
Thomas Haller
fad552694e merge branch 'th/libgsystem'
Remove libgsystem submodule and include the gsystem-local-alloc.h
header file directly.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 22:54:31 +02:00
Thomas Haller
6cf9724f7d platform: use gs_free (instead of own define auto_g_free)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 22:50:36 +02:00
Thomas Haller
37f08bc848 core: use gs_free_slist in NMManager
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 22:50:36 +02:00
Thomas Haller
51bd942575 build: remove setup of git-submodules in autogen.sh
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 22:50:36 +02:00
Thomas Haller
39fce7371a libgsystem: remove submodule libgsystem
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 22:50:36 +02:00
Thomas Haller
2856fcb3de libgsystem: add local copy of gsystem-local-alloc.h
Taken from libgsystem:src/gsystem-local-alloc.c
(commit de2619271ee3ab42971fc770cae110f23e330c30).

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 22:50:32 +02:00
Thomas Haller
7a5af89f0b core: #include gsystem-local-alloc.h instead of libgsystem.h
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 22:47:43 +02:00
Thomas Haller
2fdaa29f08 libnm-util: fix leak in _nm_connection_verify()
Regression introduced by commit 2570c5a17c.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-15 21:57:34 +02:00
Terry Chuang
49463a9e7b po: update Traditional Chinese translation (rh #1046891) 2014-07-15 12:18:12 -05:00
Leah Liu
d9713d30b5 po: update Simplified Chinese translation (rh #1046891) 2014-07-15 12:18:12 -05:00
ypoyarko
e6e1a6a4b9 po: update Russian translation (rh #1046891) 2014-07-15 12:18:12 -05:00
asaini
ff9a4d2800 po: update Punjabi translation (rh #1046891) 2014-07-15 12:18:12 -05:00
Ani Peter
3bcacec009 po: update Malayalam translation (rh #1046891) 2014-07-15 12:18:12 -05:00
eukim
a6caffd60a po: update Korean translation (rh #1046891) 2014-07-15 12:18:12 -05:00
Noriko Mizumoto
5dd8465225 po: update Japanese translation (rh #1046891) 2014-07-15 12:18:12 -05:00
Sam Friedmann
90ce0a5ff1 po: update French translation (rh #1046891) 2014-07-15 12:18:11 -05:00
gguerrer
93192f3926 po: update Spanish translation (rh #1046891) 2014-07-15 12:18:11 -05:00
sray
a391e4f61a po: update Bengali bn_IN translation (rh #1046891) 2014-07-15 12:18:11 -05:00
Dan Winship
30c74c6007 build: more srcdir!=builddir fixes
nm-version.h was getting disted, making srcdir!=builddir work for
tarball builds, but not for git builds.

Also, remove "-I${top_builddir}/include" from all Makefile.ams, since
there's nothing generated in include/ any more.
2014-07-15 11:37:19 -04:00
Dan Winship
c9e2c34029 build: fix srcdir!=builddir build after previous merge 2014-07-15 10:52:50 -04:00