Commit graph

10149 commits

Author SHA1 Message Date
Thomas Haller 7580cfef20 dns: fix compiler warning by refactoring use of inet_ntop
Use nm_utils_inet4_ntop() and nm_utils_inet6_ntop() instead.
And get rid of the unneeded error-checking.

gcc warns:

    make[4]: Entering directory `/data/src/NetworkManager/src'
      CC       nm-dns-manager.lo
    dns-manager/nm-dns-manager.c: In function 'merge_one_ip4_config':
    dns-manager/nm-dns-manager.c:137:37: warning: ordered comparison of pointer with integer zero [-Wextra]
       if (inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN) > 0)
                                         ^
    dns-manager/nm-dns-manager.c:168:37: warning: ordered comparison of pointer with integer zero [-Wextra]
       if (inet_ntop (AF_INET, &addr, buf, INET_ADDRSTRLEN) > 0)
                                         ^
    dns-manager/nm-dns-manager.c: In function 'merge_one_ip6_config':
    dns-manager/nm-dns-manager.c:197:64: warning: ordered comparison of pointer with integer zero [-Wextra]
        if (inet_ntop (AF_INET, &(addr->s6_addr32[3]), buf, INET_ADDRSTRLEN) > 0)
                                                                    ^
    dns-manager/nm-dns-manager.c:200:38: warning: ordered comparison of pointer with integer zero [-Wextra]
        if (inet_ntop (AF_INET6, addr, buf, INET6_ADDRSTRLEN) > 0) {
                                          ^

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:01 +02:00
Thomas Haller ef24273104 cli: fix warning in parse_output_fields() about strict-overflow
gcc warns:

    make[4]: Entering directory `./NetworkManager/cli/src'
      CC       utils.o
    utils.c: In function ‘parse_output_fields’:
    utils.c:707:7: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
        if (found) {
           ^

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:01 +02:00
Thomas Haller b835111129 libnm-util, core: fix warning about signed integer overflow (-Wstrict-overflow)
gcc warns:

    make[4]: Entering directory `./NetworkManager/libnm-util'
      CC       nm-value-transforms.lo
    nm-value-transforms.c: In function '_nm_utils_convert_op_array_to_string':
    nm-value-transforms.c:121:6: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
       if (i > 0)
          ^
    nm-value-transforms.c: In function '_nm_utils_convert_string_array_to_string':
    nm-value-transforms.c:121:6: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
       if (i > 0)
          ^

    make[7]: Entering directory `./NetworkManager/src/settings/plugins/ifcfg-rh'
      CC       reader.lo
    reader.c: In function 'make_wired_setting':
    reader.c:3295:6: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
       if (!found)
          ^
    reader.c: In function 'wireless_connection_from_ifcfg':
    reader.c:3295:6: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
       if (!found)
          ^

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:01 +02:00
Thomas Haller f0d40201ae cli: fix warning about uninitialized value
gcc warns:

    make[4]: Entering directory `./NetworkManager/cli/src'
      CC       connections.o
    connections.c: In function ‘complete_connection_by_type’:
    connections.c:4235:18: error: ‘mtu_int’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
         g_object_set (s_wired, NM_SETTING_WIRED_MTU, mtu_int, NULL);
                      ^

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:01 +02:00
Thomas Haller f808c3603a platform/test: fix warning about uninitialized value
gcc warns:

    make[5]: Entering directory `./NetworkManager/src/platform/tests'
      CC       platform.o
    platform.c: In function ‘do_ip6_route_add’:
    platform.c:696:2: error: ‘plen’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      return nm_platform_ip6_route_add (ifindex, NM_PLATFORM_SOURCE_USER,
      ^
    platform.c: In function ‘do_ip6_route_delete’:
    platform.c:724:2: error: ‘plen’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      return nm_platform_ip6_route_delete (ifindex, network, plen, metric);
      ^
    platform.c: In function ‘do_ip4_route_delete’:
    [...]

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:01 +02:00
Thomas Haller 996b31ec20 cli: remove unused static struct nmc_mobile_settings
clang warns:

    make[4]: Entering directory `./NetworkManager/cli/src'
      CC       connections.o
    connections.c:2206:23: error: unused variable 'nmc_mobile_settings' [-Werror,-Wunused-const-variable]
    static const NameItem nmc_mobile_settings [] = {
                          ^

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:00 +02:00
Thomas Haller 9c9312b805 platform/test: fix warnings in test
clang warns:

    make[5]: Entering directory `./NetworkManager/src/platform/tests'
      CC       test_link_fake-test-link.o
    test-link.c:133:1: error: control may reach end of non-void function [-Werror,-Wreturn-type]
    }
    ^
    test-link.c:191:10: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]
                            char *stdout = NULL;
                                  ^
    /usr/include/stdio.h:173:16: note: expanded from macro 'stdout'
    #define stdout stdout
                   ^
    /usr/include/stdio.h:169:25: note: previous declaration is here
    extern struct _IO_FILE *stdout;         /* Standard output stream.  */
                            ^

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:00 +02:00
Thomas Haller 4ca6274e2b ifcfg-rh: fix warning about duplicate const when declaring string
clang warns:

    make[7]: Entering directory `./NetworkManager/src/settings/plugins/ifcfg-rh'
      CC       writer.lo
    writer.c:2505:20: error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier]
            static const char const as_dash[] = "\\][|/=()!";
                              ^~~~~~
      CC       utils.lo
    utils.c:40:20: error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier]
            static const char const drop_chars[] = "\r\n"; /* drop CR and LF */
                              ^~~~~~

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:00 +02:00
Thomas Haller e543909afc olpc: fix wrong state change reason for device
NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED would map
to NM_DEVICE_STATE_REASON_NOW_MANAGED.

clang warns:

    make[6]: Entering directory `./NetworkManager/src/devices/wifi'
      CC       nm-device-olpc-mesh.lo
    nm-device-olpc-mesh.c:193:28: error: implicit conversion from enumeration type 'enum NMVPNConnectionStateReason' to different enumeration type 'NMDeviceStateReason' [-Werror,-Wenum-conversion]
                                             NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED);
                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    nm-device-olpc-mesh.c:319:27: error: implicit conversion from enumeration type 'enum NMVPNConnectionStateReason' to different enumeration type 'NMDeviceStateReason' [-Werror,-Wenum-conversion]
                                     NM_VPN_CONNECTION_STATE_REASON_USER_DISCONNECTED);
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:00 +02:00
Thomas Haller 43df0e9ae4 core: fix warning calling non-returning g_error()
g_error() does not return, but clang seems not to understand that
and gives the following warning.

    make[4]: Entering directory `./NetworkManager/src'
      CC       NetworkManagerUtils.lo
    NetworkManagerUtils.c:1584:1: error: control may reach end of non-void function [-Werror,-Wreturn-type]
    }
    ^

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:00 +02:00
Thomas Haller 45c5365d85 vpn: fix warning in vpn-manager about implicit conversion of enum types
This bug has no real consequense, because the numerical values of the
enum values are identical.

clang warns:

    make[4]: Entering directory `./NetworkManager/src'
      CC       nm-vpn-connection.lo
    vpn-manager/nm-vpn-connection.c:179:10: error: implicit conversion from enumeration type 'VpnState' to different enumeration type 'NMVPNConnectionState' (aka 'enum NMVPNConnectionState') [-Werror,-Wenum-conversion]
                    return STATE_UNKNOWN;
                    ~~~~~~ ^~~~~~~~~~~~~

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:00 +02:00
Thomas Haller e31474f5d4 platform: fix warning initializing static array freq_policy
Since kernel commit 8fe02e167efa8ed4a4503a5eedc0f49fcb7e3eb9,
the value NL80211_FREQUENCY_ATTR_NO_IR replaces PASSIVE_SCAN
and NO_IBSS. Hence their numerical values are identical and
cause the following compiler warning.

