Commit Graph

13873 Commits

Author SHA1 Message Date
Lubomir Rintel
477033b9ef manager: don't attempt to activate ipv6.method=shared connections
It would be nice if we supported IPv6 network sharing (maybe RFC 7278?),
but we don't. Let's not attempt to bring it up, it would fail in stage3.

https://bugzilla.redhat.com/show_bug.cgi?id=1183015
2015-01-25 21:29:07 +01:00
Thomas Haller
a6aacde469 build: replace echo -n by printf '%s' in configure.ac
https://bugzilla.gnome.org/show_bug.cgi?id=743480
2015-01-25 14:54:21 +01:00
Thomas Haller
0c136c1e2c core: merge branch 'th/bgo740443_device_ip_changes'
This branch brings three major changes:

- when routes or addresses are removed externally,
  remove those entiries also from what we want to configure
  on the interface. That way, on the next commit, we will
  not re-add those externally removed entries.
  -- at least not unless the entries reappear due to an
  event such as a new DHCP lease.

- the combined NMIPConfig object of a device which is also
  exposed via DBUS, will no longer contain those externally
  removed entries. The IP config really shows what is actually
  configured.

- for default-routes, no longer enforce the default route even
  on managed devices. Only during commit phases, we might re-add/
  remove a default route from a device, otherwise, pickup the
  default route (or its absence) as actually configured.

https://bugzilla.gnome.org/show_bug.cgi?id=740443
2015-01-24 18:27:35 +01:00
Thomas Haller
da708059da device: always pickup externally configured default routes for a device
Even more eagerly pickup external default routes from the device.
For assumed devices we already picked up the default route.

(a) For assumed devices we already did not enforce the default route at all.
Instead it was always picked up by from the actualy system
configuration. Note that this is the case for assumed-generated
connections and for assuming existing connections.
That means that when NM assumes a connection at startup, it will never
actively manage the default route on that interface. It will only react
on what is present.

(b) For managed devices that have by configuration no default route, still pick up
the default route. That means, that even a device that is managed and
never-default=yes, can have the default route -- if configured externally.

(c) Only during a commit phase (i.e. when we have new configuraiton to be
applied), we enforce the default route or its absence.

(d) During any IP change event from platform, we again pickup whatever
is present. That means if you remove the default route from a managed
interface, NM will not re-add it until anything triggers (c).

This also means, that during the commit phase, we add default routes as
'synced' to the default-route-manager, but the following event from platform,
will change the route entry immediately to 'non-synced'. That is
expected and correct.
2015-01-24 18:27:12 +01:00
Thomas Haller
557667df12 device: better accept external IP changes
When receiving IP changes via platform event, remove all missing
addresses and routes from our internal configurations (such as
wwan, vpn, dhcp).

The effect is that on the next commit, those addresses and routes will
not be re-added as they were explicitly removed by the user.

However on a new DHCP lease or similar events, the addresses will
be added anew.

Another important improvement is that the NMIPxConfig of the active
device reflects when addresses or routes get removed externally. Before
we would continue to expose those entires although they were not
actually configured on the device.

https://bugzilla.gnome.org/show_bug.cgi?id=740443
2015-01-24 18:27:12 +01:00
Thomas Haller
2c06449085 device: require a direct route for IPv6 gateway
In the IPv4 case, we check whether we have a direct route to the gateway
also by looking at the configured addresses/subnets. That is correct,
because every IPv4 address also implies a subnet route.

