Commit Graph

8762 Commits

Author SHA1 Message Date
Jiří Klimeš
2109f41cc6 libnm-util: consolidate hex-string <-> bin conversion functions
and move them to libnm-util's nm-utils.s so that they are easily available.
2013-03-28 16:59:58 +01:00
Pavel Šimerda
bd3c80029d trivial: add coverage data to .gitignore 2013-03-27 14:49:39 +01:00
Dan Williams
5d6d5cd136 dhclient: copy leasefiles from old location if needed (rh #916233) (bgo #696210)
When the default leasefile location got moved from distro-specific
dhclient locations to a single NM-specific location, that apparently
broke scripts and external tools that depended on the old location,
like dract netbooting.

During a netboot, DHCP is started from the initramfs and gets a
lease, and the leasefile lives in the initramfs.  When the real
system is started, and the rootfs switches from the initramfs to
the actual rootfs, something needs to copy the leasefiles over to
where NetworkManager can find them.  For dracut at least, various
dracut scripts were doing this, and copying to the old location
in /var/lib/dhclient or /var/lib/dhcp.  Which means NM can no
longer find them, and proceeds to acquire a new DHCP lease when
taking over the existing connection, rather than renewing the
existing lease.  This can lead to loss of network connectivity
and thus the netboot process fails.

If no leasefile for the connection in the new location exists,
look in the old locations and copy that leasefile over to the new
location.
2013-03-26 15:26:18 -05:00
Dan Winship
9e71bb3cd5 cli: add property get functions - returning property value for presentation
Simplify code by using property get functions, with most of them
autogenerated based on GObject properties and GValue transforms.

Based on a patch from Jiří Klimeš
2013-03-26 12:15:49 -04:00
Jiří Klimeš
113d358ce5 cli: make 'value' in NmcOutputField non const 2013-03-26 12:15:49 -04:00
Dan Winship
6ff924f82f libnm-utils: change the GValue transforms to match nmcli's outputs
That way, nmcli can use them...
2013-03-26 12:15:49 -04:00
Dan Winship
331b69bd90 libnm-util: split GValue transforms out of nm-utils.c
nm-utils.c is really big, so split the GValue transforms out into
their own file.
2013-03-26 12:15:49 -04:00
Jiří Klimeš
dc58072f7b libnm-util: install :pin and :pin-flags as properties for NMSetting8021x
GLib-GObject-WARNING **: g_object_get_property: object class `NMSetting8021x' has no property named `pin'
GLib-GObject-WARNING **: g_object_get_property: object class `NMSetting8021x' has no property named `pin-flags'
2013-03-26 16:49:37 +01:00
Dan Williams
e8cbde2704 mobile: clarifiy modem state change log message
Otherwise it looks like it might be the NMDevice state change, which
it isn't.
2013-03-25 15:56:06 -05:00
Dan Williams
6ef543d3a6 mobile: downgrade MM launch failure warning severity to debug
MM won't always be present, and if it's not, your logs will fill up
with warnings about MM not being able to be launched.  And when
running with systemd, you'll get a different class of errors like:

<warn> error poking ModemManager: GDBus.Error:org.freedesktop.systemd1.LoadFailed:
   Unit dbus-org.freedesktop.ModemManager1.service failed to load: No such file or
   directory. See system logs and 'systemctl status
   dbus-org.freedesktop.ModemManager1.service' for details.

and I'm tired of chasing and special-casing all the launch-failed
errors that D-Bus and systemd use.

Plus, we have dynamic log level changing via the D-Bus interface so if
people need to debug this, just chaning the log level will tell you
what's wrong.
2013-03-25 15:38:00 -05:00
Dan Williams
824fd06c34 ppp: ignore errors getting final PPP stats
The PPP interface may be gone already, especially if the connection
was terminated by the PPP peer.  It's pointless to warn in these
cases since getitng the final stats is best-effort anyway.
2013-03-25 15:26:51 -05:00
Dan Williams
f515df39b5 core: don't crash checking unmanaged specs if device has no hardware address
Not all devices have a hardware address, like WWAN or ADSL.  So don't
unconditionally expect one.
2013-03-25 15:17:35 -05:00
Sandeep Shedmake
b31ac326dd po: updated Marathi (mr) translation (bgo #696116) 2013-03-25 09:40:32 +01:00
Sweta Kothari
ff2633380c po: updated Gujarati (gu) translation (bgo #696535) 2013-03-25 09:36:31 +01:00
Rajesh Ranjan
70d7f5c194 po: updated Hindi (hi) translation (bgo #696537) 2013-03-25 09:32:52 +01:00
Shantha kumar
f749349635 po: updated Tamil (ta) translation (bgo #696536) 2013-03-25 09:29:11 +01:00
Manoj Kumar Giri
786e13839b po: updated Oriya (Odia) (or) translation (bgo #696534) 2013-03-25 09:23:08 +01:00
Piotr Drąg
980d87e8f4 po: updated Polish (pl) translation (bgo #696459) 2013-03-25 09:09:55 +01:00
Piotr Drąg
5ca123bdf1 po: fix syntax errors in gl, hr and or translations 2013-03-25 08:56:33 +01:00
Jiří Klimeš
82fb1978a4 all: use G_VALUE_INIT to initialize GValue variables
It makes the initializations more explicit.
G_VALUE_INIT is available since glib 2.30, and NM now require glib >= 2.32
2013-03-25 08:41:18 +01:00
Pavel Šimerda
a78a1847c6 testing: fix configure.ac typo regarding valgrind
--without-valgrind will now work properly.
2013-03-23 03:35:44 +01:00
Pavel Šimerda
2675af05b9 testing: support for valgrind memory checking
Use @VALGRIND_RULES@ in Makefile.am for modules that you want to check
for memory leaks.
2013-03-22 23:08:20 +01:00
Dan Williams
d57198dfa4 libnm-glib: fix use-after-free getting device vendor and product
Because _device_update_description() freed and update *both* the
vendor and product description, if the function was not able to
read one of them the first time, it would throw both away the second
time and try re-read them.  That caused code like this:

vendor = nm_device_get_vendor (device);
product = nm_device_get_product (device);

to be left with a freed 'vendor' value if _device_update_description()
could not read the product when first called from nm_device_get_vendor(),
because it would be called a second time from nm_device_get_product()
and free priv->vendor and priv->product and then attempt to re-read them.

Fix this by making the function return only one value so that the
callers can control the liftime of the property they are trying to set.

==29355== Invalid read of size 8
==29355==    at 0x38F7289840: __GI_mempcpy (memcpy.S:122)
==29355==    by 0x38F7276F21: _IO_file_xsputn@@GLIBC_2.2.5 (fileops.c:1353)
==29355==    by 0x38F7247DA6: vfprintf (vfprintf.c:1615)
==29355==    by 0x38F7250E28: printf (printf.c:34)
==29355==    by 0x41E79F: print_fields (utils.c:351)
==29355==    by 0x414CAB: show_device_info (devices.c:636)
==29355==    by 0x415CE8: do_devices (devices.c:1094)
==29355==    by 0x41D9A9: start (nmcli.c:121)
==29355==    by 0x38F6E47A54: g_main_context_dispatch (gmain.c:2715)
==29355==    by 0x38F6E47D87: g_main_context_iterate.isra.24 (gmain.c:3290)
==29355==    by 0x38F6E48181: g_main_loop_run (gmain.c:3484)
==29355==    by 0x40CB89: main (nmcli.c:359)
==29355==  Address 0x50a0401 is 1 bytes inside a block of size 18 free'd
==29355==    at 0x4A077E6: free (vg_replace_malloc.c:446)
==29355==    by 0x38F6E4D79E: g_free (gmem.c:252)
==29355==    by 0x4C55F53: _device_update_description (nm-device.c:1417)
==29355==    by 0x4C56D26: nm_device_get_product (nm-device.c:1502)
==29355==    by 0x414B16: show_device_info (devices.c:620)
==29355==    by 0x415CE8: do_devices (devices.c:1094)
==29355==    by 0x41D9A9: start (nmcli.c:121)
==29355==    by 0x38F6E47A54: g_main_context_dispatch (gmain.c:2715)
==29355==    by 0x38F6E47D87: g_main_context_iterate.isra.24 (gmain.c:3290)
==29355==    by 0x38F6E48181: g_main_loop_run (gmain.c:3484)
==29355==    by 0x40CB89: main (nmcli.c:359)
2013-03-22 15:07:17 -05:00
Dan Williams
360a02fc13 ifcfg-rh: ensure missing STP property is interpreted as "off" (rh #922702)
The initscripts interpreted it this way, so we do too.
2013-03-22 09:13:12 -05:00
Dan Williams
c934038b59 dhcp: fix up testcase for "also request static-routes;" 2013-03-21 13:20:13 -05:00
Dan Williams
0bf0ee7136 dhcp: look harder for machine-id, and generate random DUID if it doesn't exist (bgo #696109)
Not all systems have machine-id in /etc, some still have it in /var/lib/dbus/
especially if they aren't using systemd.  Furthermore, if we don't have
any machine-id file (like in the future, if we don't have a messaebus
daemon running) fall back to a random DUID as a last resort.
2013-03-20 11:28:53 -05:00
Dan Williams
3e293e1101 dhcp: we don't always have an NMSettingIP6Config for the DHCP hostname
Prevents:

NetworkManager[19405]: nm_setting_ip6_config_get_dhcp_hostname: assertion `NM_IS_SETTING_IP6_CONFIG (setting)' failed
2013-03-20 11:28:22 -05:00
Dan Williams
bd636ffb40 dbus: reinstall property filter on dbus connection changes (rh #918273)
Like if the dbus daemon restarts; in this case the connection has changed
and the new connection doesn't have the filter installed, and libdbus
aborts when we try to remove a filter that doesn't exist on the connection.
Fix that by re-adding the filter when the connection changes.
2013-03-20 08:51:08 -05:00
Dan Fruehauf
edd1ebe8a0 dbus: allow talking to the NetworkManager-SSH VPN plugin 2013-03-20 08:28:14 -05:00
Jiří Klimeš
a96053fe13 dhclient: also request 'static-routes' option from DHCP server (rh #922558)
DHCP server won't send 'Static Route' option to the client if it is not
explicitly requested.
2013-03-20 10:00:42 +01:00
Jiří Klimeš
d7d2015dfd libnm-util: add nm_setting_wired_get_valid_s390_options() 2013-03-19 08:59:50 +01:00
Enrico Nicoletto
3e49694688 po: updated Brazilian Portuguese (pt_BR) translation (bgo #696073) 2013-03-18 18:44:42 +01:00
Jiří Klimeš
cc1de4676e libnm-util: fix documentation of add(remove)_s390_option() 2013-03-18 18:11:29 +01:00
Nilamdyuti Goswami
9a0fec38df po: updated Assamese (as) translation (bgo #696050) 2013-03-18 15:09:30 +01:00
Rafael Ferreira
3ccb9941fb po: updated Brazilian Portuguese (pt_BR) translation (bgo #696026) 2013-03-18 15:05:23 +01:00
Yuri Chornoivan
ab6ad49a3d po: updated Ukrainian (uk) translation (bgo #695942) 2013-03-18 14:58:38 +01:00
Dan Williams
6551e9bbc4 core: don't fail IPv6 if otherconf/info-only DHCPv6 fails
Just like we don't fail IPv4 if DHCP fails to get DNS servers,
don't fail IPv6 if we've already got an RA and for some reason
DHCPv6 fails.  otherconf/info-only DHCP is not mandatory, and
lack of results thus should not fail the entire IPv6 config,
since DNS servers can also be passed in the RA.

RFC4861:

1-bit "Other configuration" flag.  When set, it
indicates that other configuration information is
available via DHCPv6.  Examples of such information
are DNS-related information or information on other
servers within the network.
2013-03-14 13:57:52 -05:00
Colin Walters
ffb6df6f4a libnm-glib,libnm-util: -glib requires -util, -util requires NetworkManager
libnm-glib's public headers include headers from libnm-util. While it
does work to just $(pkg-config --cflags --libs libnm-glib), this is
only because libnm-glib has a requires on NetworkManager which happens
to use the same include directory as libnm-util.

The correct dependency chain is thus:
libnm-glib -> libnm-util -> NetworkManager

Signed-off-by: Colin Walters <walters@verbum.org>
2013-03-14 10:23:19 -05:00
Jiří Klimeš
ccb766fa01 man: document unmanaged-devices=interface-name:foo0 in NetworkManager.conf(5) 2013-03-14 12:47:26 +01:00
Jiří Klimeš
3c98c2798f cli: show connection:interface-name property for connections 2013-03-14 12:18:38 +01:00
Jiří Klimeš
df1a1bf69e keyfile: fix reading unmanaged-devices for interface name
[keyfile]
unmanaged-devices=interface-name:eth0
2013-03-14 12:03:47 +01:00
Jiří Klimeš
f36c7301f0 libnm-util: more verbose verification errors for :interface-name 2013-03-14 11:00:45 +01:00
Jiří Klimeš
2295e5fbe0 libnm-util: add the detailed description of interface-name to blurb as well
So that the description is in the generated documentation and nm-settings(5)
manual page.
2013-03-14 10:36:50 +01:00
Pavel Šimerda
a290c5c3a6 Revert "trivial: remove nm-netlink-monitor.h from main"
This reverts commit 272335a2cf.

Done by mistake. Sorry.
2013-03-13 23:52:14 +01:00
Pavel Šimerda
272335a2cf trivial: remove nm-netlink-monitor.h from main
nm-netlink-monitor is deprecated and the only consumer that still uses
it is nm-ip6-manager, which will start it on its own.

Conflicts:
	src/main.c
2013-03-13 23:08:06 +01:00
Pavel Šimerda
fa86a377a0 main: don't activate nm-netlink-monitor
It will be activated by the first module that needs it.
2013-03-13 22:15:37 +01:00
Pavel Šimerda
363dece23b netlink: don't ref/unref the singleton 2013-03-13 22:15:29 +01:00
Dan Winship
d9e87d933b core: document some NMDevice methods 2013-03-13 16:45:19 -04:00
Dan Winship
dbbec9b7d7 libnm-glib: match interface name in nm_device_connection_compatible()
Do NMSettingConnection:interface-name matching on the client side as
well, so that, eg, nm-applet does not list connections under the wrong
device.

(Also, move some return-if-fail checks from the subclass method
implementations into the wrapper function.)

https://bugzilla.gnome.org/show_bug.cgi?id=693684
2013-03-13 16:45:19 -04:00
Dan Winship
c308e75b92 core: allow marking a device unmanaged by its interface name
Virtual devices often don't have stable hardware addresses. So allow
for marking a device unmanaged via its interface name instead.

https://bugzilla.gnome.org/show_bug.cgi?id=693684
2013-03-13 16:45:19 -04:00