clang warns:

    make[4]: Entering directory `./NetworkManager/src'
      CC       wifi-utils-nl80211.lo
    platform/wifi/wifi-utils-nl80211.c:683:48: error: initializer overrides prior initialization of this subobject [-Werror,-Winitializer-overrides]
                    [NL80211_FREQUENCY_ATTR_NO_IBSS] = { .type = NLA_FLAG },
                                                                 ^~~~~~~~
    platform/wifi/wifi-utils-nl80211.c:682:53: note: previous initialization is here
                    [NL80211_FREQUENCY_ATTR_PASSIVE_SCAN] = { .type = NLA_FLAG },
                                                                      ^~~~~~~~

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:00 +02:00
Thomas Haller 971dfc773f platform: fix warning warning about unused variable
The variable is not actually unused, because it is used
to free the nl_object instance.

clang warns:

    make[4]: Entering directory `./NetworkManager/src'
      CC       nm-linux-platform.lo
    platform/nm-linux-platform.c:1746:35: error: unused variable 'obj_cleanup' [-Werror,-Wunused-variable]
            auto_nl_object struct nl_object *obj_cleanup = obj;
                                             ^

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:00 +02:00
Thomas Haller 657ea51008 core: fix wrong device state change on failure in NMDeviceEthernet
Due to a bug, when dcb fails it would change the device state
to NM_DEVICE_STATE_UNKNOWN (zero), instead of NM_DEVICE_STATE_FAILED.