For IPv6, we explicitly add all subnet routes manually (noprefixroute),
hence, we have a direct route exactly if we have it in our list.
Regardless of the configured IPv6 prefixes.
2015-01-24 18:27:12 +01:00
Thomas Haller
4a83afd530 device: refactor ipx_config_merge_and_apply()
No functional change, but restructure code to make it clearer(?).
2015-01-24 18:27:12 +01:00
Thomas Haller
49d700e862 core: add intersect() functions to NMIP?Config 2015-01-24 18:27:12 +01:00
Thomas Haller
92d800b2e3 core: refactor subtract() functions in NMIP?Config
Factor out code of the nm_ip4_config_subtract() and
nm_ip6_config_subtract() functions. The code can be reused in the
following commit.
2015-01-24 18:27:12 +01:00
Thomas Haller
df9533d045 default-route: improve logging format for default route entries
The previous syntax (s/S for synced, n/N for never-default) is confusing.
Indicate 'never-default' by '0', vs. '1'.
Indicated synced/non-synced as '+sync' and '-sync'.
2015-01-24 18:27:12 +01:00
Dan Williams
091daaa60e vapi: add some missing device and setting types 2015-01-23 15:36:55 -06:00
Dan Winship
f0e74622cc team: fix teamd startup code (rh #1184923)
Since 03a5a85d, NMDeviceTeam was trying to use priv->teamd_pid to
decide whether a teamd_dbus_vanished() call indicated "teamd hasn't
been started yet" or "teamd was previously started and has now
exited". But this resulted in a race condition, where at startup, a
device could call g_dbus_watch_name(), then launch teamd (causing
teamd_pid to get set), and then have gdbus report that teamd hasn't
been started yet before the newly-launched teamd managed to grab the
bus name. Since teamd_pid would already be set when
teamd_dbus_vanished() was called, it would decide that this meant
"teamd was previously started and has now exited", so it would call
teamd_cleanup(), killing the just-started teamd process.

Fix this by having teamd_dbus_vanished() check priv->tdc instead,
which doesn't get set until after the first teamd_dbus_appeared()
call.
2015-01-23 10:05:20 -05:00
Lubomir Rintel
44e065359e dist: include manual page sources
Ommittes by mistake with an errorneous substitution.

https://mail.gnome.org/archives/networkmanager-list/2015-January/msg00066.html
2015-01-23 11:03:41 +01:00
Lubomir Rintel
799820f859 libnm: drop libdbus-glib from pkg-config file
libnm uses GIO DBus library instead.

https://mail.gnome.org/archives/networkmanager-list/2015-January/msg00065.html
2015-01-22 19:17:46 +01:00
Thomas Haller
8dce71be74 device: adjust default route metric for BRIDGE device type
We forgot to include the BRIDGE, so that bridge
devices got a default priority (route-metric) of 950
Add it between VLAN and MODEM type.

Also return a different metric for UNKNOWN
device types, but these priorities are not
actually expected.
2015-01-22 18:56:37 +01:00
Thomas Haller
7d2e43a455 core/trivial: fix documentation of nm_utils_uuid_generate_from_strings() 2015-01-22 14:03:37 +01:00
Dan Williams
3d25613327 merge: stop pppd before notifying ModemManager to disconnect (bgo #734347) 2015-01-21 18:36:48 -06:00
Aleksander Morgado
a6fedb1a26 wwan: consolidate format of log messages 2015-01-21 18:36:00 -06:00
Aleksander Morgado
fe090c34b7 wwan: wait for pppd to exit before relaying the port to ModemManager
ModemManager needs to have CLOCAL set in the TTY termios configuration, in order
to notify the kernel that modem control lines are not in effect (e.g. so that a
transition to LOW in the DCD input control line doesn't trigger a hangup in the
TTY).

pppd in the other hand, needs CLOCAL unset in order to have proper modem control
lines in effect during the PPP session. So, when pppd starts it will store the
original termios settings, and before exiting it will restore the original
settings in the TTY. In other words, if CLOCAL was set before launching pppd,
CLOCAL will be also set after pppd exits.

Now, in order for this sequence to work correctly, NetworkManager also needs to
make sure that ModemManager is notified about the disconnection only after pppd
has really finished re-configuring the TTY.

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

----------------------

Once the patch is applied, we will be making sure that ModemManager is only
notified about the disconnection AFTER pppd has fully exited:
    NetworkManager[27589]: <info>  (ttyUSB2): device state change: activated -> deactivating (reason 'user-requested') [100 110 39]
    Terminating on signal 15
    nm-pppd-plugin-Message: nm-ppp-plugin: (nm_phasechange): status 10 / phase 'terminate'
    nm-pppd-plugin-Message: nm-ppp-plugin: (nm_phasechange): status 8 / phase 'network'
    Connect time 0.3 minutes.
    Sent 56 bytes, received 0 bytes.
    nm-pppd-plugin-Message: nm-ppp-plugin: (nm_phasechange): status 5 / phase 'establish'
    nm-pppd-plugin-Message: nm-ppp-plugin: (nm_phasechange): status 11 / phase 'disconnect'
    Connection terminated.
    nm-pppd-plugin-Message: nm-ppp-plugin: (nm_phasechange): status 1 / phase 'dead'
    nm-pppd-plugin-Message: nm-ppp-plugin: (nm_exit_notify): cleaning up
    NetworkManager[27589]: <warn>  pppd pid 27617 exited with error: pppd received a signal
    NetworkManager[27589]: <info>  (ttyUSB2): modem state changed, 'connected' --> 'disconnecting' (reason: user-requested)
    NetworkManager[27589]: <info>  (ttyUSB2): modem state changed, 'disconnecting' --> 'registered' (reason: user-requested)
    NetworkManager[27589]: <info>  (ttyUSB2) modem deactivation finished
    NetworkManager[27589]: <info>  (ttyUSB2): device state change: deactivating -> disconnected (reason 'user-requested') [110 30 39]
    NetworkManager[27589]: <info>  (ttyUSB2): deactivating device (reason 'user-requested') [39]
2015-01-21 18:36:00 -06:00
Aleksander Morgado
ec61601a22 wwan,modem: let disconnect() be an async operation 2015-01-21 18:36:00 -06:00
Aleksander Morgado
14f732e8df ppp-manager: new async stop() method to request stop and wait for it to complete
This method doesn't prevent the original logic in which the child process was
stopped when the last reference of the PPP manager was unref-ed.
2015-01-21 18:35:59 -06:00
Aleksander Morgado
f3efdbcdf2 device: new deactivate_async() method to be run during DEACTIVATING phase
This method isn't run if NM is quitting; so the deactivate() method still needs
to be implemented to handle sync disconnection requests.
2015-01-21 17:58:50 -06:00
Dan Williams
6bb0cffba3 merge: add support for Wi-Fi powersave (bgo #739084) 2015-01-21 17:28:12 -06:00
Mathieu Trudel-Lapierre
a428de8215 wifi: set wireless powersave for nl80211 devices when activated
Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>

(fixups and WEXT implementation by dcbw)
2015-01-21 14:31:14 -06:00
Dan Williams
c3e319266c cli: add support for wifi.powersave setting 2015-01-21 14:31:14 -06:00
Dan Williams
6a3531d02d ifcfg-rh: add Wi-Fi powersave support 2015-01-21 14:31:14 -06:00
Dan Williams
5293683e4a libnm/libnm-util: add Wi-Fi 'powersave' property 2015-01-21 14:31:04 -06:00
Dan Winship
7bdc6f5de5 libnm-core, libnm-util: merge branch 'danw/versioning-bgo742993'
https://bugzilla.gnome.org/show_bug.cgi?id=742993
2015-01-21 12:54:36 -05:00
Dan Winship
6da3b3a5a5 libnm: fix versioning on new APIs, bump soname
The newly added bond mode APIs in nm-utils will be new in 1.2, so mark
them as such in the headers and docs, move them to a new section in
libnm.ver.

Since we're adding the new section to libnm.ver, this also seems like
a good time to bump the soname.
2015-01-21 12:54:36 -05:00
Dan Winship
5756c65c6f libnm-core, libnm-util: belatedly update version macros
Add version macros for NM 1.2, and change NM_VERSION_CUR_STABLE to
1.0, and NEXT_STABLE to 1.2.
2015-01-21 12:54:36 -05:00
Thomas Haller
4c691cf69e trival/whitespace: fix indention in nm-dns-manager.c
Fixes: 583568e12f
2015-01-21 17:30:05 +01:00
Jiří Klimeš
8ed0e50ff1 cli: add description for certificate properties in editor (rh #1182575) 2015-01-20 14:27:17 +01:00
Jiří Klimeš
564b462dd3 core: show better error for software device creation failures (rh #1182923)
https://bugzilla.redhat.com/show_bug.cgi?id=1182923
2015-01-20 14:03:11 +01:00
Dan Williams
a387f1de0c merge: don't use system() for loading modules (bgo #740651) 2015-01-19 12:10:19 -06:00
Thomas Haller
32625f604b core: use nm_utils_modprobe()
https://bugzilla.gnome.org/show_bug.cgi?id=740651
2015-01-19 12:07:27 -06:00
Thomas Haller
4ad6099b01 utils: add nm_utils_modprobe()
https://bugzilla.gnome.org/show_bug.cgi?id=740651
2015-01-19 12:07:27 -06:00
Dan Winship
1970f59b6f core: merge branch 'danw/signals-bgo743052'
https://bugzilla.gnome.org/show_bug.cgi?id=743052
2015-01-19 11:50:15 -05:00
Dan Winship
fb792af7cb core: add nm_utils_setpgid(), and use it
Add nm_utils_setpgid() as a g_spawn*() child setup function for
calling setpgid(), and use it where appropriate rather than
reimplementing it every time.
2015-01-19 11:29:13 -05:00
Dan Winship
c22e3f327a core, dispatcher: drop unnecessary setpgid() calls
There's no point in calling setpgid() on short-lived processes, so
remove the setpgid() calls when spawning dispatcher scripts, iptables,
iscsiadmin, and netconf.
2015-01-19 11:29:13 -05:00
Dan Winship
3d068724da nm-iface-helper: small signal handling fixup
nm-iface-helper originally used the same pthread_sigmask()-based
signal handling as NetworkManager, but was then switched to using
g_unix_signal_add(). But a little bit of unnecessary code remained.
2015-01-19 11:29:13 -05:00
Dan Winship
c5b3e93792 core: use GUnixSignalWatchSource to simplify signal handling
Replace the pthread_sigwait()-based signal handling with
g_unix_signal_add()-based handling, and get rid of all the
now-unnecessary calls to nm_unblock_posix_signals() when spawning
subprocesses.

As a bonus, this also fixes the "^C in gdb kills NM too" bug.
2015-01-19 11:29:13 -05:00
Dan Winship
1c435dc874 dispatcher: merge branch 'danw/dispatcher-external-bgo742588'
https://bugzilla.gnome.org/show_bug.cgi?id=742588
2015-01-19 11:20:42 -05:00
Dan Winship
849ae9eed6 dispatcher: add an env var indicating a connection is "external"
Add CONNECTION_EXTERNAL=1 to the environment when dispatching actions
on a "generated-assumed" connection (ie, one that was created outside
of NM).
2015-01-19 11:19:33 -05:00
Dan Winship
995da9a5a6 dispatcher: expose connection D-Bus path
src/nm-dispatcher.c was passing the connection's D-Bus path to the
dispatcher, which was then ignoring it. Meanwhile,
test-dispatcher-envp was passing a fake D-Bus path with the wrong name
(which didn't actually matter since
nm_dispatcher_utils_construct_envp() ignored it anyway).

Fix it so that the path gets exposed as CONNECTION_DBUS_PATH, and
adjust the tests for that.
2015-01-19 11:17:37 -05:00
Dan Winship
9cfd9d376f dispatcher: remove "old" from the test names
There's no reason the dispatcher test files should have "old" in their
names, since they're testing the current dispatcher interface.
2015-01-19 11:09:26 -05:00
Lubomir Rintel
1bc942b142 cli: fix client bond option count
Looks more like 5, not 7, unless a particular mode is selected:

There are 7 optional arguments for 'bond' connection type.
Do you want to provide them? (yes/no) [yes]
Bonding mode [balance-rr]:
Bonding monitoring mode (miimon/arp) [miimon]:
Bonding miimon [100]:
Bonding downdelay [0]:
Bonding updelay [0]:
2015-01-19 12:04:50 +01:00
Thomas Haller
07be0f511d connectivity: fix compile error no WITH_CONCHECK
Fixes: 53f2642c73
2015-01-16 14:16:10 +01:00
Thomas Haller
05212419e1 libnm-core: fix compile error in set_property_from_dbus() for missing return value
Fixes: 76d9fc9167
2015-01-16 13:39:33 +01:00
Dan Winship
f137d495dc libnm-core: merge branch 'danw/validate-proptype-rh1182567'
https://bugzilla.redhat.com/show_bug.cgi?id=1182567
2015-01-15 14:46:30 -05:00
Dan Winship
76d9fc9167 libnm-core: validate property types from D-Bus (rh #1182567)
In _nm_setting_new_from_dbus(), verify that the properties have the
right types, and return an error if not. (In particular, don't crash
if someone tries to assign a GBytes-valued property a non-'ay' value.)
2015-01-15 14:46:30 -05:00