Commit Graph

15047 Commits

Author SHA1 Message Date
Jiří Klimeš
296d7f6ec7 cli: fix a crash when trying to set a white-space string as IP (rh #1071394)
nmcli con modify my-profile ipv4.addr "   "
nmcli con modify my-profile ipv6.addr "   "

Note:
Empty string should be used to remove IPs, and 'method' might be needed to set
to 'auto' simultaneously, as well.
$ nmcli con modify profile1 ipv4.addr "" ipv4.method auto

https://bugzilla.redhat.com/show_bug.cgi?id=1071394
2014-03-03 12:50:02 +01:00
Jiří Klimeš
d98a34dcda libnm-util: more specific error for missing ipv[46].adddress when method=manual 2014-03-03 12:42:05 +01:00
Thomas Haller
90ff0786cc cli/bash-completion: fix nmcli connection CMD completion for --help option
The --help option (or its aliases -help/help) is only allowed at as
first argument. Fix completion to account for this.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-02 17:55:14 +01:00
Thomas Haller
74b3c22e2f cli/bash-completion: only allow --help as first argument for nmcli connection modify
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-01 02:07:53 +01:00
Thomas Haller
9d7a1d4253 cli/bash-completion: use printf instead of echo (because echo inteprets some --options)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-01 02:07:53 +01:00
Thomas Haller
39dc39ec0a cli/bash-completion: simplify code by passing arrays by indirection to functions
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-01 02:07:53 +01:00
Dan Winship
74809e64cc libnm-glib: fix glib-mkenums warnings
glib-mkenums doesn't parse /*< public >*/ and /*< private >*/, and in
fact, it warns about them, so don't write it that way.
2014-02-28 16:13:22 -05:00
Dan Winship
e4a8cfd502 libnm-util: fix some parameter names to kill gtk-doc warnings 2014-02-28 16:12:49 -05:00
Jiří Klimeš
e3176dfa0d man: add a note about hostname to nmcli manual page 2014-02-28 14:44:22 +01:00
Thomas Haller
16bbc90c16 release: bump version to 0.9.9.1 (development)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:21:35 +01:00
Thomas Haller
bdc60d433d cli/man: indicate that nmcli connection delete accepts more then one connections
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:17:32 +01:00
Thomas Haller
62cf1d85ff cli/bash-completion: complete more then one connections for nmcli connection delete
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:14:32 +01:00
Thomas Haller
4196cc1179 cli/bash-completion: complete more then one properties for nmcli connection modify
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:14:32 +01:00
Thomas Haller
280881f552 cli/bash-completion: complet nmcli connection modify --temporary
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:14:32 +01:00
Thomas Haller
07cdf56a67 cli/bash-completion: support abbreviated options for commands
Add support for abbreviated options as first argument:

nmcli connection show --act <TAB>

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:14:32 +01:00
Thomas Haller
7423bc4460 cli/bash-completion: support abbreviations for options
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:14:32 +01:00
Jiří Klimeš
223962f4ad man: add a simple bridge example to nmcli-examples manual page 2014-02-28 13:37:02 +01:00
Jiří Klimeš
1472d76744 Merge changes for 'nmcli con modify' (rh #1044027)
It allows set vs. append property value by 'nmcli con modify' and also
inside interactive editor.

And also allow doing temporary changes with 'nmcli con modify'.

https://bugzilla.gnome.org/show_bug.cgi?id=724036
https://bugzilla.redhat.com/show_bug.cgi?id=1044027
2014-02-28 12:11:24 +01:00
Jiří Klimeš
ebb601302a cli: update 'nmcli con modify' help 2014-02-28 11:44:34 +01:00
Jiří Klimeš
2ef197983f man: update nmcli manual page to stress that we can remove values by name 2014-02-28 11:19:13 +01:00
Jiří Klimeš
a5673d113c cli: update 'remove' command description for 'nmcli con edit'
to reflect that user can specify a value or index to remove values.
2014-02-28 11:17:49 +01:00
Jiří Klimeš
f29ad0bd52 cli: allow removing properties by-value (in addition to by-index)
It works both in 'nmcli con modify' and 'nmcli con edit'.

The following properties are supported (all container-type properties except
properties with option names):
ipv4.dns
ipv4.dns-searches
ipv4.addresses
ipv4.routes

ipv6.dns
ipv6.dns-searches
ipv6.addresses
ipv6.routes

802-1x.eap
802-1x.altsubject-matches
802-1x.phase2-altsubject-matches

connection.permissions
connection.secondary

802-3-ethernet.mac-address-blacklist

802-11-wireless.mac-address-blacklist

802-11-wireless-security.proto
802-11-wireless-security.pairwise
802-11-wireless-security.group

vlan.ingress-priority-map
vlan.egress-priority-map
2014-02-28 11:17:17 +01:00
Jiří Klimeš
642cfdeebf libnm-util: add *_remove_*_by_value() functions for 'vlan' setting
nm_setting_vlan_remove_priority_by_value()
nm_setting_vlan_remove_priority_str_by_value()
2014-02-28 10:39:09 +01:00
Jiří Klimeš
1e5370b4d2 libnm-util: add *_remove_*_by_value() functions for '802-11-wireless-security' setting
nm_setting_wireless_security_remove_proto_by_value()
nm_setting_wireless_security_remove_pairwise_by_value()
nm_setting_wireless_security_remove_group_by_value()
2014-02-28 10:39:09 +01:00
Jiří Klimeš
de646d9588 libnm-util: add *_remove_*_by_value() functions for '802-11-wireless' setting
nm_setting_wired_remove_mac_blacklist_item_by_value()

Also add missing function nm_setting_wired_clear_mac_blacklist_items() and notify
about mac-address-blacklist changes.
2014-02-28 10:39:09 +01:00
Jiří Klimeš
ca0aa8139c libnm-util: add *_remove_*_by_value() functions for '802-3-ethernet' setting
nm_setting_wired_remove_mac_blacklist_item_by_value()
and missing
nm_setting_wired_clear_mac_blacklist_items()
2014-02-28 10:39:09 +01:00
Jiří Klimeš
b59bd75956 libnm-util: add *_remove_*_by_value() functions for 'connection' setting
nm_setting_connection_remove_permission_by_value()
nm_setting_connection_remove_secondary_by_value()
2014-02-28 10:39:09 +01:00
Jiří Klimeš
7c817d4176 libnm-util: add *_remove_*_by_value() functions for '802-1x' setting
nm_setting_802_1x_remove_eap_method_by_value()
nm_setting_802_1x_remove_altsubject_match_by_value()
nm_setting_802_1x_remove_phase2_altsubject_match_by_value()
2014-02-28 10:38:53 +01:00
Jiří Klimeš
1303ac3e9c libnm-util: add *_remove_*_by_value() functions for 'ipv4' and 'ipv6' settings
nm_setting_ip4_config_remove_dns_by_value()
nm_setting_ip4_config_remove_dns_search_by_value()
nm_setting_ip4_config_remove_address_by_value()
nm_setting_ip4_config_remove_route_by_value()

nm_setting_ip6_config_remove_dns_by_value()
nm_setting_ip6_config_remove_dns_search_by_value()
nm_setting_ip6_config_remove_address_by_value()
nm_setting_ip6_config_remove_route_by_value()
2014-02-28 10:31:41 +01:00
Jiří Klimeš
c1ace1b5b2 cli: support removing items from container-type properties in 'nmcli con modify'
Synopsis:
nmcli con modify -<property>.<setting> <value>

'value' can be empty ("") to remove the whole property value value (in this
case the behaviour is the same as without '-').
Or the 'value' is an index of the item to remove, or an option name (for a few
properties that have option names, like bond.options or ethernet.s390-options).

$ nmcli con mod myeth ipv4.dns "10.0.0.55 10.0.0.66 8.8.8.8 8.8.4.4"
---> ipv4.dns: 10.0.0.55, 10.0.0.66, 8.8.8.8, 8.8.4.4
$ nmcli con mod myeth -ipv4.dns 1
---> ipv4.dns: 10.0.0.55, 8.8.8.8, 8.8.4.4

---> bond.options: mode=balance-rr
$ nmcli con mod bond0 +bond.options "mii=500, downdelay=800"
---> bond.options: downdelay=800,miimon=500,mode=balance-rr
$ nmcli con mod bond0 -bond.options downdelay
---> bond.options: miimon=500,mode=balance-rr
2014-02-28 10:31:41 +01:00
Jiří Klimeš
363ec8de68 man: update nmcli manual page - 'nmcli con modify' description 2014-02-28 10:31:41 +01:00
Jiří Klimeš
a1c3021aa9 cli: allow modifying multiple properties by 'nmcli con modify'
This is necessary especially for cases where properties depend on each other.
So you need to set them in one command, else the profile won't validate.

Examples:
nmcli con mod em1-1 ipv4.method manual ipv4.addr "192.168.1.2/24,10.10.1.5/8"
nmcli con mod profile ipv4.method link-local ipv4.addr ""
2014-02-28 10:31:41 +01:00
Jiří Klimeš
431b75824b cli: set vs. append property value by 'nmcli con modify' (rh #1044027)
Previously 'nmcli con modify' appended values for multi-value properties.
This commit makes 'nmcli con modify' overwrite the whole value. You can
choose appending values by prefixing the setting.property with '+' sign.
For simple (not container) properties the behaviour is the same both with
and without the '+', of course.

Synopsis:
  nmcli connection modify [+]<setting>.<property <value>

Example:
---> ipv4.dns = 1.2.3.4
$ nmcli connection modify my-em1 ipv4.dns 8.8.8.8
---> ipv4.dns = 8.8.8.8
$ nmcli connection modify my-em1 +ipv4.dns 8.8.4.4
---> ipv4.dns = 8.8.8.8 8.8.4.4

https://bugzilla.redhat.com/show_bug.cgi?id=1044027
2014-02-28 10:31:40 +01:00
Jiří Klimeš
a8e6094e40 cli: allow temporary connection modification by 'nmcli con modify'
nmcli connection modify [--temporary] ...
2014-02-28 10:31:40 +01:00
Jiří Klimeš
cb680c5b54 ifcfg-rh: add missing functionality for reading/writing subject matches
subject-match              - IEEE_8021X_SUBJECT_MATCH
altsubject-matches         - IEEE_8021X_ALTSUBJECT_MATCHES
phase2-subject-match       - IEEE_8021X_PHASE2_SUBJECT_MATCH
phase2-altsubject-matches  - IEEE_8021X_PHASE2_ALTSUBJECT_MATCHES

And a testcase of course.
2014-02-28 10:17:40 +01:00
Dan Winship
10a4df690c devices: propagate the hop limit from an IPv6 RA to the kernel config
If we set accept_ra_defrtr=0 then the kernel will ignore the "hop
limit" too. So parse it out of the RA and set it manually.
2014-02-27 15:28:11 -05:00
Dan Winship
10b699c51f rdisc: expose the "hop limit" from the RA 2014-02-27 15:28:11 -05:00
Dan Winship
c04db133fc devices: be more precise about kernel IPv6 RA handling
We don't want the kernel to do IPv6 addrconf, but we do want it to
notice the non-router-related fields in the RA (eg, Retrans Timer) and
update the interface state to reflect them. So instead of turning off
accept_ra, we leave it turned on, and turn off accept_ra_defrtr,
accept_ra_rtr_pref, and accept_ra_pinfo instead.
2014-02-27 15:28:11 -05:00
Dan Winship
6136630163 devices: abstract the handling of IPv6 sysfs properties
We're about to start using a bunch more IPv6 sysfs properties, so
let's start by making the code more extensible.
2014-02-27 15:28:11 -05:00
Dan Winship
5fe94852ef platform: change sysctl_get/set error logging
Remove the "silent_on_error" flag from nm_platform_sysctl_get(), and
make both get() and set() log at debug level on ENOENT and error level
on all other errors, always.

Also ensure that we don't sometimes write "failed to set 'x' to 'y':
Success" when a partial write occurs.
2014-02-27 15:28:11 -05:00
Thomas Haller
0332850627 core: default route should stay on the current active device
get_best_ip4_device() and get_best_ip6_device() iterate over
the list of devices to find the device with the default route.
The order of iteration is arbitrarly choosen.

Before, if two devices had the same priority, it would choose
the first one. Change it so that the device which currently has
the default route keeps it -- until it gets deactivated or a higher
priorty device gets connected.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-27 20:00:20 +01:00
Dan Williams
39ab68481c core: fix ActiveConnection handling of device disconnected state after e19f48ec (rh #1058843)
e19f48ec was incomplete; it failed to handle device disconnections.
NMDevice will clear its internal activation request *before*
emitting the state change, which meant that when the
NMActRequest processes the DISCONNECTED state change, the:

if (NM_ACTIVE_CONNECTION (nm_device_get_act_request (device)) != active)
    return;

statement triggered and the DISCONNECTED state change was not
processed.

Instead of having NMDevice keep the activation request alive over
the entire DISCONNECTED state transition, which may have much
greater implications, handle the special-case locally in the
NMActRequest code itself.
2014-02-27 12:57:59 -06:00
Dan Winship
16cd4f6892 trivial: fix variable name in declaration 2014-02-27 13:39:20 -05:00
Thomas Haller
7d73ee75df trivial: more wrong compiler warnings
connection_parser.c: In function 'make_ip4_setting':
  connection_parser.c:660:33: error: 'method' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    if (!is_static_block && strstr (method, "dhcp")) {

  connections.c: In function ‘load_cmd_line_edit_lib’:
  connections.c:5744:17: error: ‘module’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
    g_module_close (module);

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-27 18:31:07 +01:00
Thomas Haller
0550a14fbe trivial: omit wrong compiler warning in ifcfg-rh reader about uninitialized use
reader.c: In function 'parse_infiniband_p_key':
  reader.c:3947:5: error: 'id' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    id = (id | 0x8000);
       ^

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-27 18:26:28 +01:00
Manoj Kumar Giri
fbaaedf926 po: updated Oriya (Odia) (or) translation (bgo #725304)
https://bugzilla.gnome.org/show_bug.cgi?id=725304

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-27 13:39:19 +01:00
Glaucia Freitas
8900bb688b po: updated Brazilian Portuguese (pt_BR) translation (bgo #725302)
https://bugzilla.gnome.org/show_bug.cgi?id=725302

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-27 13:36:57 +01:00
Thomas Haller
f0a8b3a76d core: fix alignment of logging timestamp
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-26 19:06:00 +01:00
Dan Williams
834c6f32b3 build: clean 0.9.8 generated files
Makes it easier to switch between 0.9.8 and git master.
2014-02-26 09:58:15 -06:00
Glaucia Freitas
4edae526c1 po: updated Brazilian Portuguese (pt_BR) translation (bgo #725182)
https://bugzilla.gnome.org/show_bug.cgi?id=725182

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-26 15:52:34 +01:00