clang warns:

    make[4]: Entering directory `./NetworkManager/src'
      CC       nm-device-ethernet.lo
    devices/nm-device-ethernet.c:1237:30: error: implicit conversion from enumeration type 'enum NMActStageReturn' to different enumeration type 'NMDeviceState' [-Werror,-Wenum-conversion]
                                                             NM_ACT_STAGE_RETURN_FAILURE,
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    devices/nm-device-ethernet.c:1261:30: error: implicit conversion from enumeration type 'enum NMActStageReturn' to different enumeration type 'NMDeviceState' [-Werror,-Wenum-conversion]
                                                             NM_ACT_STAGE_RETURN_FAILURE,
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:00 +02:00
Thomas Haller a2a36d8450 core: fix warning about comparing unsigned enum values being positive
clang warns:

    make[4]: Entering directory `./NetworkManager/src'
      CC       nm-device.lo
    devices/nm-device.c:367:12: error: comparison of unsigned enum expression >= 0 is always true [-Werror,-Wtautological-compare]
            if (state >= 0 && state < G_N_ELEMENTS (state_table))
                ~~~~~ ^  ~
    devices/nm-device.c:443:13: error: comparison of unsigned enum expression >= 0 is always true [-Werror,-Wtautological-compare]
            if (reason >= 0 && reason < G_N_ELEMENTS (reason_table))
                ~~~~~~ ^  ~

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:17:00 +02:00
Thomas Haller 0238f8f8e2 libnm-glib: fix warning about redefining typedef RemoteCall
clang warns:

    make[4]: Entering directory `./NetworkManager/libnm-glib'
      CC       libnm_glib_la-nm-remote-connection.lo
    nm-remote-connection.c:77:3: error: redefinition of typedef 'RemoteCall' is a C11 feature [-Werror,-Wtypedef-redefinition]
    } RemoteCall;
      ^
    nm-remote-connection.c:67:27: note: previous definition is here
    typedef struct RemoteCall RemoteCall;
                              ^

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:16:59 +02:00
Thomas Haller 22ca469011 libnm-util: fix warning converting between enum types in nm-setting-8021x.c
clang warns:

    make[4]: Entering directory `./NetworkManager/libnm-util'
      CC       nm-setting-8021x.lo
    nm-setting-8021x.c:1824:17: error: implicit conversion from enumeration type 'NMCryptoFileFormat' to different enumeration type 'NMSetting8021xCKFormat' [-Werror,-Wenum-conversion]
                    *out_format = format;
                                ~ ^~~~~~
    nm-setting-8021x.c:2135:17: error: implicit conversion from enumeration type 'NMCryptoFileFormat' to different enumeration type 'NMSetting8021xCKFormat' [-Werror,-Wenum-conversion]
                    *out_format = format;
                                ~ ^~~~~~

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:16:59 +02:00
Thomas Haller b461bf54f2 all: add compatibility macros to ignore deprecation warnings for clang
For clang, the defines G_GNUC_BEGIN_IGNORE_DEPRECATIONS and
G_GNUC_END_IGNORE_DEPRECATIONS are not working. Redefine them
for clang in our glib compatibility wrapper.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:16:59 +02:00
Thomas Haller 5009f2c7a3 build/clang: fix detection of valid warning compiler flags
clang does not exit with error when it is called with an
unrecognized (warning) option. Instead it just prints
a warning that makes the configure script believe the
warning is supported. Later, during build we might pass
-Werror, which causes clang to fail due to unrecognized
arguments.

