Commit Graph

15047 Commits

Author SHA1 Message Date
Dan Winship
fd85ec45b9 platform: fix VLAN ingress/egress map setting 2013-09-12 18:34:23 -04:00
Dan Williams
e4b92acdf7 cli: clarify 'startup' property when NM is not running
Wouldn't make a ton of sense to print "started" for the STARTING
property if NM wasn't running.
2013-09-12 13:15:50 -05:00
Dan Williams
15ddc6dce3 cli: fix build error due to possibly uninitialized variable 2013-09-12 13:13:09 -05:00
Jiří Klimeš
1df9948199 cli: add STARTUP field for 'nmcli -f all general status'
It says 'starting' when NM is in the process of startup (still activating
connections); 'started' when NM finished the startup.
2013-09-12 16:29:26 +02:00
Thomas Haller
8548d68381 nmcli: extend bash completion for 'nmcli networking connectivity'
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-12 16:19:42 +02:00
Jiří Klimeš
641526781a man: update nmcli manual page for 'nmcli networking connectivity' 2013-09-12 15:48:03 +02:00
Jiří Klimeš
fa36216787 cli: consolidate a code for connectivity check a bit 2013-09-12 14:45:08 +02:00
Jiří Klimeš
449a0933ce cli: don't call g_strstrip() on NULL arguments
GLib-CRITICAL **: g_strchug: assertion `string != NULL' failed
GLib-CRITICAL **: g_strchomp: assertion `string != NULL' failed
2013-09-12 10:03:23 +02:00
Dan Winship
26544f3148 libnm-glib: change "Since: 0.9.10" to "Since: 0.9.8.6" for backported API 2013-09-11 14:10:55 -04:00
Jiří Klimeš
6014e3fa04 cli: fix an 'nmcli con edit' crash
nmcli> desc   AAA
2013-09-11 18:12:51 +02:00
Jiří Klimeš
625f2e3814 man: fix a typo in nmcli-examples manual page (rh #1004117)
https://bugzilla.redhat.com/show_bug.cgi?id=1004117
2013-09-10 16:46:08 +02:00
Jiří Klimeš
b62856a0bb cli: set wep-key-type properly in nmcli con edit (rh #1003945)
Accept both [0,1,2] and [unknown,key,passphrase] as wep-key-type values and
set the property value correctly.

https://bugzilla.redhat.com/show_bug.cgi?id=1003945
2013-09-10 16:23:25 +02:00
Jiří Klimeš
555e5b401c cli: reset terminal using libreadline when quitting on signal (bgo #706118)
readline() makes changes to terminal and when it doesn't receive unix signals,
it has no chance to perform cleanups on exit. So we have to call its cleanup
functions manually on exit.

https://bugzilla.gnome.org/show_bug.cgi?id=706118
2013-09-10 11:45:21 +02:00
Jiří Klimeš
663014ed62 cli: handle POSIX signals in a dedicated thread
For a multihreaded application the safest way to handle unix signals is using
a dedicated thread that processes the signals by sigwait() function. All other
threads have these signals (processed by the thread) blocked.

A few useful links:
http://pubs.opengroup.org/onlinepubs/007904975/functions/sigwait.html
http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.genprogc%2Fdoc%2Fgenprogc%2Fsignal_mgmt.htm
http://www.linuxjournal.com/article/2121?page=0,2
http://www.redwoodsoft.com/~dru/unixbook/book.chinaunix.net/special/ebook/addisonWesley/APUE2/0201433079/ch12lev1sec8.html
https://www.securecoding.cert.org/confluence/display/seccode/CON37-C.+Do+not+call+signal%28%29+in+a+multithreaded+program
2013-09-10 11:41:00 +02:00
Dan Winship
ffa012f3ce libnm-glib: fix nm_remote_connection_delete() callback
If you called nm_remote_connection_delete() on a connection whose only
ref was held by the NMRemoteSettings, then the callback would never
get called, because NMRemoteSettings would drop its ref before then
(when the connection emitted the 'removed' signal), so the callback
would get cancelled.

Fix this by taking an extra ref on the connection around the D-Bus
call in this case.

https://bugzilla.redhat.com/show_bug.cgi?id=997568
https://bugzilla.gnome.org/show_bug.cgi?id=706141
2013-09-09 09:28:24 -04:00
Daniel Drake
3f4811be22 libnm-util: accept old-style UUIDs as valid
Old versions such as 0.9.4 generated 40-character UUIDs with no
hashes, but libnm-util regards them as invalid. That means that
existing connections stop working when upgrading from 0.9.4.

Continue accepting such UUIDs as valid, and add a test so that
we don't forget in future.
2013-09-09 08:20:37 -05:00
Aurimas Černius
ff2bd46396 po: updated Lithuanian (lt) translation (bgo #706337)
https://bugzilla.gnome.org/show_bug.cgi?id=706337
2013-09-09 09:43:30 +02:00
Sandeep Shedmake
cb6fbce7f4 po: updated Marathi (mr) translation (bgo #705782)
https://bugzilla.gnome.org/show_bug.cgi?id=705782
2013-09-09 09:36:13 +02:00
Jiří Klimeš
49eda63e75 dhcp: add a testcase for distinguishing client identifier type
MAC-like string, but with an invalid char => plain ASCII string => quoted.
2013-09-09 09:14:38 +02:00
Christian Kirbach
a690f2f5c1 po: updated German (de) translation (bgo #707675)
https://bugzilla.gnome.org/show_bug.cgi?id=707675

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-08 19:27:08 +02:00
Dan Winship
a059309628 platform: recognize Open vSwitch interfaces as Generic devices (rh #1004356)
They look exactly like normal Ethernet interfaces, but they are managed
entirely by the Open vSwitch tools in software, so NM shouldn't (yet)
touch them.  Treat them instead as generic devices that only get touched
through direct user requests.
2013-09-06 19:39:11 -05:00
Dan Williams
b415b8a468 dhcp: add testcase for quoting problematic client identifiers 2013-09-06 11:20:08 -05:00
Jiří Klimeš
1ef19f377b dhcp: string vs. byte-array of dhcp-client-identifier (rh #999503)
Distinguish properly between ASCII strings and byte arrays for
dhcp-client-identifier. Else dhclient refuses to parse the configuration
file.
2013-09-06 11:20:00 -05:00
Thomas Haller
7ad5c79441 nmcli: minor fixes in bash completion
- the ifname argument for "connection add" is not mandatory
- support the long names for connection types ("802-*")

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-06 17:47:57 +02:00
Jiří Klimeš
4255d72b21 build: fix distcheck - missing ifupdown test files in Makefile.am 2013-09-06 17:42:07 +02:00
Jiří Klimeš
9f09ebd582 cli: forbid removing connection.uuid in editor
We expect that UUID is set, else there are various errors. Anyway, users should
not modify connection UUID.
2013-09-06 15:14:30 +02:00
Jiří Klimeš
2eede80108 cli: deny removing values of nmcli-unchangable properties
nmc_setting_reset_property() function checks whether we allow changing the property
(set_func != NULL) and if so, the property value is reset to default.
2013-09-06 15:00:34 +02:00
Jiří Klimeš
70cc30cb73 cli: add missing connection:type to nmc_add_prop_funcs() in editor 2013-09-06 14:12:26 +02:00
Jiří Klimeš
9835da7c74 libnm-util: update description of team:config and team-port:config properties 2013-09-06 13:52:27 +02:00
Jiří Klimeš
242bebfb3d cli: add 'remove' command to the interactive editor
remove <setting>[.property] | <property>

It entirely removes given setting from edited connection. If a property is given,
the command instead resets the property to its default value.

https://bugzilla.gnome.org/show_bug.cgi?id=707576
2013-09-06 10:10:37 +02:00
Jiří Klimeš
c2faf32b88 cli: 'connection add' - questionnaire mode (rh #953291)
Synopsis: nmcli --ask connection add

When '--ask' is used, nmcli will ask not only for mandatory arguments but also
for the optional ones, with a series of questions.
2013-09-06 09:16:46 +02:00
Thomas Haller
2766829a67 libnm-glib: don't warn when dbus object initialization fails with UNKNOWN_METHOD
A common case where this warning was triggered, was the removal of
IP6Config objects. As this can happen as a regular event, do not warn in
this case.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-05 22:08:43 +02:00
Dan Williams
fa0112c0ca core: handle externally added IPv6 adresses and routes on IP change
Cache externally added IP details and represent them via the D-Bus
interface, and also merge them into the final device config to ensure
they aren't lost if DHCP renews or RA changes occur.
2013-09-05 14:24:06 -05:00
Dan Williams
d8c9828a4d core: add nm_ip6_config_subtract()
Removes anything in 'src' from 'dst'.
2013-09-05 14:24:06 -05:00
Scott Shambarger
04f6e09d50 ifcfg-rh: fix handling of legacy IPv4 route files without gateway.
Routes without gateway are legal and should be treated as a device route
(direct route).

https://bugzilla.gnome.org/show_bug.cgi?id=697525

The original patch was written by Scott Shambarger <scott-gnome@shambarger.net>.
This is a modified version of the patch.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Reported-by: Scott Shambarger <scott-gnome@shambarger.net>
2013-09-05 21:13:15 +02:00
Thomas Haller
f6703f540c nmcli: reword error message for a wrong user input in edit mode
Before, when specifying a setting.property with missing property name,
the following happened:

  nmcli> set connection.
  Error: invalid property: '' not among [...

Reword this special error case of a missing property to make it more
clear.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-05 20:02:12 +02:00
Thomas Haller
1111dbf812 nmcli: fix segfault in edit mode when parsing user prompt
readline_x returns NULL for empty input, so it is wrong
to call g_strstrip without checking for NULL first.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-05 13:59:54 +02:00
Thomas Haller
4e09b87d54 ifupdown: misc code cleanup for "add support for source stanza"
- make use of glib functions
- coding style

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-05 10:58:46 +02:00
Michael Wisheu
48ed1abca7 ifupdown: add support for source stanza
Since Debian 7 (Wheezy) / Ubuntu 11.04 (Natty Narwhal) ifupdown supports
the source stanza to source in other configuration files from
/etc/network/interfaces.

Add support to the ifupdown plugin to include configuration files via
source.

Patch did not apply cleanly and was slightly modified by Thomas Haller.

https://bugzilla.gnome.org/show_bug.cgi?id=707276

Signed-off-by: Thomas Haller <thaller@redhat.com>
Reviewed-by: Sebastian Harl <tokkee@debian.org>
2013-09-05 10:56:28 +02:00
Thomas Haller
fc7468131c nmcli: major rework of bash completion
Bash completion does now parse the command line from left to right and
only suggests options that make sense at the current cursor position.

If the cursor is not at the end of the line, the words right from the
cursor are ignored for completion. The reason is, that it would be much
more difficult to figure out the valid options when also looking at
options right from the cursor. However, it should still work nicely
even in this case.

There is still an unsolved issue when completing words with space or
other special characters. However, this issue was present before.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-05 10:47:41 +02:00
Jiří Klimeš
650cbc6660 trivial: fix build by returning FALSE in gboolean nm_device_set_is_nm_owned()
g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
2013-09-05 09:14:57 +02:00
Thomas Haller
958ec36b96 core: delete virtual devices created by NM when they are deactivated.
Virtual/software devices that were created by NM should be deleted when
the device gets deactivated.

https://bugzilla.gnome.org/show_bug.cgi?id=695705
https://bugzilla.redhat.com/show_bug.cgi?id=953300

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-04 18:21:49 +02:00
Thomas Haller
c6458cab36 core: add flag is_nm_owned to NMDevice
Add a flag to indicate that the device is owned by NM.
This is interesting for software/virtual devices, that were created by
NM and should be deleted when the interface gets deactivated.

This flag is not implemented as a glib property.

Maybe this flag can be consolidated with the managed flag. For now it is
unclear how to do it, so add this flag. It should be easy later to
replace it again.

https://bugzilla.gnome.org/show_bug.cgi?id=695705
https://bugzilla.redhat.com/show_bug.cgi?id=953300

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-04 18:21:49 +02:00
Jiří Klimeš
8e050a3a77 trivial: fix a typo in description of ipv6.method in libnm-util 2013-09-04 12:56:17 +02:00
Jiří Klimeš
50bec85f98 cli: allow editing team and team-port settings in interactive editor 2013-09-04 12:43:11 +02:00
Jiri Pirko
96303bd9da cli: add missed setting name to nmc_team_slave_settings
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
2013-09-04 12:43:11 +02:00
Jiri Pirko
d338b90cfd cli: add config option for team devices
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
2013-09-04 12:43:11 +02:00
Jiri Pirko
97be00f9e0 cli: add team port setting
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
2013-09-04 12:43:11 +02:00
Jiri Pirko
eb05cbeb9c cli: add team and team-slave detail printing
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
2013-09-04 12:43:11 +02:00
Thomas Haller
00e1e20b16 nmcli: special error message for access denied when SetLogging fails
Setting the logging level fails for normal users due to missing dbus
permissions as configured in src/org.freedesktop.NetworkManager.conf.

In that case, nmcli simply fails showing the dbus error. This error
is however not very clear, so this commit shows a different error
text for the particular case of ACCESS_DENIED.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-04 11:56:46 +02:00