Fix the script to detect compiler warnings by passing
'-Werror=unknown-warning-option', which lets clang fail too.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:16:33 +02:00
Thomas Haller 1de6d83e29 libnm-glib/test: add asserts to test-remote-settings-client
- register a weak references and ensure that the connection
  is removed when expected.

- disconnect the vis_new_connection_cb() handler

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:07:38 +02:00
Thomas Haller d6b3ef0819 libnm-glib/test: fix crash in test-remote-settings-client
test_make_invisible() forgot to disconnect handler invis_removed_cb().
Later, during test_remove_connection(), the connection will be eventually
removed and the callback will corrupt the stack by writing to the '&done'
user data.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:07:38 +02:00
Dan Williams fa809c2636 build: clean nm-version.h
Now that nm-version.h.in lives in libnm-util/, a stale nm-version.h
from include/ messes up the build with errors about NM_VERSION_*.
Clean both old & new nm-version.h on 'make clean' so that we can
switch branches between nm-0-9-8, nm-0-9-10, and git master and
just run 'make clean' and get things to work.
2014-07-31 21:31:20 -05:00
Thomas Haller a68ade68f3 dhcpcd: pass noarp option to dhcpcd (bgo #733801)
https://bugzilla.gnome.org/show_bug.cgi?id=733801

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-31 21:31:19 -05:00
Giovanni Campagna 07046462f7 libnm-glib: disconnect the connectivity check cancellable signal after the call has ended (bgo #733915)
We cannot rely on connectivity data freeing to disconnect the signal,
because the simple async result might be kept alive by external
code (for example the language runtime for JS), but we must not
call dbus_g_proxy_cancel_call() if that cancellable is cancelled or
reused afterwards.

https://bugzilla.gnome.org/show_bug.cgi?id=733915
2014-07-31 20:51:44 -05:00
Thomas Haller 833ea6944d build: fix linker error for '--disable-concheck' and add '--with-libsoup'
When building with '--disable-concheck' with libsoup installed,
configure would set HAVE_LIBSOUP. But without connection
checking, we didn't link against libsoup, resulting in a
linker error.

Add a new configure option '--with-libsoup' / '--without-libsoup'
to control whether linking against libsoup.
The combination '--without-libsoup --enable-concheck' does not
make sense.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-31 22:19:52 +02:00
Dan Winship bf55c668e5 all: miscellaneous source-tree reorganization (bgo #733609) 2014-07-30 16:01:00 -04:00
Dan Winship 8aa3b9859b core: merge src/config, src/logging, src/posix-signals into src/
Some subdirectories of src/ encapsulate large chunks of functionality,
but src/config/, src/logging/, and src/posix-signals/ are really only
separated out because they used to be built into separate
sub-libraries that were needed either for test programs, or to prevent
circular dependencies. Since this is no longer relevant, simplify
things by moving their files back into the main source directory.
2014-07-30 15:56:29 -04:00
Dan Winship 5432ef5e52 tools: move libnm-glib's fake NM service implementations here
Move libnm-glib's test-fake-nm.py and test-remote-settings-service.py
to tools/, merge them together into a single program, and fix a few
bugs (notably some missing signal emissions in the Settings service).

Although they are currently only used by libnm-glib's tests, they are
generic enough that they could be used by other code in the future
(and in particular, they will be used by libnm's tests as well).
2014-07-30 15:56:29 -04:00
Dan Winship 763ce29e58 test: drop this directory
The remaining contents of the test/ directory are:

  - 2 python example programs that aren't as good as the ones in examples/

  - a test of the deprecated libnm_glib API which isn't as good as the one
    in libnm-glib/

  - A DHCP-related test program that hasn't been relevant since 2005

Let's just kill it all
2014-07-30 15:56:29 -04:00
Dan Winship efb2b13baa tools: move debug-helper.py from test/ to tools/ 2014-07-30 15:56:19 -04:00
Dan Winship 420e027c99 tools: dist everything
Dist run-test-valgrind.sh and test-sudo-wrapper.sh, since they may be
of use to people building from tarballs as well.
2014-07-30 15:56:19 -04:00
Dan Winship 3d25d70461 clients: reorganize source tree, put all the installed clients together
Create a new clients/ subdirectory at the top level, and move cli/ and
tui/ into it, as well as nm-online.c (which was previously in test/,
which made no sense).

cli/ was split into two subdirectories, src/ and completion/. While
this does simplify things (given that the completion file and the
binary both need to be named "nmcli"), it bloats the source tree, and
we can work around it by just renaming the completion file at install
time. Then we can combine the two directories into one and just have
it all under clients/cli/.
2014-07-30 15:56:19 -04:00
Dan Williams 25dac5760b contrib/rpm: fix up sub-package dependencies
There are three fixes:

1) the config packages shouldn't require the main NetworkManager
package.  We explicitly make NetworkManager-glib not
depend on NM itself to ensure that clients can link to it (and thus
have an RPM dependency on -glib) without pulling in NetworkManager
itself.  The same should hold true for the config packages, since
consumers of NetworkManager may want to pull them in, but not
necessarily pull NetworkManager in.

For example, GNOME Shell wants to make use of NetworkManager's
connectivity detection *if NM is available*, and this requires
pulling in NM-config-connectivity-fedora, but that shouldn't
pull in NetworkManager itself.

Similarly, we had a problem with RHEL7 making sure that
NM-config-server was installed by default on Server variants but
not on other variants; removing the dependency from the -config
subpackage was the cleanest way to fix that.

Furthermore, nothing in the config sub-packages actually
requires NetworkManager anyway since they are simply config files.

2) nmtui doesn't care what architecture the running NM is since
it communicates solely over D-Bus.  So skip the %{?_isa}, just
like we do for other clients (nm-applet, GNOME Shell, etc)

3) Requiring NetworkManager.%{?_isa} from the -devel package
has problems with multilib (see rh #1112367).  This is an issue
if you install a 32-bit development environment and try to build
something that uses NetworkManager.  Since the -devel package
requires the main package, you can end up either having *both*
NetworkManager.i686 and NetworkManager.x86_64 installed, or you
end up having NetworkManager.i686 replace NetworkManager.x86_64.
Neither one is good. So remove the %{?_isa} bit.
2014-07-30 09:35:02 -05:00
Elad Alfassa 9060e1ab1a contrib/rpm: set connectivity interval in 20-connectivity-fedora.conf (rh #1123772)
Without the interval, connectivity checking doesn't actually happen.

https://bugzilla.redhat.com/show_bug.cgi?id=1123772
2014-07-30 08:40:59 -05:00
Thomas Haller e273ff4fe7 core: refactor nm_ip[46]_config_commit() not to make a copy of route
In nm_ip4_config_commit() and nm_ip6_config_commit() there is no need
to copy the route. Just use the pointer returned from nm_ip4_config_get_route()/
nm_ip6_config_get_route().

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-29 23:42:50 +02:00
Thomas Haller 06703c1670 core: fix checks for default routes by comparing the prefix length
At some places, we considered a default route to be a route with
destination network 0.0.0.0 (::). This is wrong because a default route
is a route with plen==0.

This is for example relevant for OpenVPN which adds two routes
0.0.0.0/1 and 128.0.0.0/1 to hijack the default route. We should
not treat 0.0.0.0/1 as default route, instead  NM should treat
it as any other subnet route (even if it effectively routes large
parts).

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-29 23:40:39 +02:00
Thomas Haller a7f05b84f8 core: fix setting next_hop in nm_ip6_config_create_setting()
The next-hop should always be set to route->gateway. Just as
it is done in the IPv4 case too.

This bug only affected routes to '::/p via gateway', with a
non-zero gateway and p > 0. That is a quite uncommon case, because
usually non-default routes have not a net-part all zero.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-29 23:36:22 +02:00
Thomas Haller 88136c5aab config: fix prototype of nm_config_get_connectivity_interval()
gcc warns:

    make[4]: Entering directory `/data/src/NetworkManager/src'
      CC       nm-device.lo
    In file included from devices/nm-device.c:73:0:
    ../src/config/nm-config.h:61:13: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
     const guint nm_config_get_connectivity_interval (NMConfig *config);
                 ^

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-29 21:45:58 +02:00
Thomas Haller 7f35d808f5 libnm-glib: fix gtk-doc for NMClient:active-connections
Since previous commit dafe51e881,
the gtk-doc is no longer ignored. However, the angle brackets
add invalid XML characters to ./docs/libnm-glib/xml/nm-client.xml
This breaks the build.

    make[3]: Entering directory `./NetworkManager/docs/libnm-glib'
      DOC   Scanning header files
      DOC   Introspecting gobjects
      DOC   Building HTML
    ../xml/nm-client.xml:1110: parser error : Opening and ending tag mismatch: NMActiveConnection line 1109 and para
    </para></refsect2>
           ^
    ../xml/nm-client.xml:1110: parser error : Opening and ending tag mismatch: para line 1107 and refsect2
    </para></refsect2>
                      ^
    ../xml/nm-client.xml:1211: parser error : Opening and ending tag mismatch: refsect2 line 1104 and refsect1
    </refsect1>
               ^
    ../xml/nm-client.xml:1262: parser error : Opening and ending tag mismatch: refsect1 line 1095 and refentry
    </refentry>
               ^
    ../xml/nm-client.xml:1263: parser error : Premature end of data in tag refentry line 7

    ^
    ../libnm-glib-docs.xml:67: element include: XInclude error : could not load ../xml/nm-client.xml, and no fallback was found
    make[3]: *** [html-build.stamp] Error 6

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-27 04:31:03 +02:00
Dan Winship dafe51e881 libnm-glib: document some properties
Some libnm-glib object properties were only documented in the
GParamSpec strings, not via gtk-doc comments, so they became
undocumented when the paramspec strings went away. Fix that.

(Also fix incorrect gtk-doc syntax with several NMClient properties.)
2014-07-25 09:49:58 -04:00
Jiří Klimeš 93f7fa96d6 ifcfg-rh: fix a crash on setting hostname with SELinux disabled (rh #1122826)
When SELinux is disabled, getfscreatecon() fails leaving se_ctx_prev undefined
and then later freecon (se_ctx_prev) fails with a crash. Initializing
se_ctx_prev to NULL fixes the crash. (It is fine to pass NULL context to
setfscreatecon()).

Testcase:
1) Enable ifcfg-rh plugin in /etc/NetworkManger/NetworkManger.conf
   plugins=ifcfg-rh
2) Edit /etc/sysconfig/selinux to contain
   SELINUX=disabled
3) Reboot
4) Set hostname via nmcli, nmtui or D-Bus SaveHostname() call
5) NM crashes

https://bugzilla.redhat.com/show_bug.cgi?id=1122826
2014-07-25 09:20:31 +02:00
Dan Winship 1c7e3d85fc libnm-util: fix enum member names in a gtk-doc comment 2014-07-23 17:18:03 -04:00
Dan Winship 7d1e0c3781 libnm-util: fix gtk-doc syntax in nm-version.h to avoid a warning 2014-07-23 17:18:03 -04:00
Dan Williams d307a8b061 wwan: allow using the default subscription APN (bgo #729665)
If no APN is specified, passing "" to ModemManager indicates that
the connection should use the default subscription APN, which the
modem and the network determine themselves.  This doesn't work
with all modems and operators, but in that case the user can
specify the APN.
2014-07-23 14:32:32 -05:00
Simon Farnsworth 155cd790f3 wwan: allow completing new GSM connections without an APN (bgo #729665)
In commit 215306f5 [1], NetworkManager was changed to require an APN for GSM
connections; previously, an omitted APN was taken as "use the default APN
for this device".

ModemManager supports this behaviour with an empty APN string; older
NetworkManager versions support this behaviour with no APN in the
settings. Choose the older NM behaviour, for backwards compatibility.

[1] commit 215306f5a1
  Author: Dan Williams <dcbw@redhat.com>
  Date:   Mon Jan 10 23:39:12 2011 -0600

    core: add AddAndActivate D-Bus method

    Given connection details, complete the connection as well as possible
    using the given specific object and device, add it to system
    settings, and activate it all in one method.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=729665
2014-07-23 14:31:21 -05:00
Dan Williams 0151df2f0a merge: add WWAN support for IPv6 (bgo #682623) 2014-07-23 14:27:09 -05:00
Dan Williams 2e0ba9d865 wwan: use a shorter DHCP timeout
With WWAN, the DHCP is all done in modem firmware, and never started
until we know we have a successful packet connection to the network.
Which means the modem firmware already knows the IP details and
is ready to provide them.  Furthermore, since the DHCP is done on
what is essentially a reliable, wired point-to-point link, we don't
have to waste time with retransmits for dropped packets either.
2014-07-23 14:26:40 -05:00
Dan Williams 784d263170 dhcp: DHCPv6 OtherConf failures should not be fatal
OtherConf implies the address has already been delivered via RA,
and possibly DNS too, meaning our IP configuration is already
good enough.  If nothing on the network bothers to reply to our
DHCPv6 Information Requests, let's just run with the config
we already have instead of tearing down the whole device.
2014-07-23 14:26:40 -05:00
Dan Williams 20081816e1 wwan: don't disconnect if nothing to disconnect
Avoid this error:

NetworkManager[25181]: <warn> (cdc-wdm1): Failed to connect 'T-Mobile Internet': Connection requested IPv4 but IPv4 is unsuported by the modem.
NetworkManager[25181]: <info> (cdc-wdm1): device state change: prepare -> failed (reason 'modem-init-failed') [40 120 28]

** (NetworkManager:25181): CRITICAL **: mm_modem_simple_disconnect: assertion 'MM_IS_MODEM_SIMPLE (self)' failed

self->priv->simple_iface is only valid if stage1/prepare actually
completes, so don't try to access it if stage1/prepare failed.
2014-07-23 14:26:39 -05:00
Dan Williams b5817dffa0 core: remove child devices when a parent's ip_iface becomes known
Child devices shouldn't be exposed as real NMDevices (yet) since the
configuration and life cycle is controlled by the parent.  We already
do this if the ip_iface is known when the child device is added, but
PPP and other transient interfaces often show up just before we know
the parent's ip_iface.
2014-07-23 14:26:39 -05:00