Compare commits

...

355 Commits
f20 ... rawhide

Author SHA1 Message Date
Beniamino Galvani e481288c3e Update to 1.43.6 release (development) 2023-04-20 11:58:54 +02:00
Beniamino Galvani 229955ef0b Sync the spec file with upstream 2023-04-20 11:58:54 +02:00
Adam Williamson ef05be83e2 Fix ppp version discovery 2023-04-18 18:02:18 -07:00
Kevin Fenzi 948f57c7bf Add upstream patch for ppp-2.5.0
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2023-04-18 16:24:30 -07:00
Adam Williamson c609302693 Rebuild for ppp 2.5.0 2023-04-18 14:51:11 -07:00
Lubomir Rintel 86df8c88db Actually bump the version 2023-04-05 14:39:21 +02:00
Lubomir Rintel d4cbc3d2d2 Update to 1.43.5 release (development) 2023-04-05 13:54:59 +02:00
Thomas Haller 3562d94a12
Update to 1.43.4 release (development) 2023-03-22 20:43:13 +01:00
Lubomir Rintel 0a4365e5af Remove an old patch 2023-03-08 18:36:35 +01:00
Lubomir Rintel 589a1c573c Update to an early 1.44 snapshot 2023-03-08 16:11:50 +01:00
Thomas Haller 3049c2df9a
libnm/docs: fix gtk-doc generation for settings 2023-02-10 17:38:30 +01:00
Thomas Haller 9aa462c3d5
Upgrade to 1.42.0 release 2023-02-10 10:13:48 +01:00
Yaakov Selkowitz 268730fdde Fix flatpak build 2023-01-31 17:30:10 +00:00
Lubomir Rintel d11b67721a Update to 1.41.91 release (release candidate) 2023-01-26 10:37:02 +01:00
Fernando Fernandez Mancera 4a5d12e071 Upgrade to 1.42-rc1 (1.41.90) (release candidate) 2023-01-20 12:49:37 +01:00
Fedora Release Engineering 2cb10e4348 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-18 19:55:54 +00:00
Beniamino Galvani 97dcdaaf53 Update to 1.41.8 release (development) 2023-01-16 17:13:12 +01:00
Lubomir Rintel 9e45edd668 Update to 1.41.7 release (development) 2022-12-15 17:11:05 +01:00
Thomas Haller 0f59c7739b
Update to 1.41.6 release (development) 2022-11-30 18:39:05 +01:00
Thomas Haller 8932641c49
Upgrade to 1.41.5 development snapshot 2022-11-18 08:31:29 +01:00
Thomas Haller fe89fe48df
fix generating stable UUIDs for keyfile (gitlab#1130) 2022-11-03 09:30:01 +01:00
Wen Liang 971a5b8ee2 Update to 1.41.4 release (development) 2022-11-02 16:43:10 -04:00
Beniamino Galvani c5811ea797 Update to 1.41.3 release (development) 2022-10-18 12:11:48 +02:00
Thomas Haller 3177397698
Upgrade to 1.40.0 release 2022-08-26 19:41:20 +02:00
Ana Cabral eb5fbe00af Upgrade to 1.40-rc1 (1.39.90) (release candidate) 2022-08-16 18:51:15 -03:00
Beniamino Galvani e27d4677d1 Update to 1.39.11 release (development) 2022-07-28 10:43:10 +02:00
Fedora Release Engineering 460034d95b Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-20 18:49:28 +00:00
Vojtech Bubela 022b5635e4 Update to 1.39.10 release (development) 2022-07-14 15:26:50 +02:00
Lubomir Rintel e83c290128 Update to 1.39.8 release (development) 2022-06-30 16:51:10 +02:00
Ana Cabral e41df17cd6 Bump release number 2022-05-30 14:03:39 +02:00
Ana Cabral 136952f729 rpm: include an informational file in ifcfg files directory 2022-05-30 10:28:35 +02:00
Thomas Haller 53393c4b58
Upgrade to 1.38.0 release 2022-05-13 11:32:19 +02:00
Thomas Haller a745e634cf
Upgrade to 1.38-rc3 (1.37.92) (release candidate) 2022-05-04 15:10:17 +02:00
Thomas Haller 42ff700916
Upgrade to 1.38-rc2 (1.37.91) (release candidate) 2022-04-14 12:48:41 +02:00
Ana Cabral 49cb2c5734 Update to 1.38.0-rc1 (1.37.90) (release candidate) 2022-04-07 11:33:46 +02:00
Lubomir Rintel 7cf2ae3afa Upgrade to 1.37.3 release (development) 2022-03-24 22:06:17 +01:00
Beniamino Galvani f403f8efc4 Update to 1.36.4 release 2022-03-22 21:50:12 +01:00
Michael Scherer 50b8516937 Fix RHBZ 2066849 2022-03-22 16:36:30 +01:00
Beniamino Galvani 8bcd242d34 Update to 1.36.2 release 2022-03-07 12:03:57 +01:00
Lubomir Rintel 9dc614162a Update to 1.36.0 release 2022-02-24 16:59:47 +01:00
Lubomir Rintel 29841c7d57 Update to 1.36-rc3 (1.35.92) (release candidate) 2022-02-19 14:11:54 +01:00
Lubomir Rintel 0b5c393efe Fix build 2022-02-10 15:42:33 +01:00
Lubomir Rintel c3b4682a03 Update to 1.36-rc2 (1.35.91) (release candidate) 2022-02-10 15:21:20 +01:00
Lubomir Rintel ca43676e5e Update to 1.36-rc1 (1.35.90) (release candidate) 2022-02-04 18:39:45 +01:00
Thomas Haller 993bfd4a39
update to an early 1.36 snapshot (1.35.7) 2022-01-28 15:27:31 +01:00
Thomas Haller 73ea8c0c0f
Revert rework of DHCP client that causes crash
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1066#note_1233210
2022-01-27 01:00:50 +01:00
Thomas Haller bf5f80eb09
fix version 2022-01-26 23:13:20 +01:00
Thomas Haller 2daaa0dfe3
update to an early 1.36 snapshot (1.35.6) 2022-01-26 23:06:06 +01:00
Fedora Release Engineering 8c1c57be16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-19 19:30:29 +00:00
Thomas Haller 88df317665
update to an early 1.36 snapshot (1.35.4) 2022-01-13 13:44:19 +01:00
Wen Liang 341972ce75 update to an early 1.36 snapshot (1.35.3) 2021-12-15 20:06:10 -05:00
Wen Liang 93fb0bf10a update to an early 1.36 snapshot (1.35.2) 2021-12-02 12:37:26 -05:00
Beniamino Galvani f839faf6ba update to an early 1.36 snapshot (1.35.1) 2021-11-19 18:04:21 +01:00
Beniamino Galvani 0130e35f80 core: better handle sd-resolved errors when resolving hostnames
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/833
2021-10-29 17:00:59 +02:00
Beniamino Galvani 8594b59280 Update to 1.32.12 release 2021-09-22 12:01:58 +02:00
Thomas Haller 2c2c15fe51
platform: fix capturing IPv4 addresses from platform for assuming after restart 2021-08-19 18:58:38 +02:00
Wen Liang 0bf341083e
Update to 1.32.10 release
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
2021-08-19 13:27:49 +02:00
Fernando Fernandez Mancera 4a6b3fc1cc Update to 1.32.8 release
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2021-08-10 20:19:24 +02:00
Thomas Haller 373fa8cd0f
update to 1.32.6 release 2021-07-28 18:29:34 +02:00
Thomas Haller 76947cefc7
changelog: whitespace fixes 2021-07-27 10:46:25 +02:00
Fedora Release Engineering aa51858262 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 15:55:23 +00:00
Fedora Release Engineering 4f80c65cb1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-21 11:00:51 +00:00
Thomas Haller 2be3b50b5c
update to 1.32.4 release 2021-07-20 17:30:06 +02:00
Thomas Haller 74a5d6efed
update to 1.32.0 release 2021-06-16 22:46:43 +02:00
Thomas Haller c6fd1f3181
update to 1.32-rc1 (1.31.90) (release candidate) 2021-06-04 18:24:17 +02:00
Beniamino Galvani c649704e87 update to an early 1.32 snapshot (1.31.4) 2021-05-05 21:33:52 +02:00
Beniamino Galvani 0c125af8fe update to an early 1.32 snapshot (1.31.3) 2021-04-23 14:22:09 +02:00
Beniamino Galvani c83d942eaf update sources 2021-04-12 15:49:12 +02:00
Beniamino Galvani b069eff77c update to an early 1.32 snapshot (1.31.2) 2021-03-25 14:01:44 +01:00
Beniamino Galvani 58024e4031 update to 1.30.2 release 2021-03-12 17:11:18 +01:00
Thomas Haller 923d3d1d99
update to 1.30.0 release 2021-02-18 20:25:05 +01:00
Thomas Haller dbfd35a1ec
update to 1.30-rc1 (1.29.90-dev) snapshot 2021-02-11 17:13:31 +01:00
Thomas Haller 598b6a70ba
update to 1.29.11-dev snapshot 2021-02-09 09:21:49 +01:00
Fedora Release Engineering 6db3c9359d - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-25 22:32:05 +00:00
Thomas Haller d08e71d9e7
update to 1.29.9-dev snapshot 2021-01-19 20:12:24 +01:00
Thomas Haller a6813af4b6
resync spec file with upstream
- extend "Requires:" to work with Centos8 and older. We maintain
  upstream a preferred spec file that should work with all distros
  that we support.

- fix to not package manual page for "nm-cloud-setup" in NetworkManager
  package.
2021-01-18 13:02:01 +01:00
Peter Robinson d106900593
Require wireless-regdb for wifi support so WiFi region is set
https://src.fedoraproject.org/rpms/NetworkManager/pull-request/7
2021-01-18 10:27:43 +01:00
Tom Stellard 8f93680134
Use make macros
https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro

https://src.fedoraproject.org/rpms/NetworkManager/pull-request/4
2021-01-15 17:16:06 +01:00
Thomas Haller 7a48b33607
update to 1.29.8-dev snapshot 2021-01-14 22:42:22 +01:00
Jonathan Lebon 3240dc5220
Don't trigger udev if socket doesn't exist
On rpm-ostree systems, we don't want scriptlets to affect the running
system because a major part of the value is "background updates".
Scriptlets are run in a containerized environment where e.g. udev is not
available.

Add a check for the udev socket before triggering it to handle this.
This also helps the container use case.

This doesn't break rpm-ostree strictly, because it uses `|| :`, but it
still spams error messages during the compose. I kept the `|| :` to be
safe, but it's likely fine to remove them now.

See also: https://bugzilla.redhat.com/show_bug.cgi?id=1352154
See also: https://src.fedoraproject.org/rpms/udisks2/pull-request/3
See also: https://github.com/coreos/fedora-coreos-tracker/issues/703

https://src.fedoraproject.org/rpms/NetworkManager/pull-request/6
2021-01-14 22:32:41 +01:00
Tom Stellard 85ab70ffcd Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2021-01-07 05:44:09 +00:00
Mohan Boddu 1130677af4 Rebuild for ppp-2.4.9-1
Signed-off-by: Mohan Boddu <mboddu@bhujji.com>
2021-01-06 11:21:44 -05:00
Thomas Haller a18e85809f
update to 1.28.0 2020-12-06 16:29:45 +01:00
Beniamino Galvani 1d764a957f update to 1.28-rc2 (1.27.91) 2020-10-20 18:55:54 +02:00
Thomas Haller 36c0fdc256
update to 1.28-rc1 (1.27.90) 2020-10-06 10:13:47 +02:00
Thomas Haller 103896827d
reword changelog and re-generate patch
- patches should be in `git format-patch` format and have a
  "cherry picked from" line that refers to the respective upstream
  patch. This way the patch contains meta data like the commit
  message and a reference to the upstream commit ID.

- the change log referred to the commit ID from master branch, when
  it should refer to the batch from nm-1-26 branch (which is upstream
  for 1.26.2, which is currently packaged).

- the change log seem line seems too long. Reword. Also, the main
  purpose of the change is to fix the build (not to backport a patch).
2020-09-21 14:55:20 +02:00
Yaroslav Fedevych 46a78c9b14
Backport a XML generation fix so the package builds correctly
https://src.fedoraproject.org/rpms/NetworkManager/pull-request/5
2020-09-21 14:51:11 +02:00
Thomas Haller a32a9e28b5
adjust version number 2020-08-19 11:07:30 +02:00
Thomas Haller d6f04ca2cf
update to 1.26.2 2020-08-19 09:49:31 +02:00
Fedora Release Engineering 8de97ab4ed - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-27 10:29:45 +00:00
Thomas Haller acbaadae23
prefer keyfile settings plugin from Fedora 33 and newer
https://mail.gnome.org/archives/networkmanager-list/2020-May/msg00002.html
https://fedoraproject.org/wiki/Changes/NetworkManager_keyfile_instead_of_ifcfg_rh
https://lists.fedoraproject.org/archives/list/devel-announce@lists.fedoraproject.org/thread/OLOU27DAON2TYGTAVZ35GZE2BEIN42U3/
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/OLOU27DAON2TYGTAVZ35GZE2BEIN42U3/
https://pagure.io/fesco/issue/2432

https://bugzilla.redhat.com/show_bug.cgi?id=1857391
2020-07-16 12:28:39 +02:00
Thomas Haller f6133686c9
Update to 1.26.0 2020-07-13 21:22:34 +02:00
Thomas Haller a06b38bcbe
update to 1.26-rc1 (1.25.90) 2020-06-15 19:33:09 +02:00
Thomas Haller 28e6474b9c
Update to 1.24.2 release 2020-05-29 17:28:37 +02:00
Thomas Haller bea355fedb
Update to 1.24.0 2020-05-08 14:48:12 +02:00
Thomas Haller b190302070
Update to 1.24-rc2 (1.23.91) 2020-05-02 23:02:28 +02:00
Thomas Haller c2f5bb45e9 Update to 1.24-rc1 (1.23.90) 2020-04-11 20:30:16 +02:00
Björn Esser 660f94e1b0
Bump release 2020-04-02 13:33:12 +02:00
Björn Esser 5eadbbce7e
Fix string quoting for rpm >= 4.16 2020-04-02 13:09:18 +02:00
Thomas Haller f2a09782d5 fix date in changelog 2020-03-12 16:17:24 +01:00
Thomas Haller 505f80e176 Update to 1.22.10 2020-03-12 16:11:58 +01:00
Adam Williamson bbc5f98e67 Rebuild for new ppp 2020-02-22 09:16:42 -08:00
Antonio Cardace e3ace6b76e Update to 1.22.8 2020-02-18 17:23:28 +01:00
Beniamino Galvani c4c77b9ac1 Fix build with GCC 10 2020-02-03 16:15:23 +01:00
Beniamino Galvani 7ff623281c Update to 1.22.6 2020-02-03 12:04:35 +01:00
Fedora Release Engineering 8d16f6e4dc - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-28 09:33:39 +00:00
Beniamino Galvani 3722052671 Update to 1.22.4 2020-01-10 10:36:27 +01:00
Thomas Haller b3a325009e Update to 1.22.2 2019-12-25 20:18:47 +01:00
Thomas Haller e4027e3b1a Update to 1.22.0 2019-12-17 11:27:16 +01:00
Thomas Haller ebb5317dc1 Update to 1.21.90 (1.22-rc1) (fix spec file) 2019-11-29 18:56:32 +01:00
Thomas Haller 110dba26d8 Update to 1.21.90 (1.22-rc1) 2019-11-29 18:38:29 +01:00
Lubomir Rintel 001af63c4e Update to an early 1.22.0 snapshot 2019-11-03 13:04:48 +01:00
Thomas Haller ac21445f51 Update to 1.20.4 release 2019-09-30 09:11:12 +02:00
Lubomir Rintel 81023c35a5 Bring back the boolean dep for the wireless daemon 2019-09-07 14:58:28 +02:00
Lubomir Rintel 5ef97724b1 Bring back the boolean dep for the wireless daemon
Hopefully this will allow installing iwd while still preferring
wpa_supplicant.

Suggested-by: Rex Dieter <rdieter@gmail.com>
Suggested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>>
2019-09-06 14:25:32 +02:00
Lubomir Rintel 48c1f98497 Update to 1.20.2 release
- Bring back the hard wpa_supplicant dependency (rh #1743585)
2019-09-05 14:57:36 +02:00
Lubomir Rintel f3de64e64d wifi: detect FT support per interface and avoid enabling it 2019-08-23 08:58:55 +02:00
Lubomir Rintel 231f1105ed contrib/rpm: install our dispatcher scripts into /usr/lib/NetworkManager
That's where they always should have been.
2019-08-23 08:58:40 +02:00
Lubomir Rintel 84788c4cfd Enable iwd support 2019-08-15 23:10:41 +02:00
Thomas Haller da0c931f46 Update to 1.20.0 release 2019-08-06 14:00:42 +02:00
Thomas Haller 2875b62a86 Update to 1.20-rc1 upstream release candidate 2019-07-29 21:53:55 +02:00
Fedora Release Engineering 885bee8178 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-24 15:59:39 +00:00
Lubomir Rintel 0dda1bed32 settings: fix a reversed conditional in have_connection_for_device() (rh #1727411) 2019-07-08 18:11:38 +02:00
Lubomir Rintel 184dfaf298 Update the 1.20.0 snapshot
- initrd: skip ethernet hwtype in BOOTIF (rh #1726240)
- initrd: allow specifying the net mask in form of a prefix (rh #1725872)
2019-07-03 09:48:56 +02:00
Lubomir Rintel 040ae392e7 Re-enable the initrd generator 2019-06-04 16:09:06 +02:00
Lubomir Rintel 6cfba5306d Update the 1.20.0 snapshot 2019-06-04 16:07:58 +02:00
Lubomir Rintel fd6f6acab8 Update to an early 1.20.0 snapshot 2019-05-03 11:49:05 +02:00
Lubomir Rintel a2e07e734d Sync SPEC with NM git 2019-04-26 18:06:42 +02:00
Lubomir Rintel ed4473292d Update to 1.18.0 release 2019-04-26 17:54:47 +02:00
Thomas Haller 746be5eb7f Update to 1.16.0 release 2019-03-15 16:39:03 +01:00
Thomas Haller b19e5ac269 Fix compilation error on rawhide for gettid() compat implementation 2019-03-11 19:16:32 +01:00
Thomas Haller 6cdec870c5 Update to 1.15.91 release (1.16-rc2) 2019-03-11 17:23:38 +01:00
Thomas Haller 91b043a18a Revert "Remove obsolete Group tag"
We maintain an upstream specfile of NetworkManager [1] that shall be suitable
for all Fedora/RHEL releases. As such, there are still releases for
which we want to keep the group tag.

Revert the patch, so that the difference between Fedora's and upstream's
specfile is minimized.

[1] https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/contrib/fedora/rpm/NetworkManager.spec?id=96be30cbcc59494d45e3b2f3bd605e00050674ed

This reverts commit 62adcbc888.
2019-03-11 17:19:37 +01:00
Thomas Haller 2a9113a2f9 Update to 1.15.90 release (1.16-rc1) 2019-02-23 10:57:15 +01:00
Igor Gnatenko 3fcb0e3703 Rebuild for readline 8.0 2019-02-17 09:30:52 +01:00
Kalev Lember f6c878a04a Update BRs for vala packaging changes 2019-02-04 12:24:46 +01:00
Fedora Release Engineering bcdcd326ad - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-01-31 11:42:26 +00:00
Igor Gnatenko 62adcbc888 Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:18 +01:00
Igor Gnatenko 5c6421bc88
Remove obsolete ldconfig scriptlets
References: https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-01-22 18:40:29 +01:00
Thomas Haller 7d883dd95e dhcp: fix out-of-bounds heap write for DHCPv6 with internal plugin (CVE-2018-15688) 2018-10-29 14:43:36 +01:00
Lubomir Rintel dd82c1e921 Drop unnecessary patches 2018-10-24 11:43:44 +02:00
Lubomir Rintel 7d3054a9e3 Update to 1.14.4 release
Temporarily disable the initrd generator (rh #1641832)
2018-10-24 11:36:00 +02:00
Thomas Haller 67ec5442e9 device: fix crash in nm_device_generate_connection() (1:1.14.2-2)
Also "dhcp: dhclient: fix memory leak".
2018-10-23 12:14:03 +02:00
Lubomir Rintel 6fd65f9fd5 Update to 1.14.2 release 2018-10-19 16:58:26 +02:00
Thomas Haller 92d36d7fb0 Update to 1.14.0 release 2018-09-18 15:15:56 +02:00
Lubomir Rintel ac2eac23f7 Fix Rawhide build 2018-08-11 11:13:19 +02:00
Lubomir Rintel 1117a6f1f7 fix compile error due to NM_AVAILABLE_IN_1_12_2 2018-08-11 09:53:52 +02:00
Lubomir Rintel e49edc693e Update to 1.12.2 release 2018-07-25 12:52:04 +02:00
Fedora Release Engineering cba19ad11e - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-12 19:08:11 +00:00
Thomas Haller c362687d27 Update to 1.12.0 release 2018-06-29 19:19:30 +02:00
Thomas Haller 5743a963d8 fix build failure due to unstable tests 2018-06-18 11:00:20 +02:00
Thomas Haller fff3d1de66 Update to 1.12-rc1 pre-release 2018-06-16 08:19:26 +02:00
Lubomir Rintel 29a9c41bea Update to a development snapshot of NetworkManager 1.12
- Switch crypto to gnutls
- Add dispatcher-routing-rules subpackage
- Switch to Python 3-only build root
2018-05-31 17:10:30 +02:00
Vladimir Benes 98525d7834 tests: add F28 CI tests using the Standard Test Interface
Adding initial set of basic functionality tests for NetworkManager
according to the Standard Test Interface [1]. See Quick Start Guide
for brief introduction about how to run these tests [2].

[1] https://fedoraproject.org/wiki/CI/Standard_Test_Interface
[2] https://fedoraproject.org/wiki/CI/Quick_Start_Guide

[thaller@redhat.com: at this point, NetworkManager package on rawhide
  is essentially the same as on f28. So, when cherry-picking the
  tests, also intentionally keep testing the "fedora28" profile.
   1) until the packages that we test diverge, there is usually
      little reason to run a different set of tests (unless it
      makes sense due to differences in the Fedora version).
   2) as long as the set of tests that we want to run is identical,
      there is no reason to clone the test profile and bump the
      profile number.
  It follows: we stick to "fedora28" for the time being.]

(cherry picked from commit c8e00774af)
2018-05-24 09:51:01 +02:00
Beniamino Galvani d72f282e41 Update to 1.10.8 release 2018-05-14 15:55:00 +02:00
Beniamino Galvani e4a9ce242d dhcp: better handle expiry and nacks (rh #1575370)
https://bugzilla.gnome.org/show_bug.cgi?id=783391
https://bugzilla.redhat.com/show_bug.cgi?id=1575370
2018-05-06 14:28:03 +02:00
Beniamino Galvani 9fa973f15f device: fix setting 'rp_filter' value (rh #1565529) 2018-04-17 10:09:19 +02:00
Beniamino Galvani e712bef644 Fix build 2018-04-12 14:40:49 +02:00
Iryna Shcherbina 4797640ddf Update Python 2 dependency declarations to new packaging standards 2018-03-14 22:39:40 +01:00
Thomas Haller 17941a667b Update to 1.10.6 release 2018-03-12 14:15:23 +01:00
Thomas Haller 9c37f0c674 policy: fix blocking autoconnect for no-secrets (rh #1553773) 2018-03-09 15:38:47 +01:00
Thomas Haller 014828b918 trivial: rename patch 2018-03-09 15:34:53 +01:00
Lubomir Rintel b8041505cb Another attempt at fixing gcc 8 build 2018-02-07 11:53:56 +01:00
Lubomir Rintel 1f3baf8c8d Fix build 2018-02-06 17:31:32 +01:00
Lubomir Rintel 8b792ad0ef Fix build 2018-02-06 17:30:36 +01:00
Lubomir Rintel dc410627f6 Update to 1.10.4 release 2018-02-05 11:37:29 +01:00
Lubomir Rintel e5d9e5bbb2 Revert "Switch to %ldconfig_scriptlets"
This breaks build on basically everything we support. Needs more
thought.

This reverts commit 3dc75bb968.
2018-02-05 11:32:15 +01:00
Igor Gnatenko 3dc75bb968
Switch to %ldconfig_scriptlets
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-02 11:25:09 +01:00
Thomas Haller 2f601f9c53 Update to 1.10.2 release 2017-12-15 11:33:34 +01:00
Björn Esser 2b734c644d
Apply patch from previous commit 2017-11-17 20:08:52 +01:00
Thomas Haller f484465e78 libnm: fix accessing enabled and metered properties 2017-11-02 16:23:09 +01:00
Thomas Haller 44c7179885 systemd: let NM-w-o.service require NetworkManager service (rh #1452866)
- systemd: let NM-w-o.service require NetworkManager service (rh #1452866)
  Related to rh #1455704.
  See also: https://github.com/systemd/systemd/pull/6065

- platform: really treat dsa devices as regular wired ethernet (rh #1371289)
  actually apply patch.

- in spec file, explicitly set dhclient as default (resync with upstream
  spec file).
2017-11-02 15:50:34 +01:00
Lubomir Rintel 7a812558d6 Actually add the patch 2017-10-09 19:47:27 +02:00
Lubomir Rintel e74c1e7f0a Actually bump the release number 2017-10-09 19:45:24 +02:00
Lubomir Rintel cfe40a7c6d platform: treat dsa devices as regular wired ethernet 2017-10-09 19:43:54 +02:00
Thomas Haller 8e0f2bf38d device: fix delay startup complete for unrealized devices (1:1.8.4-4)
And 2 more fixes from upstream.
2017-10-05 10:57:10 +02:00
Thomas Haller 11bdf5039f backport 3 patches for crashes (1.8.4-3) 2017-09-29 13:13:52 +02:00
Thomas Haller de4dee2405 enable NetworkManager-wait-online.service on package upgrade (rh#1455704) 2017-09-27 18:05:03 +02:00
Thomas Haller 354ea1ca0d Update to 1.8.4 release 2017-09-20 14:07:51 +02:00
Fedora Release Engineering 10dfa87029 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-02 17:01:01 +00:00
Fedora Release Engineering bbd538ac0e - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 01:56:03 +00:00
Lubomir Rintel 24d35df5f2 contrib/rpm: provide NetworkManager-devel
The package no longer exists.
2017-07-21 17:40:01 +02:00
Stephen Gallagher 0cc505ca29 Fix Requires/Provides on subpackages
NetworkManager-wifi and NetworkManager-glib-devel should require
NetworkManager, not provide it.

https://bugzilla.redhat.com/show_bug.cgi?id=1454505
2017-07-20 22:11:18 +02:00
Beniamino Galvani 46b9e17739 Import upstream patches after 1.8.2 2017-07-18 11:03:01 +02:00
Beniamino Galvani 8ca68d8c30 Update to 1.8.2 release 2017-07-18 11:03:01 +02:00
Lubomir Rintel a2ab3fed9e Add upstream patches that went into RHEL
- device: don't change MTU unless explicitly configured (rh #1460760)
- core: don't remove external IPv4 addresses (rh #1459813)
- cli: fix output of iface in overview output (rh#1460219)
- ppp: unexport NMPPPManager instance on dispose (rh#1459579)
- cli: remove spurious device names from wifi subcommands output (rh#1460527)
2017-06-22 12:52:23 +02:00
Lubomir Rintel ebf02b63fe Add upstream patches that went into RHEL
- bond: fix crash comparing mode while generating bond connection (rh #1459580)
- connectivity: fix route penalty if WWAN and BT device using ip-ifindex (rh #1459932)
- device: persist nm-owned in run state (rh #1376199)
- device: fix assuming master device on restart (rh #1452062)
- device: apply route metric penality only when the default route exists (rh #1459604)
- connectivity: fix periodic connectivity check (rh #1458399)
- bond: improve option matching on daemon restart (rh #1457909)
- device: fix touching device after external activation (rh #1457242)
2017-06-09 17:27:09 +02:00
Thomas Haller a53c203b20 import patches from rhel-7.4 (1.8.0-5.el7) as 1.8.0-4 2017-06-04 19:47:58 +02:00
Thomas Haller b018266780 update spec file from upstream 2017-05-24 13:02:31 +02:00
Thomas Haller b67ac8dd76 device: update external configuration before commit (fix bug) (rh #1449873) 2017-05-22 11:30:21 +02:00
Thomas Haller 5539474cc7 update NetworkManager.spec file with upstream
Resync spec file with upstream's contrib/fedora/rpm
NetworkManager.spec file.
2017-05-20 11:12:59 +02:00
Thomas Haller 5ac481bbc0 import patches from rhel-7.4
Let's keep rhel-7.4 and Fedora package in sync, so Fedora benefits
from bugfixes during rhel-7.4 development and RHEL benefits from
additional testing by the community.

These are all upstream patches originally cherry-picked from
nm-1-8 branch.
2017-05-20 11:07:37 +02:00
Thomas Haller 085f84674b fix version number 2017-05-10 16:48:53 +02:00
Thomas Haller 4b63db2a3c Update to 1.8.0 release 2017-05-10 16:00:37 +02:00
Lubomir Rintel 20a1eb6b48 Update to third Release Candidate of NetworkManager 1.8 2017-04-20 17:29:21 +02:00
Lubomir Rintel c2e258e5bf Update to second Release Candidate of NetworkManager 1.8 2017-04-06 14:58:15 +02:00
Lubomir Rintel a486a68256 Update to a snapshot of 1.8.x series
And sync SPEC file changes from upstream
2017-03-23 18:00:08 +01:00
Lubomir Rintel e6eb5ade9b Update to a 1.6.2 release 2017-02-16 15:39:48 +01:00
Fedora Release Engineering 9082b9c2c9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild 2017-02-10 05:13:45 +00:00
Lubomir Rintel 02c2422a55 Drop old patches 2017-01-25 18:49:37 +01:00
Lubomir Rintel 6fe2ab4151 Update to a 1.6.0 release 2017-01-25 18:29:09 +01:00
Thomas Haller a920fbcc16 Update with fixes from upstream nm-1-6 branch 1.6-0.2.rc1 2017-01-20 17:26:50 +01:00
Lubomir Rintel d142b15bef Fix FTBFS 2017-01-17 16:23:42 +01:00
Thomas Haller 263dac5e9f drop unused patch 0001-bitwise-clash.patch 2017-01-17 15:54:13 +01:00
Thomas Haller dcba8d0c1b update NetworkManager.conf default file 2017-01-17 15:53:57 +01:00
Lubomir Rintel ffc584dc8e Actually upload the file... 2017-01-17 15:48:54 +01:00
Lubomir Rintel 9b6a7107cd Fix up merge trouble 2017-01-17 15:15:53 +01:00
Lubomir Rintel f6516fc10b Update to a 1.6-rc1 2017-01-17 15:12:38 +01:00
Thomas Haller 0727cc1c28 fix build failure due to clash of bitwise defines
Also fixup the changelog for past release versions.
2017-01-12 22:29:43 +01:00
Igor Gnatenko 49933b2c3f Rebuild for readline 7.x
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
2017-01-12 17:30:34 +01:00
Lubomir Rintel 162dc7bc1d Update to a newer development snapshot 2016-12-15 20:51:26 +01:00
Lubomir Rintel bdcc136a74 sync 2016-12-15 20:24:28 +01:00
Thomas Haller 499383592f Rebuild package for vala generation error (rh#1398738) 2016-12-06 21:11:01 +01:00
Thomas Haller f6cdb7df44 fix enabling ifcfg-rh plugin by default for +=/-= operations (rh#1397938) 2016-11-25 18:27:33 +01:00
Thomas Haller 85fff454e7 fix enabling ifcfg-rh plugin by default (rh#1397938) 2016-11-23 19:00:27 +01:00
Lubomir Rintel 86376290a3 Drop an extra rebuild that breaks on 32bit 2016-11-06 15:43:33 +01:00
Lubomir Rintel 8c478edba5 Fix a timestamp typo 2016-11-06 14:42:36 +01:00
Lubomir Rintel ce85c6f3ef Update to a development snapshot 2016-11-06 14:37:55 +01:00
Lubomir Rintel 3a1a8315bc Update to 1.4.2 2016-10-10 19:17:57 +02:00
Thomas Haller 76dec7d585 wifi: fix another activation failure when changing MAC address (rh#1371478, bgo#770456, bgo#770504) 2016-09-13 11:31:09 +02:00
Thomas Haller 2c68942743 dhcp: fix race to miss DHCP lease event (rh#1372854) 2016-09-08 00:40:29 +02:00
Thomas Haller 475c2e000a wifi: fix activation failure due to error changing MAC address (rh#1371478, bgo#770456) 2016-08-30 12:34:35 +02:00
Thomas Haller 7802605bbc update spec file with upstream's contrib/rpm 2016-08-25 12:03:03 +02:00
Lubomir Rintel ab73a3a118 Update to NetworkManager 1.4.0 release 2016-08-24 21:18:49 +02:00
Thomas Haller 26675d15eb update spec file with upstream's contrib/rpm 2016-08-11 16:03:54 +02:00
Thomas Haller 0eea3092fc fix stale Wi-Fi after resume from suspend (rh#1362165) 2016-08-11 15:45:03 +02:00
Matthias Clasen d4f66ff72e Actually bump rev 2016-07-21 08:17:44 -04:00
Matthias Clasen 42a976d0d2 Rebuild 2016-07-21 08:15:32 -04:00
Lubomir Rintel 5a338dc86f Add source 2016-07-19 15:21:33 +02:00
Lubomir Rintel aeb4a90471 Update to a later Git snapshot 2016-07-19 15:19:57 +02:00
Thomas Haller 3ce491100f clear cache of dnsmasq when updating DNS configuration (rh#1338731) 2016-06-02 20:55:53 +02:00
Lubomir Rintel 8228d8b507 Update to NetworkManager 1.2.2 release 2016-05-11 15:17:28 +02:00
Thomas Haller 7f9e845bcf spec: update definition of global "snap"
Make it more similar to upstream's spec file from contrib/rpm.
2016-05-06 16:02:35 +02:00
Lubomir Rintel eb0b7592f8 Update to NetworkManager 1.2.0 release 2016-04-20 18:54:07 +02:00
Lubomir Rintel 6405114730 Update to NetworkManager 1.2-rc2 2016-04-14 17:18:41 +02:00
Lubomir Rintel 3983d3a9b8 Fix udev dir 2016-04-06 00:52:55 +02:00
Lubomir Rintel 2880cda73d Drop an useless and evil patch 2016-04-05 23:43:52 +02:00
Lubomir Rintel 04c92a6fe9 Sync the SPEC file from upstream 2016-04-05 23:35:54 +02:00
Lubomir Rintel 1c56626f3d Update to NetworkManager 2016-04-05 23:19:19 +02:00
Lubomir Rintel 2ec678c923 Fix link detection on 4.5 when build with 4.6 kernel 2016-03-30 13:28:21 +02:00
Lubomir Rintel 9093f6263e Update to NetworkManager 1.2-beta3 2016-03-29 17:36:47 +02:00
Lubomir Rintel bb908ed4e4 Fix obtaining the hostname from DNS (rh #1308974) 2016-03-22 10:20:24 +01:00
Dan Williams f561df45ac Fix activating connections in some cases (rh #1316488) 2016-03-17 15:56:07 -05:00
Lubomir Rintel de82b42eba If we generate docs then install them 2016-03-17 16:45:53 +01:00
Lubomir Rintel 5dd9e740f5 Update to NetworkManager 1.2-beta2 2016-03-01 17:47:06 +01:00
Thomas Haller 180858e3be core: backport fix for missing braces bug in platform
It's only beta1, but it breaks compilation for rawhide due
to -Werror=misleading-indentation.
2016-02-03 17:08:11 +01:00
Thomas Haller 98b39fff30 spec-file: update spec file and sync with contrib/rpm
Also:

  - no longer install '10-ibft-plugin.conf'

  - updade NetworkManager.conf with content from contrib/rpm
2016-02-03 17:08:11 +01:00
Dennis Gilmore 0bf1c597c3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild 2016-02-03 15:31:24 +00:00
Lubomir Rintel 810ab20ff1 Update to NetworkManager 1.2-beta1 2016-01-19 15:36:07 +01:00
David King 13724a4562 Add upstream fix for AP list hash function (#1288867) 2016-01-08 19:48:22 +00:00
Lubomir Rintel b880770c84 Update to a later snapshot
Enables RFC7217 addressing for new IPv6 connections
2015-11-12 14:33:54 +01:00
Lubomir Rintel 205526f8f8 Update to a later snapshot 2015-10-23 15:49:57 +02:00
Lubomir Rintel 90b40e50ba Sync the SPEC file with upstream 2015-10-23 15:43:43 +02:00
Lubomir Rintel ff71c668f4 Sync the SPEC file with upstream 2015-10-09 14:29:50 +02:00
Lubomir Rintel 7e935f32b3 Import a newer 1.2 git snapshot 2015-10-07 18:04:26 +02:00
Lubomir Rintel a57aed4ba3 Drop a couple of uneeded dependencies 2015-09-07 11:00:30 +02:00
Lubomir Rintel cfb1add408 Fix build 2015-09-04 12:51:02 +02:00
Lubomir Rintel a52dff45c7 Fix tests 2015-09-04 12:20:24 +02:00
Lubomir Rintel 802334e303 Just disable the tests for now 2015-09-03 18:44:51 +02:00
Lubomir Rintel 73f1b972fe Actually add the patch 2015-09-03 18:27:06 +02:00
Lubomir Rintel 1dbee5b66e Fix the tests 2015-09-03 18:22:54 +02:00
Lubomir Rintel 4ce1d89c98 Add missing postun to libnm
Makes rpmlint happy.
2015-09-03 17:51:46 +02:00
Lubomir Rintel f0b1252d42 Wimax is gone for good 2015-09-03 17:51:46 +02:00
Lubomir Rintel 24c657222a Use global instead of define
Makes package guidelines happy.
2015-09-03 17:51:46 +02:00
Lubomir Rintel 21cb2c5c51 Modernize the SPEC file a bit
Remove obsolete sections, use more modern tags.
2015-09-03 17:51:46 +02:00
Lubomir Rintel 2fd3f595f9 Use macros consistently
%__* macros are internal to RPM and not supposed to be used in SPEC files.
Moreover, we're inconsistent at times already (%__mkdir_p vs. mkdir -p).
2015-09-03 17:51:46 +02:00
Lubomir Rintel 2caedee556 Pull in 1.2 snapshot
Sync SPEC with contrib/rpm
2015-09-03 17:51:46 +02:00
Lubomir Rintel 4e5d69edc4 Bump release 2015-08-28 13:37:01 +02:00
Lubomir Rintel b6e54e7865 Fix command line parsing 2015-08-28 13:36:31 +02:00
Lubomir Rintel c4ef9cfc18 Update to 1.0.6 2015-08-27 18:56:02 +02:00
Thomas Haller 5af6ac65a3 fix crash on device deactivate (rh 1253949)
Also:
  - backport new wifi scan options from nm-1-0 upstream branch.
  - update the URI for connectivty checking
2015-08-18 11:59:43 +02:00
Lubomir Rintel 82c263b833 Fix up a bad merge 2015-08-13 17:19:29 +02:00
Lubomir Rintel 5cf28a408a Merge branch 'master' into f22 2015-08-13 17:11:55 +02:00
Lubomir Rintel 0fc556a450 Update to a Git snapshot
...so that we have a fresh build for the test day.
2015-08-13 17:09:50 +02:00
Lubomir Rintel a7a867bbd9 Add a missing patch 2015-07-22 16:09:36 +02:00
Lubomir Rintel b8517196f9 Add a missing patch 2015-07-22 16:09:10 +02:00
Lubomir Rintel 17428f13c9 Fix default route handling on assumed connections (rh #1245648) 2015-07-22 16:07:26 +02:00
Lubomir Rintel 7c6d783d88 Fix an assertion failure in nmcli (rh #1244048) 2015-07-22 16:07:17 +02:00
Lubomir Rintel 5b0295533e Include the correct patch 2015-07-22 16:05:36 +02:00
Lubomir Rintel bf1633d033 Fix default route handling on assumed connections (rh #1245648) 2015-07-22 15:59:50 +02:00
Lubomir Rintel 5088926494 Fix an assertion failure in nmcli (rh #1244048) 2015-07-22 15:56:35 +02:00
Lubomir Rintel 802930598f Update to 1.0.4 release 2015-07-14 19:01:23 +02:00
Lubomir Rintel 0431b736fd Update to 1.0.4 release 2015-07-14 19:00:19 +02:00
Dan Horák fc0d89fb1a - WEXT depends on enabled wifi 2015-07-14 09:18:19 +02:00
Dan Horák bc5d9f2871 - WEXT depends on enabled wifi 2015-07-14 09:17:43 +02:00
Lubomir Rintel 48b6e780a3 A bit more recent Git snapshot 2015-07-13 19:39:02 +02:00
Lubomir Rintel f37fc20755 A bit more recent Git snapshot 2015-07-13 19:37:54 +02:00
Jiří Klimeš 394c4da0c3 spec: update path to trusted CA store to /etc/pki/tls/cert.pem (rh #1236548)
The code change dealing with it will be pushed to dist-git later with 1.0.4 release
(or new snapshot).

(cherry picked from commit 59e92f03e8)
2015-07-08 18:09:10 +02:00
Jiří Klimeš 59e92f03e8 spec: update path to trusted CA store to /etc/pki/tls/cert.pem (rh #1236548)
The code change dealing with it will be pushed to dist-git later with 1.0.4 release
(or new snapshot).
2015-07-08 18:03:57 +02:00
Lubomir Rintel 7a7741e087 Merge branch 'master' into f22 2015-07-07 18:04:45 +02:00
Lubomir Rintel 8beaf4caca A bit more recent Git snapshot
This one fixes a regression with default route management
2015-07-07 17:58:29 +02:00
Jiří Klimeš e33e672fc2 Update to a new 1.0.3 development snapshot (git20150707) 2015-07-07 09:58:19 +02:00
Jiří Klimeš c4c14e098a Update to a new 1.0.3 development snapshot (git20150707) 2015-07-07 09:05:31 +02:00
Lubomir Rintel 7b87670b2e A bit more recent Git snapshot 2015-06-24 18:44:24 +02:00
Lubomir Rintel 5bbc03fec6 Import a more recent 1.0 snapshot
Something reasonably close to this will hopefully make it into upstream 1.0.4
release. Let's see if it works well enough.
2015-06-18 22:53:53 +02:00
Dennis Gilmore 77a7723ef2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild 2015-06-16 22:58:33 +00:00
Lubomir Rintel 8b1516571d Merge branch 'f22' 2015-05-05 14:48:38 +02:00
Lubomir Rintel 46c1d97ea6 Update to 1.0.2 release 2015-05-05 14:35:22 +02:00
Jiří Klimeš 8232e9c632 Update to 1.0.2 development snapshot (git20150429) 2015-04-29 14:44:50 +02:00
Jiří Klimeš 87260524cc platform: use driver name to detect IBM z-System CTC devices (rh #1212118)
https://bugzilla.redhat.com/show_bug.cgi?id=1212118
2015-04-29 13:38:32 +02:00
Dan Williams 2a59fdf6e4 Turn off keepalive for connectivity checking 2015-03-16 10:59:22 -05:00
Dan Williams 7f0cf671db Update to 1.0.2 development snapshot 2015-03-05 11:43:10 -06:00
Dan Williams ee316b279f dns: revert resolv.conf symlink stuff (should only be in F23+, not F22) 2015-03-05 08:54:01 -06:00
Dan Williams dda57934f7 connectivity: fix checking when no valid DNS servers are present (rh #1199098) 2015-03-05 08:07:30 -06:00
Dan Williams 093d623156 core: flush IPv6LL address when deconfiguring managed devices (rh #1193127) (rh #1184997) 2015-03-04 17:51:36 -06:00
Adam Williamson de0318f42b core: resume bridged connections properly (rh #1162636) 2015-01-29 14:37:46 -08:00
Thomas Haller 4fc11861c4 dns: manage resolv.conf as symlink to private file in /run directory (rh #1116999) 2015-01-21 17:52:10 +01:00
Thomas Haller 452c0cf3c6 remove obsolete makerepo.gitignore file 2015-01-21 13:48:10 +01:00
Dan Winship b2e230bb1a sync spec file with RHEL version
build: fix NetworkManager-bluetooth dep on NetworkManager-wwan
build: re-enable hardware plugins on s390
2015-01-09 11:29:05 -05:00
Dan Williams a13136f87b Whitespace fix 2014-12-22 11:17:50 -06:00
Dan Williams f249abd921 Update to 1.0 2014-12-22 10:47:26 -06:00
Jiří Klimeš 8b454ba75e Fix two incorrect assertion bugs causing NetworkManager crashes 2014-11-24 17:32:36 +01:00
Jiří Klimeš 2c85ca4d0d cli: fix crash in `nmcli device wifi` with multiple wifi devices (rh #1159408)
https://bugzilla.redhat.com/show_bug.cgi?id=1159408
2014-11-06 10:55:04 +01:00
Dan Winship ae5363f941 platform: fix a routing-related bug that could cause NM and other apps to spin (rh #1151665) 2014-11-01 23:05:35 +01:00
Lubomir Rintel 9cbebd1da6 Fix a typo 2014-10-29 12:19:04 +01:00
Lubomir Rintel 301c10dd77 Fix IPv6 next hop default setting 2014-10-29 12:15:04 +01:00
Lubomir Rintel b55f63aee8 Avoid unowned /etc/NetworkManager in config-connectivity-fedora 2014-10-24 18:56:13 +02:00
Adam Williamson bf3b3a8a46 connectivity-fedora: don't require NetworkManager (#1156198) 2014-10-24 18:56:13 +02:00
Jiří Klimeš b2c2088992 Do not override configuration files on updates (rh #1153901)
Rather leave modified configuration files untouched and save the new files
with .rpmnew suffix.

http://stackoverflow.com/questions/14511334/rpm-upgrade-handling-of-config-files

https://bugzilla.redhat.com/show_bug.cgi?id=1153901
2014-10-21 15:29:07 +02:00
Lubomir Rintel d22bbaaa17 bluetooth: Restore DUN support (rh #1055628) 2014-10-16 14:27:07 +02:00
Stef Walter 92d4bfc879 Allow non-local users network control after PolicyKit authentication (rh #1145646) 2014-10-16 14:27:07 +02:00
Jiří Klimeš 8890459ab6 connectivity: use HTTPS for connectivity checking (rh #113577)
https://bugzilla.redhat.com/show_bug.cgi?id=1135777
2014-09-06 00:09:24 +02:00
Peter Robinson cbce54a480 adsl plugin needs rp-pppoe to work otherwise you get these errors and the ADSL link doesn't come up
Jan 01 01:21:47 localhost NetworkManager[3128]: <info> Activation (eth1) starting connection 'pppoe-isp'
Jan 01 01:21:48 localhost NetworkManager[3128]: <warn> (eth1): PPPoE failed to start: Could not find pppoe binary.
Jan 01 01:21:48 localhost NetworkManager[3128]: <info> Disabling autoconnect for connection 'pppoe-isp'.
Jan 01 01:21:48 localhost NetworkManager[3128]: <warn> Activation (eth1) failed for connection 'pppoe-isp'
2014-08-30 18:57:43 +01:00
Dan Horák 6637d9e75b - always include ModemManager-glib-devel (#1129632) 2014-08-18 17:09:49 +02:00
Peter Robinson c4d68f6c20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild 2014-08-15 18:49:00 +00:00
Kalev Lember a66b4def38 Rebuilt for ppp 2.4.7 2014-08-11 18:49:52 +02:00
Dan Williams 05a1e014e2 connectivity: ensure interval is set to enable connectivity checking (rh #1123772)
Patch by Elad Alfassa <el.il@doom.co.il>
2014-07-30 08:46:59 -05:00
Kalev Lember 2d43347aad Rebuilt for gobject-introspection 1.41.4 2014-07-22 20:13:59 +02:00
Thomas Haller 3f9b32f187 Update to upstream 0.9.10.0 release snapshot
I took the official upstream build and recompressed it with bzip2.
66a88346bb04d4f402540281181340313b2ec433e75aa9d9ea13f31697f9487e NetworkManager-0.9.10.0.tar.xz
2014-07-04 15:40:40 +02:00
Thomas Haller 672348a955 update spec file to make ppp_version dependent on fedora version
This way we can build rawhide packages against F20.

To build master on F20, you need to specify --dist
  fedpkg --dist f20 local
2014-07-04 14:04:47 +02:00
Dan Williams 11e58160ed add new NetworkManager-config-connectivity-fedora RPM
Adds defaults for using Fedora servers for connectivity checking.
2014-07-04 11:57:50 +02:00
Thomas Haller 5053e90cec update .gitignore file and remove makerepo.sh script
Use instead the newest version of the makerepo.sh script from upstream.
2014-07-04 10:23:19 +02:00
Thomas Haller f285c1502b Update to upstream 0.9.9.98 (0.9.10-rc1) release snapshot
I took the official upstream build and recompressed it with bzip2.
f5f859ad76bd8cf32d866a6c2b9504f9bc89d8a317ca51939a45949a6a312513 NetworkManager-0.9.9.98.tar.xz
2014-06-25 18:40:30 +02:00
Thomas Haller 41a1662e75 update spec file to make it more similar to the upstream contrib spec file
also fix --with-teamdctl
2014-06-25 18:33:36 +02:00
Dan Williams e09ac81902 Update to upstream 0.9.9.95 (0.9.10-beta1) release snapshot 2014-06-09 11:09:28 -05:00
Dennis Gilmore bdaabccf5c - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild 2014-06-06 17:52:38 -05:00
Jiří Klimeš dd37ad8fc1 Own some missing directories (rh #1099789)
https://bugzilla.redhat.com/show_bug.cgi?id=1099789

Based on a hint from jpopelka@redhat.com
2014-05-21 16:05:55 +02:00
Dan Williams 3f6d3ea213 Rebuild against ppp 2.4.6 2014-04-11 11:17:43 -05:00
Dan Winship 74e11b0e43 Update snapshot, rename two plugins
- Update to a git snapshot (git20140319 git:3980806)
- Rename NetworkManager-atm package to NetworkManager-adsl
- Rename NetworkManager-bt package to NetworkManager-bluetooth
2014-03-19 17:19:35 -04:00
Jiří Klimeš 4815a8a9bc Update to a git snapshot (git20140317 git:1e89b4)
Fixes:
- platform: fix NM crash if link has no name (e.g. for failed VPN connection)
- libnm-util/cli: fix bridge priority default value (rh #1073664)
2014-03-17 14:46:19 +01:00
Jiří Klimeš 251fa91d5d Update to a git snapshot (git20140314 git:45a326d) and fix Obsoletes
Fix obsoleting and requiring packages due to splitout of -atm, -bt and -wwan.
It is needed so that new packages are installed on update.
2014-03-14 12:46:04 +01:00
Jiří Klimeš a36fa77d88 Install new plugins as separate packages
NetworkManager-atm  - libnm-device-plugin-atm.so
NetworkManager-bt   - libnm-device-plugin-bt.so
NetworkManager-wwan - libnm-device-plugin-wwan.so, libnm-wwan.so

Upstream commit:
c1a064b merge: move ATM, Bluetooth, and WWAN into device plugins (bgo #724324)
2014-03-10 17:04:54 +01:00
Jiří Klimeš b18c4ca63f Update to a git snapshot (git20140310 git:350b6d6) 2014-03-10 16:10:39 +01:00
Thomas Haller b749848e40 update to snapshot from new development release 0.9.9.1 2014-02-28 14:53:00 +01:00
Thomas Haller 691505aed9 bugfix caching of libnl objects (caused error with new libnl3 version when activating bridges) (rh #1063290)
and cherry-pick diverse other patches from upstream.
2014-02-22 00:00:40 +01:00
Thomas Haller 13de8b49e8 make spec file similar to NetworkManager.spec from automation branch
upstream branch automation contains a template spec file that is supposed
to work for all kind of RHEL and Fedora versions. Make the spec file of
rawhide similar to that one, so that it's easier to compare them.
2014-02-22 00:00:40 +01:00
Thomas Haller fdc10f83b5 cleanup *spec file and add nmtui package
Make the spec file more similar to the one from f20.
2014-02-22 00:00:40 +01:00
Thomas Haller 8166579897 update makerepo.sh script 2014-02-22 00:00:40 +01:00
Thomas Haller 9ab3949bca Fix crash in libnm-glib getting secrets 2014-02-02 11:37:02 +01:00
Thomas Haller 8db2aec80d rename patch file (to order them) 2014-02-02 11:26:55 +01:00
Thomas Haller e5c57c6bae add makerepo.sh script 2014-02-02 11:17:11 +01:00
Jiří Klimeš 4ec14888d4 Update to a git snapshot (git20140131) 2014-01-31 11:34:12 +01:00
Jiří Klimeš 1ceac5a09d Update to a git snapshot (git20140117) 2014-01-17 09:28:43 +01:00
Jiří Klimeš 143c9f6955 Remove old patches 2014-01-15 10:26:47 +01:00
Jiří Klimeš 85e37a3d52 Update to a git snapshot (git20140114) 2014-01-14 18:24:46 +01:00
33 changed files with 2182 additions and 4253 deletions

135
.gitignore vendored
View File

@ -1,3 +1,4 @@
*.makerepo-split.*
network-manager-applet-0.6.5.tar.bz2
NetworkManager-0.6.5.tar.bz2
NetworkManager-0.7.0.svn2736.tar.gz
@ -296,3 +297,137 @@ network-manager-applet-0.8.1.tar.bz2
/NetworkManager-0.9.9.0.git20130913.tar.bz2
/NetworkManager-0.9.9.0.git20131001.tar.bz2
/NetworkManager-0.9.9.0.git20131003.tar.bz2
/NetworkManager-0.9.9.0.git20140114.4dd6ab8.tar.bz2
/NetworkManager-0.9.9.0.git20140117.94c2993.tar.bz2
/NetworkManager-0.9.9.0.git20140131.5d6a5f8.tar.bz2
/NetworkManager-0.9.9.1.git20140228.16bbc90.tar.bz2
/NetworkManager-0.9.9.1.git20140310.350b6d6.tar.bz2
/NetworkManager-0.9.9.1.git20140314.45a326d.tar.bz2
/NetworkManager-0.9.9.1.git20140317.a1e89b4.tar.bz2
/NetworkManager-0.9.9.1.git20140319.3980806.tar.bz2
/NetworkManager-0.9.9.95.git20140609.1963adda.tar.bz2
/NetworkManager-0.9.9.98.git20140620.63b0a2f5.tar.bz2
/NetworkManager-0.9.10.0.git20140704.6eb82acd.tar.bz2
/NetworkManager-1.0.0.tar.xz
/NetworkManager-1.0.1.git20150305.2a72527c.tar.bz2
/NetworkManager-1.0.1.git20150429.a658561.tar.bz2
/NetworkManager-1.0.2.tar.xz
/NetworkManager-1.0.3.tar.bz2
/NetworkManager-1.0.3.git20160624.f245b49a.tar.bz2
/NetworkManager-1.0.3.git20150707.cf15f2a.tar.bz2
/NetworkManager-1.0.3.git20150707.e3bd4e1.tar.bz2
/NetworkManager-1.0.4.git20150713.38bf2cb0.tar.bz2
/NetworkManager-1.0.4.tar.xz
/NetworkManager-1.0.6.tar.xz
/NetworkManager-1.2.0.tar.xz
/NetworkManager-1.1.90.tar.xz
/NetworkManager-1.1.91.tar.xz
/NetworkManager-1.1.92.tar.xz
/NetworkManager-1.1.93.tar.xz
/NetworkManager-1.1.94.tar.xz
/NetworkManager-1.2.2.tar.xz
/NetworkManager-1.3.0.git20160621.072358da.tar.xz
/NetworkManager-1.4.0.tar.xz
/NetworkManager-1.4.2.tar.xz
/NetworkManager-1.5.2.tar.xz
/NetworkManager-1.5.3.tar.xz
/NetworkManager-1.5.90.tar.xz
/NetworkManager-1.6.0.tar.xz
/NetworkManager-1.6.2.tar.xz
/NetworkManager-1.7.2.tar.xz
/NetworkManager-1.7.91.tar.xz
/NetworkManager-1.7.92.tar.xz
/NetworkManager-1.8.0.tar.xz
/NetworkManager-1.8.2.tar.xz
/NetworkManager-1.8.4.tar.xz
/NetworkManager-1.10.2.tar.xz
/NetworkManager-1.10.4.tar.xz
/NetworkManager-1.10.6.tar.xz
/NetworkManager-1.10.8.tar.xz
/NetworkManager-1.11.4.tar.xz
/NetworkManager-1.11.90.tar.xz
/NetworkManager-1.12.0.tar.xz
/NetworkManager-1.12.2.tar.xz
/NetworkManager-1.14.0.tar.xz
/NetworkManager-1.14.2.tar.xz
/NetworkManager-1.14.4.tar.xz
/NetworkManager-1.15.90.tar.xz
/NetworkManager-1.15.91.tar.xz
/NetworkManager-1.16.0.tar.xz
/NetworkManager-1.18.0.tar.xz
/NetworkManager-1.19.2.tar.xz
/NetworkManager-1.19.3.tar.xz
/NetworkManager-1.19.5.tar.xz
/NetworkManager-1.19.90.tar.xz
/NetworkManager-1.20.0.tar.xz
/NetworkManager-1.20.2.tar.xz
/NetworkManager-1.20.4.tar.xz
/NetworkManager-1.21.3.tar.xz
/NetworkManager-1.21.90.tar.xz
/NetworkManager-1.22.0.tar.xz
/NetworkManager-1.22.2.tar.xz
/NetworkManager-1.22.4.tar.xz
/NetworkManager-1.22.6.tar.xz
/NetworkManager-1.22.8.tar.xz
/NetworkManager-1.22.10.tar.xz
/NetworkManager-1.23.90.tar.xz
/NetworkManager-1.23.91.tar.xz
/NetworkManager-1.24.0.tar.xz
/NetworkManager-1.24.2.tar.xz
/NetworkManager-1.25.90.tar.xz
/NetworkManager-1.26.0.tar.xz
/NetworkManager-1.26.2.tar.xz
/NetworkManager-1.27.90.tar.xz
/NetworkManager-1.27.91.tar.xz
/NetworkManager-1.28.0.tar.xz
/NetworkManager-1.29.8.tar.xz
/NetworkManager-1.29.9.tar.xz
/NetworkManager-1.29.11.tar.xz
/NetworkManager-1.29.90.tar.xz
/NetworkManager-1.30.0.tar.xz
/NetworkManager-1.30.2.tar.xz
/NetworkManager-1.31.2.tar.xz
/NetworkManager-1.31.3.tar.xz
/NetworkManager-1.31.4.tar.xz
/NetworkManager-1.31.90.tar.xz
/NetworkManager-1.32.0.tar.xz
/NetworkManager-1.32.4.tar.xz
/NetworkManager-1.32.6.tar.xz
/NetworkManager-1.32.8.tar.xz
/NetworkManager-1.32.10.tar.xz
/NetworkManager-1.32.12.tar.xz
/NetworkManager-1.35.1.tar.xz
/NetworkManager-1.35.2.tar.xz
/NetworkManager-1.35.3.tar.xz
/NetworkManager-1.35.4.tar.xz
/NetworkManager-1.35.6.tar.xz
/NetworkManager-1.35.7.tar.xz
/NetworkManager-1.35.90.tar.xz
/NetworkManager-1.35.91.tar.xz
/NetworkManager-1.35.92.tar.xz
/NetworkManager-1.36.0.tar.xz
/NetworkManager-1.36.2.tar.xz
/NetworkManager-1.36.4.tar.xz
/NetworkManager-1.37.3.tar.xz
/NetworkManager-1.37.90.tar.xz
/NetworkManager-1.37.91.tar.xz
/NetworkManager-1.37.92.tar.xz
/NetworkManager-1.38.0.tar.xz
/NetworkManager-1.39.8.tar.xz
/NetworkManager-1.39.10.tar.xz
/NetworkManager-1.39.11.tar.xz
/NetworkManager-1.39.90.tar.xz
/NetworkManager-1.40.0.tar.xz
/NetworkManager-1.41.3.tar.xz
/NetworkManager-1.41.4.tar.xz
/NetworkManager-1.41.5.tar.xz
/NetworkManager-1.41.6.tar.xz
/NetworkManager-1.41.7.tar.xz
/NetworkManager-1.41.8.tar.xz
/NetworkManager-1.41.90.tar.xz
/NetworkManager-1.41.91.tar.xz
/NetworkManager-1.42.0.tar.xz
/NetworkManager-1.43.3.tar.xz
/NetworkManager-1.43.4.tar.xz
/NetworkManager-1.43.5.tar.xz
/NetworkManager-1.43.6.tar.xz

View File

@ -1,14 +1,8 @@
# This configuration file, when placed into into
# /etc/NetworkManager/conf.d changes NetworkManager's behavior to
# This configuration file changes NetworkManager's behavior to
# what's expected on "traditional UNIX server" type deployments.
#
# See "man NetworkManager.conf" for more information about these
# and other keys.
#
# Do not edit this file; it will be overwritten on upgrades. If you
# want to override the values here, or set additional values, you can
# do so by adding another file (eg, "99-local.conf") to this directory
# and setting keys there.
[main]
# Do not do automatic (DHCP/SLAAC) configuration on ethernet devices

View File

@ -0,0 +1,10 @@
# Enable connectivity checking for NetworkManager.
# See `man NetworkManager.conf`.
#
# Note that connectivity checking works badly with rp_filter set to
# strict. Check "/proc/sys/net/ipv4/conf/*/rp_filter".
[connectivity]
enabled=true
uri=http://fedoraproject.org/static/hotspot.txt
response=OK
interval=300

View File

@ -0,0 +1,10 @@
# Enable connectivity checking for NetworkManager.
# See `man NetworkManager.conf`.
#
# Note that connectivity checking works badly with rp_filter set to
# strict. Check "/proc/sys/net/ipv4/conf/*/rp_filter".
[connectivity]
enabled=true
uri=http://static.redhat.com/test/rhel-networkmanager.txt
response=OK
interval=300

15
70-nm-connectivity.conf Normal file
View File

@ -0,0 +1,15 @@
# The Strict mode of RFC3704 Reverse Path filtering breaks some pretty
# common and reasonable use cases.
#
# Notably, it makes it impossible for NetworkManager to do connectivity
# check on a newly arriving default route (it starts with a higher metric
# and is bumped lower if there's connectivity).
#
# Kernel's default is 0 (no filter), systemd configures a Loose filter since
# commit 230450d4e4f1 ('sysctl.d: switch net.ipv4.conf.all.rp_filter from 1
# to 2'). However, RHEL systemd package happens to default to Strict mode
# for historic reasons. Let's override it if we're doing connectivity
# checking.
# Source route verification
net.ipv4.conf.all.rp_filter = 0

View File

@ -1,2 +1,52 @@
# Configuration file for NetworkManager.
#
# See "man 5 NetworkManager.conf" for details.
#
# The directories /usr/lib/NetworkManager/conf.d/ and /run/NetworkManager/conf.d/
# can contain additional .conf snippets installed by packages. These files are
# read before NetworkManager.conf and have thus lowest priority.
# The directory /etc/NetworkManager/conf.d/ can contain additional .conf
# snippets. Those snippets are merged last and overwrite the settings from this main
# file.
#
# The files within one conf.d/ directory are read in asciibetical order.
#
# You can prevent loading a file /usr/lib/NetworkManager/conf.d/NAME.conf
# by having a file NAME.conf in either /run/NetworkManager/conf.d/ or /etc/NetworkManager/conf.d/.
# Likewise, snippets from /run can be prevented from loading by placing
# a file with the same name in /etc/NetworkManager/conf.d/.
#
# If two files define the same key, the one that is read afterwards will overwrite
# the previous one.
[main]
plugins=ifcfg-rh
#plugins=keyfile,ifcfg-rh
[logging]
# When debugging NetworkManager, enabling debug logging is of great help.
#
# Logfiles contain no passwords and little sensitive information. But please
# check before posting the file online. You can also personally hand over the
# logfile to a NM developer to treat it confidential. Meet us on #nm on Libera.Chat.
#
# You can also change the log-level at runtime via
# $ nmcli general logging level TRACE domains ALL
# However, usually it's cleaner to enable debug logging
# in the configuration and restart NetworkManager so that
# debug logging is enabled from the start.
#
# You will find the logfiles in syslog, for example via
# $ journalctl -u NetworkManager
#
# Please post full logfiles for bug reports without pre-filtering or truncation.
# Also, for debugging the entire `journalctl` output can be interesting. Don't
# limit unnecessarily with `journalctl -u`. Exceptions are if you are worried
# about private data. Check before posting logfiles!
#
# Note that debug logging of NetworkManager can be quite verbose. Some messages
# might be rate-limited by the logging daemon (see RateLimitIntervalSec, RateLimitBurst
# in man journald.conf). Please disable rate-limiting before collecting debug logs!
#
#level=TRACE
#domains=ALL

File diff suppressed because it is too large Load Diff

View File

@ -1,27 +0,0 @@
diff -up NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c.explain-dns1-dns2 NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c
--- NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c.explain-dns1-dns2 2010-10-18 18:44:05.000000000 -0500
+++ NetworkManager-0.8.2/src/dns-manager/nm-dns-manager.c 2010-11-03 13:51:56.614584001 -0500
@@ -358,7 +358,7 @@ write_resolv_conf (FILE *f, const char *
str = g_string_new ("");
- if (nameservers) {
+ if (nameservers && g_strv_length (nameservers)) {
int num = g_strv_length (nameservers);
for (i = 0; i < num; i++) {
@@ -374,6 +374,14 @@ write_resolv_conf (FILE *f, const char *
g_string_append (str, nameservers[i]);
g_string_append_c (str, '\n');
}
+ } else {
+ g_string_append_printf (str, "\n\n%s%s%s%s%s%s",
+ "# No nameservers found; try putting DNS servers into your\n",
+ "# ifcfg files in /etc/sysconfig/network-scripts like so:\n",
+ "#\n",
+ "# DNS1=xxx.xxx.xxx.xxx\n",
+ "# DNS2=xxx.xxx.xxx.xxx\n",
+ "# DOMAIN=lab.foo.com bar.foo.com\n");
}
nameservers_str = g_string_free (str, FALSE);

View File

@ -1,53 +0,0 @@
From 87041545b40fd0c0cfae16a8e605552b7715dc15 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Fri, 4 Oct 2013 23:38:31 -0500
Subject: [PATCH] ifcfg-rh: fix ignoring updates that don't change anything
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
connection_from_file() requires the 'error' parameter. Not passing a
valid 'error' parameter causes the function to fail and return NULL,
which mean that commit_changes() would always re-write the connection
instead of ignoring commits where nothing has actually changed.
connection_from_file() no longer requires the unmanaged, keyfile,
or routefile parameters, so remove them.
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c
index 3788149..d3b93c9 100644
--- a/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c
+++ b/src/settings/plugins/ifcfg-rh/nm-ifcfg-connection.c
@@ -246,7 +246,6 @@ commit_changes (NMSettingsConnection *connection,
NMIfcfgConnectionPrivate *priv = NM_IFCFG_CONNECTION_GET_PRIVATE (connection);
GError *error = NULL;
NMConnection *reread;
- char *unmanaged = NULL, *keyfile = NULL, *routefile = NULL, *route6file = NULL;
gboolean same = FALSE, success = FALSE;
char *ifcfg_path = NULL;
@@ -256,13 +255,9 @@ commit_changes (NMSettingsConnection *connection,
*/
if (priv->path) {
reread = connection_from_file (priv->path, NULL, NULL, NULL,
- &unmanaged, &keyfile, &routefile, &route6file,
- NULL, NULL);
- g_free (unmanaged);
- g_free (keyfile);
- g_free (routefile);
- g_free (route6file);
-
+ NULL, NULL, NULL, NULL,
+ &error, NULL);
+ g_clear_error (&error);
if (reread) {
same = nm_connection_compare (NM_CONNECTION (connection),
reread,
--
1.7.11.7

View File

@ -1,492 +0,0 @@
diff -up NetworkManager-0.9.9.0/cli/completion/nmcli.nmcli-con-load NetworkManager-0.9.9.0/cli/completion/nmcli
--- NetworkManager-0.9.9.0/cli/completion/nmcli.nmcli-con-load 2013-10-03 14:14:44.000000000 -0400
+++ NetworkManager-0.9.9.0/cli/completion/nmcli 2013-11-18 11:02:56.187304537 -0500
@@ -833,6 +833,12 @@ _nmcli()
_nmcli_complete_COMMAND_CONNECTION
fi
;;
+ l|lo|loa|load)
+ if [[ ${#words[@]} -gt 2 ]]; then
+ compopt -o default
+ COMPREPLY=()
+ fi
+ ;;
esac
fi
;;
diff -up NetworkManager-0.9.9.0/cli/src/connections.c.nmcli-con-load NetworkManager-0.9.9.0/cli/src/connections.c
--- NetworkManager-0.9.9.0/cli/src/connections.c.nmcli-con-load 2013-10-03 15:00:47.000000000 -0400
+++ NetworkManager-0.9.9.0/cli/src/connections.c 2013-11-18 11:02:56.188304537 -0500
@@ -222,7 +222,8 @@ usage (void)
" modify [ id | uuid | path ] <ID> <setting>.<property> <value>\n\n"
" edit [ id | uuid | path ] <ID> | [type <new_con_type>] [con-name <new_con_name>]\n\n"
" delete [ id | uuid | path ] <ID>\n\n"
- " reload\n\n\n"
+ " reload\n\n"
+ " load <filename> [ <filename>... ]\n\n\n"
));
}
@@ -308,6 +309,7 @@ static const char *real_con_commands[] =
"edit",
"delete",
"reload",
+ "load",
NULL
};
@@ -7006,6 +7008,50 @@ do_connection_reload (NmCli *nmc, int ar
return nmc->return_value;
}
+static NMCResultCode
+do_connection_load (NmCli *nmc, int argc, char **argv)
+{
+ GError *error = NULL;
+ char **filenames, **failures = NULL;
+ int i;
+
+ nmc->return_value = NMC_RESULT_SUCCESS;
+ nmc->should_wait = FALSE;
+
+ if (!nm_client_get_manager_running (nmc->client)) {
+ g_string_printf (nmc->return_text, _("Error: NetworkManager is not running."));
+ nmc->return_value = NMC_RESULT_ERROR_NM_NOT_RUNNING;
+ return nmc->return_value;
+ }
+
+ if (argc == 0) {
+ g_string_printf (nmc->return_text, _("Error: No connection specified."));
+ nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
+ return nmc->return_value;
+ }
+
+ filenames = g_new (char *, argc + 1);
+ for (i = 0; i < argc; i++)
+ filenames[i] = argv[i];
+ filenames[i] = NULL;
+
+ nm_remote_settings_load_connections (nmc->system_settings, filenames, &failures, &error);
+ g_free (filenames);
+ if (error) {
+ g_string_printf (nmc->return_text, _("Error: %s."), error->message);
+ nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
+ g_error_free (error);
+ }
+
+ if (failures) {
+ for (i = 0; failures[i]; i++)
+ fprintf (stderr, _("Could not load file '%s'\n"), failures[i]);
+ g_strfreev (failures);
+ }
+
+ return nmc->return_value;
+}
+
typedef struct {
NmCli *nmc;
@@ -7087,6 +7133,9 @@ parse_cmd (NmCli *nmc, int argc, char **
else if (matches(*argv, "reload") == 0) {
nmc->return_value = do_connection_reload (nmc, argc-1, argv+1);
}
+ else if (matches(*argv, "load") == 0) {
+ nmc->return_value = do_connection_load (nmc, argc-1, argv+1);
+ }
else if (matches (*argv, "modify") == 0) {
nmc->return_value = do_connection_modify (nmc, argc-1, argv+1);
}
diff -up NetworkManager-0.9.9.0/introspection/nm-settings.xml.nmcli-con-load NetworkManager-0.9.9.0/introspection/nm-settings.xml
--- NetworkManager-0.9.9.0/introspection/nm-settings.xml.nmcli-con-load 2013-09-27 23:40:17.000000000 -0400
+++ NetworkManager-0.9.9.0/introspection/nm-settings.xml 2013-11-18 11:02:56.188304537 -0500
@@ -82,6 +82,40 @@
</arg>
</method>
+ <method name="LoadConnections">
+ <tp:docstring>
+ Loads or reloads the indicated connections from disk. You
+ should call this after making changes directly to an on-disk
+ connection file to make sure that NetworkManager sees the
+ changes. (If "monitor-connection-files" in NetworkManager.conf
+ is "true", then this will have no real effect, but is
+ harmless.) As with AddConnection(), this operation does not
+ necessarily start the network connection.
+ </tp:docstring>
+ <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_settings_load_connections"/>
+ <annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
+ <arg name="filenames" type="as" direction="in">
+ <tp:docstring>
+ Array of paths to on-disk connection profiles in directories
+ monitored by NetworkManager.
+ </tp:docstring>
+ </arg>
+ <arg name="status" type="b" direction="out">
+ <tp:docstring>
+ Success or failure of the operation as a whole. True if
+ NetworkManager at least tried to load the indicated
+ connections, even if it did not succeed. False if an error
+ occurred before trying to load the connections (eg,
+ permission denied).
+ </tp:docstring>
+ </arg>
+ <arg name="failures" type="as" direction="out">
+ <tp:docstring>
+ Paths of connection files that could not be loaded.
+ </tp:docstring>
+ </arg>
+ </method>
+
<method name="ReloadConnections">
<tp:docstring>
Tells NetworkManager to reload all connection files from disk,
diff -up NetworkManager-0.9.9.0/libnm-glib/libnm-glib.ver.nmcli-con-load NetworkManager-0.9.9.0/libnm-glib/libnm-glib.ver
--- NetworkManager-0.9.9.0/libnm-glib/libnm-glib.ver.nmcli-con-load 2013-10-01 14:43:57.000000000 -0400
+++ NetworkManager-0.9.9.0/libnm-glib/libnm-glib.ver 2013-11-18 11:02:56.188304537 -0500
@@ -243,6 +243,7 @@ global:
nm_remote_settings_get_connection_by_uuid;
nm_remote_settings_get_type;
nm_remote_settings_list_connections;
+ nm_remote_settings_load_connections;
nm_remote_settings_new;
nm_remote_settings_new_async;
nm_remote_settings_new_finish;
diff -up NetworkManager-0.9.9.0/libnm-glib/nm-remote-settings.c.nmcli-con-load NetworkManager-0.9.9.0/libnm-glib/nm-remote-settings.c
--- NetworkManager-0.9.9.0/libnm-glib/nm-remote-settings.c.nmcli-con-load 2013-09-27 23:40:17.000000000 -0400
+++ NetworkManager-0.9.9.0/libnm-glib/nm-remote-settings.c 2013-11-18 11:02:56.188304537 -0500
@@ -630,6 +630,72 @@ nm_remote_settings_add_connection_unsave
}
/**
+ * nm_remote_settings_load_connections:
+ * @settings: the %NMRemoteSettings
+ * @filenames: %NULL-terminated array of filenames to load
+ * @failures: (out) (transfer full): on return, a %NULL-terminated array of
+ * filenames that failed to load
+ * @error: return location for #GError
+ *
+ * Requests that the remote settings service load or reload the given files,
+ * adding or updating the connections described within.
+ *
+ * The changes to the indicated files will not yet be reflected in
+ * @settings's connections array when the function returns.
+ *
+ * If all of the indicated files were successfully loaded, the
+ * function will return %TRUE, and @failures will be set to %NULL. If
+ * NetworkManager tried to load the files, but some (or all) failed,
+ * then @failures will be set to a %NULL-terminated array of the
+ * filenames that failed to load.
+
+ * Returns: %TRUE if NetworkManager at least tried to load @filenames,
+ * %FALSE if an error occurred (eg, permission denied).
+ *
+ * Since: 0.9.10
+ **/
+gboolean
+nm_remote_settings_load_connections (NMRemoteSettings *settings,
+ char **filenames,
+ char ***failures,
+ GError **error)
+{
+ NMRemoteSettingsPrivate *priv;
+ char **my_failures = NULL;
+ gboolean ret = FALSE;
+
+ g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), NULL);
+ g_return_val_if_fail (filenames != NULL, NULL);
+
+ priv = NM_REMOTE_SETTINGS_GET_PRIVATE (settings);
+
+ _nm_remote_settings_ensure_inited (settings);
+
+ if (!priv->service_running) {
+ g_set_error_literal (error, NM_REMOTE_SETTINGS_ERROR,
+ NM_REMOTE_SETTINGS_ERROR_SERVICE_UNAVAILABLE,
+ "NetworkManager is not running.");
+ return FALSE;
+ }
+
+ dbus_g_proxy_call (priv->proxy, "LoadConnections", error,
+ G_TYPE_STRV, filenames,
+ G_TYPE_INVALID,
+ G_TYPE_BOOLEAN, &ret,
+ G_TYPE_STRV, &my_failures,
+ G_TYPE_INVALID);
+
+ if (failures) {
+ if (my_failures && !*my_failures)
+ g_clear_pointer (&my_failures, g_free);
+ *failures = my_failures;
+ } else
+ g_strfreev (my_failures);
+
+ return ret;
+}
+
+/**
* nm_remote_settings_reload_connections:
* @settings: the #NMRemoteSettings
* @error: return location for #GError
diff -up NetworkManager-0.9.9.0/libnm-glib/nm-remote-settings.h.nmcli-con-load NetworkManager-0.9.9.0/libnm-glib/nm-remote-settings.h
--- NetworkManager-0.9.9.0/libnm-glib/nm-remote-settings.h.nmcli-con-load 2013-09-27 23:40:17.000000000 -0400
+++ NetworkManager-0.9.9.0/libnm-glib/nm-remote-settings.h 2013-11-18 11:02:56.188304537 -0500
@@ -79,6 +79,11 @@ typedef void (*NMRemoteSettingsAddConnec
GError *error,
gpointer user_data);
+typedef void (*NMRemoteSettingsLoadConnectionsFunc) (NMRemoteSettings *settings,
+ char **failures,
+ GError *error,
+ gpointer user_data);
+
typedef void (*NMRemoteSettingsSaveHostnameFunc) (NMRemoteSettings *settings,
GError *error,
gpointer user_data);
@@ -135,6 +140,11 @@ gboolean nm_remote_settings_add_connecti
NMRemoteSettingsAddConnectionFunc callback,
gpointer user_data);
+gboolean nm_remote_settings_load_connections (NMRemoteSettings *settings,
+ char **filenames,
+ char ***failures,
+ GError **error);
+
gboolean nm_remote_settings_reload_connections (NMRemoteSettings *settings,
GError **error);
diff -up NetworkManager-0.9.9.0/src/settings/nm-settings.c.nmcli-con-load NetworkManager-0.9.9.0/src/settings/nm-settings.c
--- NetworkManager-0.9.9.0/src/settings/nm-settings.c.nmcli-con-load 2013-10-01 14:43:57.000000000 -0400
+++ NetworkManager-0.9.9.0/src/settings/nm-settings.c 2013-11-18 11:10:31.800329234 -0500
@@ -104,6 +104,10 @@ static void impl_settings_add_connection
GHashTable *settings,
DBusGMethodInvocation *context);
+static void impl_settings_load_connections (NMSettings *self,
+ char **filenames,
+ DBusGMethodInvocation *context);
+
static void impl_settings_reload_connections (NMSettings *self,
DBusGMethodInvocation *context);
@@ -1226,33 +1230,78 @@ impl_settings_add_connection_unsaved (NM
impl_settings_add_connection_helper (self, settings, FALSE, context);
}
-static void
-impl_settings_reload_connections (NMSettings *self,
- DBusGMethodInvocation *context)
+static gboolean
+ensure_root (NMDBusManager *dbus_mgr,
+ DBusGMethodInvocation *context)
{
- NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self);
- GSList *iter;
gulong caller_uid;
GError *error = NULL;
- if (!nm_dbus_manager_get_caller_info (priv->dbus_mgr, context, NULL, &caller_uid)) {
+ if (!nm_dbus_manager_get_caller_info (dbus_mgr, context, NULL, &caller_uid)) {
error = g_error_new_literal (NM_SETTINGS_ERROR,
- NM_SETTINGS_ERROR_PERMISSION_DENIED,
- "Unable to determine request UID.");
+ NM_SETTINGS_ERROR_PERMISSION_DENIED,
+ "Unable to determine request UID.");
dbus_g_method_return_error (context, error);
g_error_free (error);
- return;
+ return FALSE;
}
if (caller_uid != 0) {
- nm_log_warn (LOGD_SETTINGS, "ReloadConnections: permission denied to %lu", caller_uid);
error = g_error_new_literal (NM_SETTINGS_ERROR,
NM_SETTINGS_ERROR_PERMISSION_DENIED,
"Permission denied");
dbus_g_method_return_error (context, error);
g_error_free (error);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static void
+impl_settings_load_connections (NMSettings *self,
+ char **filenames,
+ DBusGMethodInvocation *context)
+{
+ NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self);
+ GPtrArray *failures;
+ GSList *iter;
+ int i;
+
+ if (!ensure_root (priv->dbus_mgr, context))
return;
+
+ failures = g_ptr_array_new ();
+
+ for (i = 0; filenames[i]; i++) {
+ for (iter = priv->plugins; iter; iter = g_slist_next (iter)) {
+ NMSystemConfigInterface *plugin = NM_SYSTEM_CONFIG_INTERFACE (iter->data);
+
+ if (nm_system_config_interface_load_connection (plugin, filenames[i]))
+ break;
+ }
+
+ if (!iter) {
+ if (!g_path_is_absolute (filenames[i]))
+ nm_log_warn (LOGD_SETTINGS, "Connection filename '%s' is not an absolute path", filenames[i]);
+ g_ptr_array_add (failures, (char *) filenames[i]);
+ }
}
+ g_ptr_array_add (failures, NULL);
+ dbus_g_method_return (context, failures->len == 1, failures->pdata);
+ g_ptr_array_unref (failures);
+}
+
+static void
+impl_settings_reload_connections (NMSettings *self,
+ DBusGMethodInvocation *context)
+{
+ NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self);
+ GSList *iter;
+
+ if (!ensure_root (priv->dbus_mgr, context))
+ return;
+
if (!priv->connections_loaded) {
load_connections (self);
} else {
diff -up NetworkManager-0.9.9.0/src/settings/nm-system-config-interface.c.nmcli-con-load NetworkManager-0.9.9.0/src/settings/nm-system-config-interface.c
--- NetworkManager-0.9.9.0/src/settings/nm-system-config-interface.c.nmcli-con-load 2013-09-27 23:40:17.000000000 -0400
+++ NetworkManager-0.9.9.0/src/settings/nm-system-config-interface.c 2013-11-18 11:02:56.189304537 -0500
@@ -137,6 +137,17 @@ nm_system_config_interface_get_connectio
return NULL;
}
+gboolean
+nm_system_config_interface_load_connection (NMSystemConfigInterface *config,
+ const char *filename)
+{
+ g_return_val_if_fail (config != NULL, NULL);
+
+ if (NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->load_connection)
+ return NM_SYSTEM_CONFIG_INTERFACE_GET_INTERFACE (config)->load_connection (config, filename);
+ return FALSE;
+}
+
void
nm_system_config_interface_reload_connections (NMSystemConfigInterface *config)
{
diff -up NetworkManager-0.9.9.0/src/settings/nm-system-config-interface.h.nmcli-con-load NetworkManager-0.9.9.0/src/settings/nm-system-config-interface.h
--- NetworkManager-0.9.9.0/src/settings/nm-system-config-interface.h.nmcli-con-load 2013-09-27 23:40:17.000000000 -0400
+++ NetworkManager-0.9.9.0/src/settings/nm-system-config-interface.h 2013-11-18 11:02:56.189304537 -0500
@@ -89,6 +89,12 @@ struct _NMSystemConfigInterface {
*/
GSList * (*get_connections) (NMSystemConfigInterface *config);
+ /* Requests that the plugin load/reload a single connection, if it
+ * recognizes the filename. Returns success or failure.
+ */
+ gboolean (*load_connection) (NMSystemConfigInterface *config,
+ const char *filename);
+
/* Requests that the plugin reload all connection files from disk,
* and emit signals reflecting new, changed, and removed connections.
*/
@@ -142,6 +148,8 @@ void nm_system_config_interface_init (NM
GSList *nm_system_config_interface_get_connections (NMSystemConfigInterface *config);
+gboolean nm_system_config_interface_load_connection (NMSystemConfigInterface *config,
+ const char *filename);
void nm_system_config_interface_reload_connections (NMSystemConfigInterface *config);
GSList *nm_system_config_interface_get_unmanaged_specs (NMSystemConfigInterface *config);
diff -up NetworkManager-0.9.9.0/src/settings/plugins/ifcfg-rh/plugin.c.nmcli-con-load NetworkManager-0.9.9.0/src/settings/plugins/ifcfg-rh/plugin.c
--- NetworkManager-0.9.9.0/src/settings/plugins/ifcfg-rh/plugin.c.nmcli-con-load 2013-11-18 11:02:56.177304536 -0500
+++ NetworkManager-0.9.9.0/src/settings/plugins/ifcfg-rh/plugin.c 2013-11-18 11:05:18.187312234 -0500
@@ -500,6 +500,30 @@ get_connections (NMSystemConfigInterface
return list;
}
+static gboolean
+load_connection (NMSystemConfigInterface *config,
+ const char *filename)
+{
+ SCPluginIfcfg *plugin = SC_PLUGIN_IFCFG (config);
+ NMIfcfgConnection *connection;
+ int dir_len = strlen (IFCFG_DIR);
+
+ if ( strncmp (filename, IFCFG_DIR, dir_len) != 0
+ || filename[dir_len] != '/'
+ || strchr (filename + dir_len + 1, '/') != NULL)
+ return FALSE;
+
+ if (utils_should_ignore_file (filename + dir_len + 1, TRUE))
+ return FALSE;
+
+ connection = find_by_path (plugin, filename);
+ connection_new_or_changed (plugin, filename, connection, NULL);
+ if (!connection)
+ connection = find_by_path (plugin, filename);
+
+ return (connection != NULL);
+}
+
static void
reload_connections (NMSystemConfigInterface *config)
{
@@ -939,6 +963,7 @@ system_config_interface_init (NMSystemCo
/* interface implementation */
system_config_interface_class->get_connections = get_connections;
system_config_interface_class->add_connection = add_connection;
+ system_config_interface_class->load_connection = load_connection;
system_config_interface_class->reload_connections = reload_connections;
system_config_interface_class->get_unmanaged_specs = get_unmanaged_specs;
system_config_interface_class->init = init;
diff -up NetworkManager-0.9.9.0/src/settings/plugins/keyfile/plugin.c.nmcli-con-load NetworkManager-0.9.9.0/src/settings/plugins/keyfile/plugin.c
--- NetworkManager-0.9.9.0/src/settings/plugins/keyfile/plugin.c.nmcli-con-load 2013-10-01 14:43:58.000000000 -0400
+++ NetworkManager-0.9.9.0/src/settings/plugins/keyfile/plugin.c 2013-11-18 11:02:56.189304537 -0500
@@ -403,6 +403,33 @@ get_connections (NMSystemConfigInterface
return list;
}
+static gboolean
+load_connection (NMSystemConfigInterface *config,
+ const char *filename)
+{
+ SCPluginKeyfile *self = SC_PLUGIN_KEYFILE (config);
+ NMKeyfileConnection *connection;
+ int dir_len = strlen (KEYFILE_DIR);
+
+ if ( strncmp (filename, KEYFILE_DIR, dir_len) != 0
+ || filename[dir_len] != '/'
+ || strchr (filename + dir_len + 1, '/') != NULL)
+ return FALSE;
+
+ if (nm_keyfile_plugin_utils_should_ignore_file (filename + dir_len + 1))
+ return FALSE;
+
+ connection = find_by_path (self, filename);
+ if (connection)
+ update_connection (self, connection, filename);
+ else {
+ new_connection (self, filename, NULL);
+ connection = find_by_path (self, filename);
+ }
+
+ return (connection != NULL);
+}
+
static void
reload_connections (NMSystemConfigInterface *config)
{
@@ -701,6 +728,7 @@ system_config_interface_init (NMSystemCo
{
/* interface implementation */
system_config_interface_class->get_connections = get_connections;
+ system_config_interface_class->load_connection = load_connection;
system_config_interface_class->reload_connections = reload_connections;
system_config_interface_class->add_connection = add_connection;
system_config_interface_class->get_unmanaged_specs = get_unmanaged_specs;

31
readme-ifcfg-rh.txt Normal file
View File

@ -0,0 +1,31 @@
NetworkManager stores new network profiles in keyfile format in the
/etc/NetworkManager/system-connections/ directory.
Previously, NetworkManager stored network profiles in ifcfg format
in this directory (/etc/sysconfig/network-scripts/). However, the ifcfg
format is deprecated. By default, NetworkManager no longer creates
new profiles in this format.
Connection profiles in keyfile format have many benefits. For example,
this format is INI file-based and can easily be parsed and generated.
Each section in NetworkManager keyfiles corresponds to a NetworkManager
setting name as described in the nm-settings(5) and nm-settings-keyfile(5)
man pages. Each key-value-pair in a section is one of the properties
listed in the settings specification of the man page.
If you still use network profiles in ifcfg format, consider migrating
them to keyfile format. To migrate all profiles at once, enter:
# nmcli connection migrate
This command migrates all profiles from ifcfg format to keyfile
format and stores them in /etc/NetworkManager/system-connections/.
Alternatively, to migrate only a specific profile, enter:
# nmcli connection migrate <profile_name|UUID|D-Bus_path>
For further details, see:
* nm-settings-keyfile(5)
* nmcli(1)

View File

@ -1,27 +0,0 @@
commit 9543e45afe0746ac1c9c10e4f78f43264fd288b4
Author: Dan Williams <dcbw@redhat.com>
Date: Mon Oct 7 11:40:16 2013 -0500
core: allow IPv4 to proceed if IPv6 is globally disabled but set to "auto" (rh #1012151)
If the user disabled IPv6 support in the kernel with "ipv6.disable=1" on the
kernel boot line, then any attempts to open IPv6 sockets (which libndp does)
will fail. This failed the entire connection, even if IPv6's "may-fail"
property was TRUE. Instead, just fail IPv6 and allow IPv4 to proceed. If
IPv4 fails or is disabled, then other logic will fail the entire connection.
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index d99b3d7..6810afc 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -3329,8 +3329,8 @@ act_stage3_ip6_config_start (NMDevice *self,
if ( strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_AUTO) == 0
|| strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_LINK_LOCAL) == 0) {
if (!addrconf6_start (self)) {
- *reason = NM_DEVICE_STATE_REASON_IP_CONFIG_UNAVAILABLE;
- ret = NM_ACT_STAGE_RETURN_FAILURE;
+ /* IPv6 might be disabled; allow IPv4 to proceed */
+ ret = NM_ACT_STAGE_RETURN_STOP;
} else
ret = NM_ACT_STAGE_RETURN_POSTPONE;
} else if (strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_DHCP) == 0) {

View File

@ -1,74 +0,0 @@
From 473018d8b2628ce946cc35db432ac2bc68f6f912 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Wed, 16 Oct 2013 12:29:13 -0500
Subject: [PATCH] platform: detect non-mac80211 WiFi devices as WiFi (rh
#1015598)
Before NMPlatform landed, the old NMManager code looked at either
DEVTYPE=wlan or asked the internal wifi utilities whether the
device was WiFi or not. This got lost when moving to NMPlatform.
It turns out that only mac80211-based drivers set the DEVTYPE=wlan
flag in sysfs, while older WEXT, out-of-tree, and staging drivers
often do not (though they should).
To avoid breaking recognition of these crappy drivers that used
to work, re-add the wifi utils checks.
---
src/platform/nm-linux-platform.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index 0bea01b..82286ec 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -41,14 +41,15 @@
#include <netlink/route/link/vlan.h>
#include <netlink/route/addr.h>
#include <netlink/route/route.h>
#include <gudev/gudev.h>
#include "nm-linux-platform.h"
#include "nm-logging.h"
+#include "wifi/wifi-utils.h"
/* This is only included for the translation of VLAN flags */
#include "nm-setting-vlan.h"
#define debug(...) nm_log_dbg (LOGD_PLATFORM, __VA_ARGS__)
#define warning(...) nm_log_warn (LOGD_PLATFORM, __VA_ARGS__)
#define error(...) nm_log_err (LOGD_PLATFORM, __VA_ARGS__)
@@ -473,26 +474,28 @@ type_to_string (NMLinkType type)
} G_STMT_END
static NMLinkType
link_type_from_udev (NMPlatform *platform, int ifindex, int arptype, const char **out_name)
{
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
GUdevDevice *udev_device;
- const char *prop;
+ const char *prop, *name, *sysfs_path;
udev_device = g_hash_table_lookup (priv->udev_devices, GINT_TO_POINTER (ifindex));
if (!udev_device)
return_type (NM_LINK_TYPE_UNKNOWN, "unknown");
prop = g_udev_device_get_property (udev_device, "ID_NM_OLPC_MESH");
if (prop)
return_type (NM_LINK_TYPE_OLPC_MESH, "olpc-mesh");
prop = g_udev_device_get_property (udev_device, "DEVTYPE");
- if (g_strcmp0 (prop, "wlan") == 0)
+ name = g_udev_device_get_name (udev_device);
+ sysfs_path = g_udev_device_get_sysfs_path (udev_device);
+ if (g_strcmp0 (prop, "wlan") == 0 || wifi_utils_is_wifi (name, sysfs_path))
return_type (NM_LINK_TYPE_WIFI, "wifi");
else if (g_strcmp0 (prop, "wwan") == 0)
return_type (NM_LINK_TYPE_WWAN_ETHERNET, "wwan");
if (arptype == ARPHRD_ETHER)
return_type (NM_LINK_TYPE_ETHERNET, "ethernet");
--
1.8.3.1

View File

@ -1,88 +0,0 @@
From 073cc01f52f8b2b6d5b20c63814dc1ed00699028 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Mon, 18 Nov 2013 23:37:58 +0100
Subject: [PATCH] dispatcher: fix crash while logging from signal handler
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bug rh#1017884 describes a crash, where dbus_init() failed, which causes
a g_warning(). While writing the warning, a SIGTERM hit, and the
signal_handler() tries to call again g_message().
The logging functions of glib are not reentrant and call abort() when
invoked recursivly. The solution, is to use g_unix_signal_add, which
will dispatch the handler on the mainloop asynchronously.
This bug is not that serious, because the dispatcher was about to
terminate anyway. However, it gets registered as a crash by the system
(ABRT).
https://bugzilla.redhat.com/show_bug.cgi?id=1017884
Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
callouts/nm-dispatcher-action.c | 30 ++++++++++--------------------
1 file changed, 10 insertions(+), 20 deletions(-)
diff --git a/callouts/nm-dispatcher-action.c b/callouts/nm-dispatcher-action.c
index 397f2ba..f48ff0a 100644
--- a/callouts/nm-dispatcher-action.c
+++ b/callouts/nm-dispatcher-action.c
@@ -31,6 +31,7 @@
#include <arpa/inet.h>
#include <glib.h>
+#include <glib-unix.h>
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <dbus/dbus-glib.h>
@@ -597,27 +598,15 @@ logging_shutdown (void)
closelog ();
}
-static void
-signal_handler (int signo)
+static gboolean
+signal_handler (gpointer user_data)
{
- if (signo == SIGINT || signo == SIGTERM) {
- g_message ("Caught signal %d, shutting down...", signo);
- g_main_loop_quit (loop);
- }
-}
+ int signo = GPOINTER_TO_INT (user_data);
-static void
-setup_signals (void)
-{
- struct sigaction action;
- sigset_t mask;
-
- sigemptyset (&mask);
- action.sa_handler = signal_handler;
- action.sa_mask = mask;
- action.sa_flags = 0;
- sigaction (SIGTERM, &action, NULL);
- sigaction (SIGINT, &action, NULL);
+ g_message ("Caught signal %d, shutting down...", signo);
+ g_main_loop_quit (loop);
+
+ return G_SOURCE_REMOVE;
}
int
@@ -648,7 +637,8 @@ main (int argc, char **argv)
g_option_context_free (opt_ctx);
g_type_init ();
- setup_signals ();
+ g_unix_signal_add (SIGTERM, signal_handler, GINT_TO_POINTER (SIGTERM));
+ g_unix_signal_add (SIGINT, signal_handler, GINT_TO_POINTER (SIGINT));
if (!debug)
logging_setup ();
--
1.7.11.7

View File

@ -1,857 +0,0 @@
From fec50bd5fad633e57bfd6f9ee480e6192504ca5f Mon Sep 17 00:00:00 2001
From: Dan Winship <danw@gnome.org>
Date: Mon, 2 Dec 2013 10:20:26 -0500
Subject: [PATCH] platform/core: add back support for PtP/peer addresses (rh
#1018317)
In the migration to NMPlatform, support for ptp/peer addresses was
accidentally dropped. This broke OpenVPN configurations using 'p2p'
topology, which send a different peer address than the local address
for tunX, plus the server may also push routes that use the peer
address as the next hop. NetworkManager was unable to add these
routes, because the kernel had no idea how to talk to the peer,
because the peer's address was not assigned to any interface or
reachable over any routes.
Partly based on a patch from Dan Williams.
---
src/nm-ip4-config.c | 44 +---------------------------
src/nm-ip4-config.h | 4 ---
src/nm-ip6-config.c | 49 -------------------------------
src/nm-ip6-config.h | 4 ---
src/platform/nm-fake-platform.c | 10 +++++--
src/platform/nm-linux-platform.c | 58 ++++++++++++++++++++++++++++++++-----
src/platform/nm-platform.c | 26 +++++++++++++----
src/platform/nm-platform.h | 14 ++++++---
src/platform/tests/platform.c | 4 +--
src/platform/tests/test-address.c | 12 ++++----
src/platform/tests/test-cleanup.c | 4 +--
src/ppp-manager/nm-ppp-manager.c | 2 +-
src/tests/test-dhcp-options.c | 5 ++--
src/tests/test-ip4-config.c | 12 ++++----
src/tests/test-ip6-config.c | 13 ++++-----
src/vpn-manager/nm-vpn-connection.c | 10 +++----
16 files changed, 118 insertions(+), 153 deletions(-)
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c
index 7aff888..640a1e1 100644
--- a/src/nm-ip4-config.c
+++ b/src/nm-ip4-config.c
@@ -47,7 +47,6 @@ typedef struct {
GPtrArray *domains;
GPtrArray *searches;
guint32 mss;
- guint32 ptp_address;
GArray *nis;
char *nis_domain;
GArray *wins;
@@ -454,10 +453,6 @@ nm_ip4_config_merge (NMIP4Config *dst, const NMIP4Config *src)
for (i = 0; i < nm_ip4_config_get_num_addresses (src); i++)
nm_ip4_config_add_address (dst, nm_ip4_config_get_address (src, i));
- /* ptp address; only replace if src doesn't have one */
- if (!nm_ip4_config_get_ptp_address (dst))
- nm_ip4_config_set_ptp_address (dst, nm_ip4_config_get_ptp_address (src));
-
/* nameservers */
for (i = 0; i < nm_ip4_config_get_num_nameservers (src); i++)
nm_ip4_config_add_nameserver (dst, nm_ip4_config_get_nameserver (src, i));
@@ -527,10 +522,6 @@ nm_ip4_config_subtract (NMIP4Config *dst, const NMIP4Config *src)
}
}
- /* ptp address */
- if (nm_ip4_config_get_ptp_address (src) == nm_ip4_config_get_ptp_address (dst))
- nm_ip4_config_set_ptp_address (dst, 0);
-
/* nameservers */
for (i = 0; i < nm_ip4_config_get_num_nameservers (src); i++) {
guint32 src_ns = nm_ip4_config_get_nameserver (src, i);
@@ -788,12 +779,6 @@ nm_ip4_config_replace (NMIP4Config *dst, const NMIP4Config *src, gboolean *relev
has_minor_changes = TRUE;
}
- /* ptp address */
- if (src_priv->ptp_address != dst_priv->ptp_address) {
- dst_priv->ptp_address = src_priv->ptp_address;
- has_relevant_changes = TRUE;
- }
-
/* nis */
num = nm_ip4_config_get_num_nis_servers (src);
are_equal = num == nm_ip4_config_get_num_nis_servers (dst);
@@ -873,11 +858,6 @@ nm_ip4_config_dump (const NMIP4Config *config, const char *detail)
}
}
- /* ptp address */
- tmp = nm_ip4_config_get_ptp_address (config);
- if (inet_ntop (AF_INET, (void *) &tmp, buf, sizeof (buf)))
- g_message (" ptp: %s", buf);
-
/* default gateway */
tmp = nm_ip4_config_get_gateway (config);
if (inet_ntop (AF_INET, (void *) &tmp, buf, sizeof (buf)))
@@ -1314,24 +1294,6 @@ nm_ip4_config_get_mss (const NMIP4Config *config)
/******************************************************************/
void
-nm_ip4_config_set_ptp_address (NMIP4Config *config, guint32 ptp_addr)
-{
- NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config);
-
- priv->ptp_address = ptp_addr;
-}
-
-guint32
-nm_ip4_config_get_ptp_address (const NMIP4Config *config)
-{
- NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config);
-
- return priv->ptp_address;
-}
-
-/******************************************************************/
-
-void
nm_ip4_config_reset_nis_servers (NMIP4Config *config)
{
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config);
@@ -1480,7 +1442,7 @@ hash_u32 (GChecksum *sum, guint32 n)
void
nm_ip4_config_hash (const NMIP4Config *config, GChecksum *sum, gboolean dns_only)
{
- guint32 i, n;
+ guint32 i;
const char *s;
g_return_if_fail (config);
@@ -1504,10 +1466,6 @@ nm_ip4_config_hash (const NMIP4Config *config, GChecksum *sum, gboolean dns_only
hash_u32 (sum, route->metric);
}
- n = nm_ip4_config_get_ptp_address (config);
- if (n)
- hash_u32 (sum, n);
-
for (i = 0; i < nm_ip4_config_get_num_nis_servers (config); i++)
hash_u32 (sum, nm_ip4_config_get_nis_server (config, i));
diff --git a/src/nm-ip4-config.h b/src/nm-ip4-config.h
index 5b76fb4..d57cd52 100644
--- a/src/nm-ip4-config.h
+++ b/src/nm-ip4-config.h
@@ -117,10 +117,6 @@ const char * nm_ip4_config_get_search (const NMIP4Config *config, guint i);
void nm_ip4_config_set_mss (NMIP4Config *config, guint32 mss);
guint32 nm_ip4_config_get_mss (const NMIP4Config *config);
-/* PTP */
-void nm_ip4_config_set_ptp_address (NMIP4Config *config, guint32 ptp_addr);
-guint32 nm_ip4_config_get_ptp_address (const NMIP4Config *config);
-
/* NIS */
void nm_ip4_config_reset_nis_servers (NMIP4Config *config);
void nm_ip4_config_add_nis_server (NMIP4Config *config, guint32 nis);
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c
index 65cbd0b..8eb79f2 100644
--- a/src/nm-ip6-config.c
+++ b/src/nm-ip6-config.c
@@ -47,7 +47,6 @@ typedef struct {
GPtrArray *domains;
GPtrArray *searches;
guint32 mss;
- struct in6_addr ptp_address;
} NMIP6ConfigPrivate;
@@ -457,10 +456,6 @@ nm_ip6_config_merge (NMIP6Config *dst, const NMIP6Config *src)
for (i = 0; i < nm_ip6_config_get_num_addresses (src); i++)
nm_ip6_config_add_address (dst, nm_ip6_config_get_address (src, i));
- /* ptp address; only replace if src doesn't have one */
- if (!nm_ip6_config_get_ptp_address (dst))
- nm_ip6_config_set_ptp_address (dst, nm_ip6_config_get_ptp_address (src));
-
/* nameservers */
for (i = 0; i < nm_ip6_config_get_num_nameservers (src); i++)
nm_ip6_config_add_nameserver (dst, nm_ip6_config_get_nameserver (src, i));
@@ -535,12 +530,6 @@ nm_ip6_config_subtract (NMIP6Config *dst, const NMIP6Config *src)
}
}
- /* ptp address */
- src_tmp = nm_ip6_config_get_ptp_address (src);
- dst_tmp = nm_ip6_config_get_ptp_address (dst);
- if (src_tmp && dst_tmp && IN6_ARE_ADDR_EQUAL (src_tmp, dst_tmp))
- nm_ip6_config_set_ptp_address (dst, NULL);
-
/* nameservers */
for (i = 0; i < nm_ip6_config_get_num_nameservers (src); i++) {
const struct in6_addr *src_ns = nm_ip6_config_get_nameserver (src, i);
@@ -769,12 +758,6 @@ nm_ip6_config_replace (NMIP6Config *dst, const NMIP6Config *src, gboolean *relev
has_minor_changes = TRUE;
}
- /* ptp address */
- if (!IN6_ARE_ADDR_EQUAL (&src_priv->ptp_address, &dst_priv->ptp_address)) {
- nm_ip6_config_set_ptp_address (dst, &src_priv->ptp_address);
- has_relevant_changes = TRUE;
- }
-
/* config_equal does not compare *all* the fields, therefore, we might have has_minor_changes
* regardless of config_equal. But config_equal must correspond to has_relevant_changes. */
g_assert (config_equal == !has_relevant_changes);
@@ -1219,28 +1197,6 @@ nm_ip6_config_get_mss (const NMIP6Config *config)
/******************************************************************/
-void
-nm_ip6_config_set_ptp_address (NMIP6Config *config, const struct in6_addr *ptp_address)
-{
- NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (config);
-
- if (ptp_address)
- priv->ptp_address = *ptp_address;
- else
- memset (&priv->ptp_address, 0, sizeof (priv->ptp_address));
-
-}
-
-const struct in6_addr *
-nm_ip6_config_get_ptp_address (const NMIP6Config *config)
-{
- NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (config);
-
- return IN6_IS_ADDR_UNSPECIFIED (&priv->ptp_address) ? NULL : &priv->ptp_address;
-}
-
-/******************************************************************/
-
static inline void
hash_u32 (GChecksum *sum, guint32 n)
{
@@ -1260,7 +1216,6 @@ void
nm_ip6_config_hash (const NMIP6Config *config, GChecksum *sum, gboolean dns_only)
{
guint32 i;
- const struct in6_addr *in6a;
const char *s;
g_return_if_fail (config);
@@ -1284,10 +1239,6 @@ nm_ip6_config_hash (const NMIP6Config *config, GChecksum *sum, gboolean dns_only
hash_in6addr (sum, &route->gateway);
hash_u32 (sum, route->metric);
}
-
- in6a = nm_ip6_config_get_ptp_address (config);
- if (in6a)
- hash_in6addr (sum, in6a);
}
for (i = 0; i < nm_ip6_config_get_num_nameservers (config); i++)
diff --git a/src/nm-ip6-config.h b/src/nm-ip6-config.h
index aecdab2..eb93d07 100644
--- a/src/nm-ip6-config.h
+++ b/src/nm-ip6-config.h
@@ -116,10 +116,6 @@ const char * nm_ip6_config_get_search (const NMIP6Config *config, guint i);
void nm_ip6_config_set_mss (NMIP6Config *config, guint32 mss);
guint32 nm_ip6_config_get_mss (const NMIP6Config *config);
-/* PTP */
-void nm_ip6_config_set_ptp_address (NMIP6Config *config, const struct in6_addr *ptp_addr);
-const struct in6_addr *nm_ip6_config_get_ptp_address (const NMIP6Config *config);
-
void nm_ip6_config_hash (const NMIP6Config *config, GChecksum *sum, gboolean dns_only);
gboolean nm_ip6_config_equal (const NMIP6Config *a, const NMIP6Config *b);
diff --git a/src/platform/nm-fake-platform.c b/src/platform/nm-fake-platform.c
index df5d5b8..dcbf932 100644
--- a/src/platform/nm-fake-platform.c
+++ b/src/platform/nm-fake-platform.c
@@ -739,7 +739,9 @@ get_time (void)
}
static gboolean
-ip4_address_add (NMPlatform *platform, int ifindex, in_addr_t addr, int plen, guint32 lifetime, guint32 preferred)
+ip4_address_add (NMPlatform *platform, int ifindex,
+ in_addr_t addr, in_addr_t peer_addr,
+ int plen, guint32 lifetime, guint32 preferred)
{
NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
NMPlatformIP4Address address;
@@ -748,6 +750,7 @@ ip4_address_add (NMPlatform *platform, int ifindex, in_addr_t addr, int plen, gu
memset (&address, 0, sizeof (address));
address.ifindex = ifindex;
address.address = addr;
+ address.peer_address = peer_addr;
address.plen = plen;
address.timestamp = get_time ();
address.lifetime = lifetime;
@@ -775,7 +778,9 @@ ip4_address_add (NMPlatform *platform, int ifindex, in_addr_t addr, int plen, gu
}
static gboolean
-ip6_address_add (NMPlatform *platform, int ifindex, struct in6_addr addr, int plen, guint32 lifetime, guint32 preferred, guint flags)
+ip6_address_add (NMPlatform *platform, int ifindex,
+ struct in6_addr addr, struct in6_addr peer_addr,
+ int plen, guint32 lifetime, guint32 preferred, guint flags)
{
NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
NMPlatformIP6Address address;
@@ -784,6 +789,7 @@ ip6_address_add (NMPlatform *platform, int ifindex, struct in6_addr addr, int pl
memset (&address, 0, sizeof (address));
address.ifindex = ifindex;
address.address = addr;
+ address.peer_address = peer_addr;
address.plen = plen;
address.timestamp = get_time ();
address.lifetime = lifetime;
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index d13abbe..50b027a 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -764,6 +764,7 @@ static void
init_ip4_address (NMPlatformIP4Address *address, struct rtnl_addr *rtnladdr)
{
struct nl_addr *nladdr = rtnl_addr_get_local (rtnladdr);
+ struct nl_addr *nlpeer = rtnl_addr_get_peer (rtnladdr);
g_assert (nladdr);
@@ -776,12 +777,17 @@ init_ip4_address (NMPlatformIP4Address *address, struct rtnl_addr *rtnladdr)
address->preferred = rtnl_addr_get_preferred_lifetime (rtnladdr);
g_assert (nl_addr_get_len (nladdr) == sizeof (address->address));
memcpy (&address->address, nl_addr_get_binary_addr (nladdr), sizeof (address->address));
+ if (nlpeer) {
+ g_assert (nl_addr_get_len (nlpeer) == sizeof (address->peer_address));
+ memcpy (&address->peer_address, nl_addr_get_binary_addr (nlpeer), sizeof (address->peer_address));
+ }
}
static void
init_ip6_address (NMPlatformIP6Address *address, struct rtnl_addr *rtnladdr)
{
struct nl_addr *nladdr = rtnl_addr_get_local (rtnladdr);
+ struct nl_addr *nlpeer = rtnl_addr_get_peer (rtnladdr);
memset (address, 0, sizeof (*address));
@@ -793,6 +799,10 @@ init_ip6_address (NMPlatformIP6Address *address, struct rtnl_addr *rtnladdr)
address->flags = rtnl_addr_get_flags (rtnladdr);
g_assert (nl_addr_get_len (nladdr) == sizeof (address->address));
memcpy (&address->address, nl_addr_get_binary_addr (nladdr), sizeof (address->address));
+ if (nlpeer) {
+ g_assert (nl_addr_get_len (nlpeer) == sizeof (address->peer_address));
+ memcpy (&address->peer_address, nl_addr_get_binary_addr (nlpeer), sizeof (address->peer_address));
+ }
}
static gboolean
@@ -2208,7 +2218,14 @@ ip6_address_get_all (NMPlatform *platform, int ifindex)
}
static struct nl_object *
-build_rtnl_addr (int family, int ifindex, gconstpointer addr, int plen, guint32 lifetime, guint32 preferred, guint flags)
+build_rtnl_addr (int family,
+ int ifindex,
+ gconstpointer addr,
+ gconstpointer peer_addr,
+ int plen,
+ guint32 lifetime,
+ guint32 preferred,
+ guint flags)
{
struct rtnl_addr *rtnladdr = rtnl_addr_alloc ();
int addrlen = family == AF_INET ? sizeof (in_addr_t) : sizeof (struct in6_addr);
@@ -2220,6 +2237,14 @@ build_rtnl_addr (int family, int ifindex, gconstpointer addr, int plen, guint32
rtnl_addr_set_ifindex (rtnladdr, ifindex);
nle = rtnl_addr_set_local (rtnladdr, nladdr);
g_assert (!nle);
+
+ if (peer_addr) {
+ auto_nl_addr struct nl_addr *nlpeer = nl_addr_build (family, peer_addr, addrlen);
+
+ nle = rtnl_addr_set_peer (rtnladdr, nlpeer);
+ g_assert (!nle);
+ }
+
rtnl_addr_set_prefixlen (rtnladdr, plen);
if (lifetime) {
rtnl_addr_set_valid_lifetime (rtnladdr, lifetime);
@@ -2232,33 +2257,50 @@ build_rtnl_addr (int family, int ifindex, gconstpointer addr, int plen, guint32
}
static gboolean
-ip4_address_add (NMPlatform *platform, int ifindex, in_addr_t addr, int plen, guint32 lifetime, guint32 preferred)
+ip4_address_add (NMPlatform *platform,
+ int ifindex,
+ in_addr_t addr,
+ in_addr_t peer_addr,
+ int plen,
+ guint32 lifetime,
+ guint32 preferred)
{
- return add_object (platform, build_rtnl_addr (AF_INET, ifindex, &addr, plen, lifetime, preferred, 0));
+ return add_object (platform, build_rtnl_addr (AF_INET, ifindex, &addr,
+ peer_addr ? &peer_addr : NULL,
+ plen, lifetime, preferred, 0));
}
static gboolean
-ip6_address_add (NMPlatform *platform, int ifindex, struct in6_addr addr, int plen, guint32 lifetime, guint32 preferred, guint flags)
+ip6_address_add (NMPlatform *platform,
+ int ifindex,
+ struct in6_addr addr,
+ struct in6_addr peer_addr,
+ int plen,
+ guint32 lifetime,
+ guint32 preferred,
+ guint flags)
{
- return add_object (platform, build_rtnl_addr (AF_INET6, ifindex, &addr, plen, lifetime, preferred, flags));
+ return add_object (platform, build_rtnl_addr (AF_INET6, ifindex, &addr,
+ memcmp (&peer_addr, &in6addr_any, sizeof (struct in6_addr)) == 0 ? NULL : &peer_addr,
+ plen, lifetime, preferred, flags));
}
static gboolean
ip4_address_delete (NMPlatform *platform, int ifindex, in_addr_t addr, int plen)
{
- return delete_object (platform, build_rtnl_addr (AF_INET, ifindex, &addr, plen, 0, 0, 0));
+ return delete_object (platform, build_rtnl_addr (AF_INET, ifindex, &addr, NULL, plen, 0, 0, 0));
}
static gboolean
ip6_address_delete (NMPlatform *platform, int ifindex, struct in6_addr addr, int plen)
{
- return delete_object (platform, build_rtnl_addr (AF_INET6, ifindex, &addr, plen, 0, 0, 0));
+ return delete_object (platform, build_rtnl_addr (AF_INET6, ifindex, &addr, NULL, plen, 0, 0, 0));
}
static gboolean
ip_address_exists (NMPlatform *platform, int family, int ifindex, gconstpointer addr, int plen)
{
- auto_nl_object struct nl_object *object = build_rtnl_addr (family, ifindex, addr, plen, 0, 0, 0);
+ auto_nl_object struct nl_object *object = build_rtnl_addr (family, ifindex, addr, NULL, plen, 0, 0, 0);
auto_nl_object struct nl_object *cached_object = nl_cache_search (choose_cache (platform, object), object);
return !!cached_object;
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index 3f7f054..4e9c8fc 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -1165,7 +1165,12 @@ nm_platform_ip6_address_get_all (int ifindex)
}
gboolean
-nm_platform_ip4_address_add (int ifindex, in_addr_t address, int plen, guint32 lifetime, guint32 preferred)
+nm_platform_ip4_address_add (int ifindex,
+ in_addr_t address,
+ in_addr_t peer_address,
+ int plen,
+ guint32 lifetime,
+ guint32 preferred)
{
reset_error ();
@@ -1175,11 +1180,17 @@ nm_platform_ip4_address_add (int ifindex, in_addr_t address, int plen, guint32 l
g_return_val_if_fail (klass->ip4_address_add, FALSE);
debug ("address: adding or updating IPv4 address");
- return klass->ip4_address_add (platform, ifindex, address, plen, lifetime, preferred);
+ return klass->ip4_address_add (platform, ifindex, address, peer_address, plen, lifetime, preferred);
}
gboolean
-nm_platform_ip6_address_add (int ifindex, struct in6_addr address, int plen, guint32 lifetime, guint32 preferred, guint flags)
+nm_platform_ip6_address_add (int ifindex,
+ struct in6_addr address,
+ struct in6_addr peer_address,
+ int plen,
+ guint32 lifetime,
+ guint32 preferred,
+ guint flags)
{
reset_error ();
@@ -1189,7 +1200,7 @@ nm_platform_ip6_address_add (int ifindex, struct in6_addr address, int plen, gui
g_return_val_if_fail (klass->ip6_address_add, FALSE);
debug ("address: adding or updating IPv6 address");
- return klass->ip6_address_add (platform, ifindex, address, plen, lifetime, preferred, flags);
+ return klass->ip6_address_add (platform, ifindex, address, peer_address, plen, lifetime, preferred, flags);
}
gboolean
@@ -1350,7 +1361,7 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses)
} else
lifetime = preferred = NM_PLATFORM_LIFETIME_PERMANENT;
- if (!nm_platform_ip4_address_add (ifindex, known_address->address, known_address->plen, lifetime, preferred))
+ if (!nm_platform_ip4_address_add (ifindex, known_address->address, known_address->peer_address, known_address->plen, lifetime, preferred))
return FALSE;
}
@@ -1407,7 +1418,8 @@ nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses)
} else
lifetime = preferred = NM_PLATFORM_LIFETIME_PERMANENT;
- if (!nm_platform_ip6_address_add (ifindex, known_address->address, known_address->plen,
+ if (!nm_platform_ip6_address_add (ifindex, known_address->address,
+ known_address->peer_address, known_address->plen,
lifetime, preferred, known_address->flags))
return FALSE;
}
@@ -1843,6 +1855,7 @@ nm_platform_ip4_address_cmp (const NMPlatformIP4Address *a, const NMPlatformIP4A
{
_CMP_POINTER (a, b);
_CMP_FIELD_MEMCMP (a, b, address);
+ _CMP_FIELD_MEMCMP (a, b, peer_address);
_CMP_FIELD (a, b, ifindex);
_CMP_FIELD (a, b, plen);
_CMP_FIELD (a, b, timestamp);
@@ -1857,6 +1870,7 @@ nm_platform_ip6_address_cmp (const NMPlatformIP6Address *a, const NMPlatformIP6A
_CMP_POINTER (a, b);
_CMP_FIELD (a, b, ifindex);
_CMP_FIELD_MEMCMP (a, b, address);
+ _CMP_FIELD_MEMCMP (a, b, peer_address);
_CMP_FIELD (a, b, plen);
_CMP_FIELD (a, b, timestamp);
_CMP_FIELD (a, b, lifetime);
diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h
index ff338fc..b742c39 100644
--- a/src/platform/nm-platform.h
+++ b/src/platform/nm-platform.h
@@ -122,6 +122,7 @@ typedef struct {
typedef struct {
int ifindex;
in_addr_t address;
+ in_addr_t peer_address; /* PTP peer address */
int plen;
guint32 timestamp;
guint32 lifetime;
@@ -131,6 +132,7 @@ typedef struct {
typedef struct {
int ifindex;
struct in6_addr address;
+ struct in6_addr peer_address;
int plen;
guint32 timestamp;
guint32 lifetime;
@@ -280,9 +282,11 @@ typedef struct {
GArray * (*ip4_address_get_all) (NMPlatform *, int ifindex);
GArray * (*ip6_address_get_all) (NMPlatform *, int ifindex);
- gboolean (*ip4_address_add) (NMPlatform *, int ifindex, in_addr_t address, int plen,
- guint32 lifetime, guint32 preferred_lft);
- gboolean (*ip6_address_add) (NMPlatform *, int ifindex, struct in6_addr address, int plen,
+ gboolean (*ip4_address_add) (NMPlatform *, int ifindex,
+ in_addr_t address, in_addr_t peer_address, int plen,
+ guint32 lifetime, guint32 preferred_lft);
+ gboolean (*ip6_address_add) (NMPlatform *, int ifindex,
+ struct in6_addr address, struct in6_addr peer_address, int plen,
guint32 lifetime, guint32 preferred_lft, guint flags);
gboolean (*ip4_address_delete) (NMPlatform *, int ifindex, in_addr_t address, int plen);
gboolean (*ip6_address_delete) (NMPlatform *, int ifindex, struct in6_addr address, int plen);
@@ -402,9 +406,11 @@ gboolean nm_platform_gre_get_properties (int ifindex, NMPlatformGreProperties *p
GArray *nm_platform_ip4_address_get_all (int ifindex);
GArray *nm_platform_ip6_address_get_all (int ifindex);
-gboolean nm_platform_ip4_address_add (int ifindex, in_addr_t address, int plen,
- guint32 lifetime, guint32 preferred_lft);
-gboolean nm_platform_ip6_address_add (int ifindex, struct in6_addr address, int plen,
+gboolean nm_platform_ip4_address_add (int ifindex,
+ in_addr_t address, in_addr_t peer_address, int plen,
+ guint32 lifetime, guint32 preferred_lft);
+gboolean nm_platform_ip6_address_add (int ifindex,
+ struct in6_addr address, struct in6_addr peer_address, int plen,
guint32 lifetime, guint32 preferred_lft, guint flags);
gboolean nm_platform_ip4_address_delete (int ifindex, in_addr_t address, int plen);
gboolean nm_platform_ip6_address_delete (int ifindex, struct in6_addr address, int plen);
diff --git a/src/platform/tests/platform.c b/src/platform/tests/platform.c
index c0b2c02..7ca2cb5 100644
--- a/src/platform/tests/platform.c
+++ b/src/platform/tests/platform.c
@@ -523,7 +523,7 @@ do_ip4_address_add (char **argv)
guint32 lifetime = strtol (*argv++, NULL, 10);
guint32 preferred = strtol (*argv++, NULL, 10);
- gboolean value = nm_platform_ip4_address_add (ifindex, address, plen, lifetime, preferred);
+ gboolean value = nm_platform_ip4_address_add (ifindex, address, 0, plen, lifetime, preferred);
return value;
} else
return FALSE;
@@ -541,7 +541,7 @@ do_ip6_address_add (char **argv)
guint32 preferred = strtol (*argv++, NULL, 10);
guint flags = (*argv) ? rtnl_addr_str2flags (*argv++) : 0;
- gboolean value = nm_platform_ip6_address_add (ifindex, address, plen, lifetime, preferred, flags);
+ gboolean value = nm_platform_ip6_address_add (ifindex, address, in6addr_any, plen, lifetime, preferred, flags);
return value;
} else
return FALSE;
diff --git a/src/platform/tests/test-address.c b/src/platform/tests/test-address.c
index 52952c3..0f0ccc8 100644
--- a/src/platform/tests/test-address.c
+++ b/src/platform/tests/test-address.c
@@ -60,14 +60,14 @@ test_ip4_address (void)
/* Add address */
g_assert (!nm_platform_ip4_address_exists (ifindex, addr, IP4_PLEN));
no_error ();
- g_assert (nm_platform_ip4_address_add (ifindex, addr, IP4_PLEN, lifetime, preferred));
+ g_assert (nm_platform_ip4_address_add (ifindex, addr, 0, IP4_PLEN, lifetime, preferred));
no_error ();
g_assert (nm_platform_ip4_address_exists (ifindex, addr, IP4_PLEN));
no_error ();
accept_signal (address_added);
/* Add address again (aka update) */
- g_assert (nm_platform_ip4_address_add (ifindex, addr, IP4_PLEN, lifetime, preferred));
+ g_assert (nm_platform_ip4_address_add (ifindex, addr, 0, IP4_PLEN, lifetime, preferred));
no_error ();
accept_signal (address_changed);
@@ -116,14 +116,14 @@ test_ip6_address (void)
/* Add address */
g_assert (!nm_platform_ip6_address_exists (ifindex, addr, IP6_PLEN));
no_error ();
- g_assert (nm_platform_ip6_address_add (ifindex, addr, IP6_PLEN, lifetime, preferred, flags));
+ g_assert (nm_platform_ip6_address_add (ifindex, addr, in6addr_any, IP6_PLEN, lifetime, preferred, flags));
no_error ();
g_assert (nm_platform_ip6_address_exists (ifindex, addr, IP6_PLEN));
no_error ();
accept_signal (address_added);
/* Add address again (aka update) */
- g_assert (nm_platform_ip6_address_add (ifindex, addr, IP6_PLEN, lifetime, preferred, flags));
+ g_assert (nm_platform_ip6_address_add (ifindex, addr, in6addr_any, IP6_PLEN, lifetime, preferred, flags));
no_error ();
accept_signal (address_changed);
@@ -183,7 +183,7 @@ test_ip4_address_external (void)
/* Add/delete conflict */
run_command ("ip address add %s/%d dev %s valid_lft %d preferred_lft %d",
IP4_ADDRESS, IP4_PLEN, DEVICE_NAME, lifetime, preferred);
- g_assert (nm_platform_ip4_address_add (ifindex, addr, IP4_PLEN, lifetime, preferred));
+ g_assert (nm_platform_ip4_address_add (ifindex, addr, 0, IP4_PLEN, lifetime, preferred));
no_error ();
g_assert (nm_platform_ip4_address_exists (ifindex, addr, IP4_PLEN));
accept_signal (address_added);
@@ -222,7 +222,7 @@ test_ip6_address_external (void)
/* Add/delete conflict */
run_command ("ip address add %s/%d dev %s valid_lft %d preferred_lft %d",
IP6_ADDRESS, IP6_PLEN, DEVICE_NAME, lifetime, preferred);
- g_assert (nm_platform_ip6_address_add (ifindex, addr, IP6_PLEN, lifetime, preferred, flags));
+ g_assert (nm_platform_ip6_address_add (ifindex, addr, in6addr_any, IP6_PLEN, lifetime, preferred, flags));
no_error ();
g_assert (nm_platform_ip6_address_exists (ifindex, addr, IP6_PLEN));
accept_signal (address_added);
diff --git a/src/platform/tests/test-cleanup.c b/src/platform/tests/test-cleanup.c
index f102870..d94b359 100644
--- a/src/platform/tests/test-cleanup.c
+++ b/src/platform/tests/test-cleanup.c
@@ -41,8 +41,8 @@ test_cleanup_internal ()
g_assert (ifindex > 0);
/* Add routes and addresses */
- g_assert (nm_platform_ip4_address_add (ifindex, addr4, plen4, lifetime, preferred));
- g_assert (nm_platform_ip6_address_add (ifindex, addr6, plen6, lifetime, preferred, flags));
+ g_assert (nm_platform_ip4_address_add (ifindex, addr4, 0, plen4, lifetime, preferred));
+ g_assert (nm_platform_ip6_address_add (ifindex, addr6, in6addr_any, plen6, lifetime, preferred, flags));
g_assert (nm_platform_ip4_route_add (ifindex, gateway4, 32, INADDR_ANY, metric, mss));
g_assert (nm_platform_ip4_route_add (ifindex, network4, plen4, gateway4, metric, mss));
g_assert (nm_platform_ip4_route_add (ifindex, 0, 0, gateway4, metric, mss));
diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c
index ffb1e74..b2f2326 100644
--- a/src/ppp-manager/nm-ppp-manager.c
+++ b/src/ppp-manager/nm-ppp-manager.c
@@ -538,7 +538,7 @@ impl_ppp_manager_set_ip4_config (NMPPPManager *manager,
val = (GValue *) g_hash_table_lookup (config_hash, NM_PPP_IP4_CONFIG_GATEWAY);
if (val) {
nm_ip4_config_set_gateway (config, g_value_get_uint (val));
- nm_ip4_config_set_ptp_address (config, g_value_get_uint (val));
+ address.peer_address = g_value_get_uint (val);
}
val = (GValue *) g_hash_table_lookup (config_hash, NM_PPP_IP4_CONFIG_ADDRESS);
diff --git a/src/tests/test-dhcp-options.c b/src/tests/test-dhcp-options.c
index effe658..6ef599e 100644
--- a/src/tests/test-dhcp-options.c
+++ b/src/tests/test-dhcp-options.c
@@ -129,6 +129,8 @@ test_generic_options (const char *client)
"dhcp-generic", "couldn't convert expected IP address");
ASSERT (address->address == tmp,
"dhcp-generic", "unexpected IP address");
+ ASSERT (address->peer_address == 0,
+ "dhcp-generic", "unexpected PTP address");
ASSERT (address->plen == 24,
"dhcp-generic", "unexpected IP address prefix length");
@@ -139,9 +141,6 @@ test_generic_options (const char *client)
ASSERT (nm_ip4_config_get_gateway (ip4_config) == tmp,
"dhcp-generic", "unexpected IP gateway");
- ASSERT (nm_ip4_config_get_ptp_address (ip4_config) == 0,
- "dhcp-generic", "unexpected PTP address");
-
ASSERT (nm_ip4_config_get_num_wins (ip4_config) == 0,
"dhcp-generic", "unexpected number of WINS servers");
diff --git a/src/tests/test-ip4-config.c b/src/tests/test-ip4-config.c
index 331897c..fde4a40 100644
--- a/src/tests/test-ip4-config.c
+++ b/src/tests/test-ip4-config.c
@@ -25,10 +25,12 @@
#include "nm-ip4-config.h"
static void
-addr_init (NMPlatformIP4Address *a, const char *addr, guint plen)
+addr_init (NMPlatformIP4Address *a, const char *addr, const char *peer, guint plen)
{
memset (a, 0, sizeof (*a));
g_assert (inet_pton (AF_INET, addr, (void *) &a->address) == 1);
+ if (peer)
+ g_assert (inet_pton (AF_INET, peer, (void *) &a->peer_address) == 1);
a->plen = plen;
}
@@ -68,7 +70,7 @@ build_test_config (void)
/* Build up the config to subtract */
config = nm_ip4_config_new ();
- addr_init (&addr, "192.168.1.10", 24);
+ addr_init (&addr, "192.168.1.10", "1.2.3.4", 24);
nm_ip4_config_add_address (config, &addr);
route_new (&route, "10.0.0.0", 8, "192.168.1.1");
@@ -86,8 +88,6 @@ build_test_config (void)
nm_ip4_config_add_search (config, "blahblah.com");
nm_ip4_config_add_search (config, "beatbox.com");
- nm_ip4_config_set_ptp_address (config, addr_to_num ("1.2.3.4"));
-
nm_ip4_config_add_nis_server (config, addr_to_num ("1.2.3.9"));
nm_ip4_config_add_nis_server (config, addr_to_num ("1.2.3.10"));
@@ -121,7 +121,7 @@ test_subtract (void)
/* add a couple more things to the test config */
dst = build_test_config ();
- addr_init (&addr, expected_addr, expected_addr_plen);
+ addr_init (&addr, expected_addr, NULL, expected_addr_plen);
nm_ip4_config_add_address (dst, &addr);
route_new (&route, expected_route_dest, expected_route_plen, expected_route_next_hop);
@@ -142,9 +142,9 @@ test_subtract (void)
test_addr = nm_ip4_config_get_address (dst, 0);
g_assert (test_addr != NULL);
g_assert_cmpuint (test_addr->address, ==, addr_to_num (expected_addr));
+ g_assert_cmpuint (test_addr->peer_address, ==, 0);
g_assert_cmpuint (test_addr->plen, ==, expected_addr_plen);
- g_assert_cmpuint (nm_ip4_config_get_ptp_address (dst), ==, 0);
g_assert_cmpuint (nm_ip4_config_get_gateway (dst), ==, 0);
g_assert_cmpuint (nm_ip4_config_get_num_routes (dst), ==, 1);
diff --git a/src/tests/test-ip6-config.c b/src/tests/test-ip6-config.c
index 10ce3bf..b8b9c7b 100644
--- a/src/tests/test-ip6-config.c
+++ b/src/tests/test-ip6-config.c
@@ -25,10 +25,12 @@
#include "nm-ip6-config.h"
static void
-addr_init (NMPlatformIP6Address *a, const char *addr, guint plen)
+addr_init (NMPlatformIP6Address *a, const char *addr, const char *peer, guint plen)
{
memset (a, 0, sizeof (*a));
g_assert (inet_pton (AF_INET6, addr, (void *) &a->address) == 1);
+ if (peer)
+ g_assert (inet_pton (AF_INET6, peer, (void *) &a->peer_address) == 1);
a->plen = plen;
}
@@ -61,7 +63,7 @@ build_test_config (void)
/* Build up the config to subtract */
config = nm_ip6_config_new ();
- addr_init (&addr, "abcd:1234:4321::cdde", 64);
+ addr_init (&addr, "abcd:1234:4321::cdde", "1:2:3:4::5", 64);
nm_ip6_config_add_address (config, &addr);
route_new (&route, "abcd:1234:4321::", 24, "abcd:1234:4321:cdde::2");
@@ -82,9 +84,6 @@ build_test_config (void)
nm_ip6_config_add_search (config, "blahblah.com");
nm_ip6_config_add_search (config, "beatbox.com");
- addr_to_num ("1:2:3:4::5", &tmp);
- nm_ip6_config_set_ptp_address (config, &tmp);
-
return config;
}
@@ -111,7 +110,7 @@ test_subtract (void)
/* add a couple more things to the test config */
dst = build_test_config ();
- addr_init (&addr, expected_addr, expected_addr_plen);
+ addr_init (&addr, expected_addr, NULL, expected_addr_plen);
nm_ip6_config_add_address (dst, &addr);
route_new (&route, expected_route_dest, expected_route_plen, expected_route_next_hop);
@@ -133,9 +132,9 @@ test_subtract (void)
g_assert (test_addr != NULL);
addr_to_num (expected_addr, &tmp);
g_assert (memcmp (&test_addr->address, &tmp, sizeof (tmp)) == 0);
+ g_assert (memcmp (&test_addr->peer_address, &in6addr_any, sizeof (tmp)) == 0);
g_assert_cmpuint (test_addr->plen, ==, expected_addr_plen);
- g_assert (nm_ip6_config_get_ptp_address (dst) == NULL);
g_assert (nm_ip6_config_get_gateway (dst) == NULL);
g_assert_cmpuint (nm_ip6_config_get_num_routes (dst), ==, 1);
diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c
index a3b09f2..2d53449 100644
--- a/src/vpn-manager/nm-vpn-connection.c
+++ b/src/vpn-manager/nm-vpn-connection.c
@@ -569,8 +569,7 @@ print_vpn_config (NMVPNConnection *connection)
nm_log_info (LOGD_VPN, " Internal Gateway: %s", ip_address_to_string (priv->ip4_internal_gw));
nm_log_info (LOGD_VPN, " Internal Address: %s", ip_address_to_string (address4->address));
nm_log_info (LOGD_VPN, " Internal Prefix: %d", address4->plen);
- nm_log_info (LOGD_VPN, " Internal Point-to-Point Address: %s",
- ip_address_to_string (nm_ip4_config_get_ptp_address (priv->ip4_config)));
+ nm_log_info (LOGD_VPN, " Internal Point-to-Point Address: %s", ip_address_to_string (address4->peer_address));
nm_log_info (LOGD_VPN, " Maximum Segment Size (MSS): %d", nm_ip4_config_get_mss (priv->ip4_config));
num = nm_ip4_config_get_num_routes (priv->ip4_config);
@@ -610,8 +609,7 @@ print_vpn_config (NMVPNConnection *connection)
nm_log_info (LOGD_VPN, " Internal Gateway: %s", ip6_address_to_string (priv->ip6_internal_gw));
nm_log_info (LOGD_VPN, " Internal Address: %s", ip6_address_to_string (&address6->address));
nm_log_info (LOGD_VPN, " Internal Prefix: %d", address6->plen);
- nm_log_info (LOGD_VPN, " Internal Point-to-Point Address: %s",
- ip6_address_to_string (nm_ip6_config_get_ptp_address (priv->ip6_config)));
+ nm_log_info (LOGD_VPN, " Internal Point-to-Point Address: %s", ip6_address_to_string (&address6->peer_address));
nm_log_info (LOGD_VPN, " Maximum Segment Size (MSS): %d", nm_ip6_config_get_mss (priv->ip6_config));
num = nm_ip6_config_get_num_routes (priv->ip6_config);
@@ -876,7 +874,7 @@ nm_vpn_connection_ip4_config_get (DBusGProxy *proxy,
val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_PTP);
if (val)
- nm_ip4_config_set_ptp_address (config, g_value_get_uint (val));
+ address.peer_address = g_value_get_uint (val);
val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP4_CONFIG_PREFIX);
if (val)
@@ -1024,7 +1022,7 @@ nm_vpn_connection_ip6_config_get (DBusGProxy *proxy,
GByteArray *ba = g_value_get_boxed (val);
if (ba->len == sizeof (struct in6_addr))
- nm_ip6_config_set_ptp_address (config, (struct in6_addr *)ba->data);
+ address.peer_address = *(struct in6_addr *) ba->data;
}
val = (GValue *) g_hash_table_lookup (config_hash, NM_VPN_PLUGIN_IP6_CONFIG_PREFIX);
--
1.8.4.2

View File

@ -1,321 +0,0 @@
From ac94d83f04d87971c8bea4e164d7a5e260720e5c Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Tue, 15 Oct 2013 20:44:59 +0200
Subject: [PATCH] core: add ifa_flags to NMPlatformIP6Address structure
Add a field 'flags' to NMPlatformIP6Address that holds the
IFA_F_* flags as reported over netlink.
Signed-off-by: Thomas Haller <thaller@redhat.com>
---
src/platform/nm-fake-platform.c | 3 ++-
src/platform/nm-linux-platform.c | 17 ++++++++++-------
src/platform/nm-platform.c | 20 +++++++++++++++-----
src/platform/nm-platform.h | 6 ++++--
src/platform/tests/platform.c | 6 ++++--
src/platform/tests/test-address.c | 8 +++++---
src/platform/tests/test-cleanup.c | 3 ++-
7 files changed, 42 insertions(+), 21 deletions(-)
diff --git a/src/platform/nm-fake-platform.c b/src/platform/nm-fake-platform.c
index 491e23e..df5d5b8 100644
--- a/src/platform/nm-fake-platform.c
+++ b/src/platform/nm-fake-platform.c
@@ -775,7 +775,7 @@ ip4_address_add (NMPlatform *platform, int ifindex, in_addr_t addr, int plen, gu
}
static gboolean
-ip6_address_add (NMPlatform *platform, int ifindex, struct in6_addr addr, int plen, guint32 lifetime, guint32 preferred)
+ip6_address_add (NMPlatform *platform, int ifindex, struct in6_addr addr, int plen, guint32 lifetime, guint32 preferred, guint flags)
{
NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
NMPlatformIP6Address address;
@@ -788,6 +788,7 @@ ip6_address_add (NMPlatform *platform, int ifindex, struct in6_addr addr, int pl
address.timestamp = get_time ();
address.lifetime = lifetime;
address.preferred = preferred;
+ address.flags = flags;
for (i = 0; i < priv->ip6_addresses->len; i++) {
NMPlatformIP6Address *item = &g_array_index (priv->ip6_addresses, NMPlatformIP6Address, i);
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index 0f67180..e3d6357 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -790,6 +790,7 @@ init_ip6_address (NMPlatformIP6Address *address, struct rtnl_addr *rtnladdr)
address->timestamp = rtnl_addr_get_create_time (rtnladdr);
address->lifetime = rtnl_addr_get_valid_lifetime (rtnladdr);
address->preferred = rtnl_addr_get_preferred_lifetime (rtnladdr);
+ address->flags = rtnl_addr_get_flags (rtnladdr);
g_assert (nl_addr_get_len (nladdr) == sizeof (address->address));
memcpy (&address->address, nl_addr_get_binary_addr (nladdr), sizeof (address->address));
}
@@ -2198,7 +2199,7 @@ ip6_address_get_all (NMPlatform *platform, int ifindex)
}
static struct nl_object *
-build_rtnl_addr (int family, int ifindex, gconstpointer addr, int plen, guint32 lifetime, guint32 preferred)
+build_rtnl_addr (int family, int ifindex, gconstpointer addr, int plen, guint32 lifetime, guint32 preferred, guint flags)
{
struct rtnl_addr *rtnladdr = rtnl_addr_alloc ();
int addrlen = family == AF_INET ? sizeof (in_addr_t) : sizeof (struct in6_addr);
@@ -2215,6 +2216,8 @@ build_rtnl_addr (int family, int ifindex, gconstpointer addr, int plen, guint32
rtnl_addr_set_valid_lifetime (rtnladdr, lifetime);
rtnl_addr_set_preferred_lifetime (rtnladdr, preferred);
}
+ if (flags)
+ rtnl_addr_set_flags (rtnladdr, flags);
return (struct nl_object *) rtnladdr;
}
@@ -2222,31 +2225,31 @@ build_rtnl_addr (int family, int ifindex, gconstpointer addr, int plen, guint32
static gboolean
ip4_address_add (NMPlatform *platform, int ifindex, in_addr_t addr, int plen, guint32 lifetime, guint32 preferred)
{
- return add_object (platform, build_rtnl_addr (AF_INET, ifindex, &addr, plen, lifetime, preferred));
+ return add_object (platform, build_rtnl_addr (AF_INET, ifindex, &addr, plen, lifetime, preferred, 0));
}
static gboolean
-ip6_address_add (NMPlatform *platform, int ifindex, struct in6_addr addr, int plen, guint32 lifetime, guint32 preferred)
+ip6_address_add (NMPlatform *platform, int ifindex, struct in6_addr addr, int plen, guint32 lifetime, guint32 preferred, guint flags)
{
- return add_object (platform, build_rtnl_addr (AF_INET6, ifindex, &addr, plen, lifetime, preferred));
+ return add_object (platform, build_rtnl_addr (AF_INET6, ifindex, &addr, plen, lifetime, preferred, flags));
}
static gboolean
ip4_address_delete (NMPlatform *platform, int ifindex, in_addr_t addr, int plen)
{
- return delete_object (platform, build_rtnl_addr (AF_INET, ifindex, &addr, plen, 0, 0));
+ return delete_object (platform, build_rtnl_addr (AF_INET, ifindex, &addr, plen, 0, 0, 0));
}
static gboolean
ip6_address_delete (NMPlatform *platform, int ifindex, struct in6_addr addr, int plen)
{
- return delete_object (platform, build_rtnl_addr (AF_INET6, ifindex, &addr, plen, 0, 0));
+ return delete_object (platform, build_rtnl_addr (AF_INET6, ifindex, &addr, plen, 0, 0, 0));
}
static gboolean
ip_address_exists (NMPlatform *platform, int family, int ifindex, gconstpointer addr, int plen)
{
- auto_nl_object struct nl_object *object = build_rtnl_addr (family, ifindex, addr, plen, 0, 0);
+ auto_nl_object struct nl_object *object = build_rtnl_addr (family, ifindex, addr, plen, 0, 0, 0);
auto_nl_object struct nl_object *cached_object = nl_cache_search (choose_cache (platform, object), object);
return !!cached_object;
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index 5a5e464..3f645ed 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -24,6 +24,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
+#include <netlink/route/addr.h>
#include "nm-platform.h"
#include "nm-logging.h"
@@ -1100,7 +1101,7 @@ nm_platform_ip4_address_add (int ifindex, in_addr_t address, int plen, guint32 l
}
gboolean
-nm_platform_ip6_address_add (int ifindex, struct in6_addr address, int plen, guint32 lifetime, guint32 preferred)
+nm_platform_ip6_address_add (int ifindex, struct in6_addr address, int plen, guint32 lifetime, guint32 preferred, guint flags)
{
reset_error ();
@@ -1111,7 +1112,7 @@ nm_platform_ip6_address_add (int ifindex, struct in6_addr address, int plen, gui
g_return_val_if_fail (klass->ip6_address_add, FALSE);
debug ("address: adding or updating IPv6 address");
- return klass->ip6_address_add (platform, ifindex, address, plen, lifetime, preferred);
+ return klass->ip6_address_add (platform, ifindex, address, plen, lifetime, preferred, flags);
}
gboolean
@@ -1329,7 +1330,8 @@ nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses)
} else
lifetime = preferred = NM_PLATFORM_LIFETIME_PERMANENT;
- if (!nm_platform_ip6_address_add (ifindex, known_address->address, known_address->plen, lifetime, preferred))
+ if (!nm_platform_ip6_address_add (ifindex, known_address->address, known_address->plen,
+ lifetime, preferred, known_address->flags))
return FALSE;
}
@@ -1637,8 +1639,10 @@ const char *
nm_platform_ip6_address_to_string (const NMPlatformIP6Address *address)
{
static char buffer[256];
+ char s_flags[256];
char s_address[INET6_ADDRSTRLEN];
const char *s_dev;
+ char *str_flags;
g_return_val_if_fail (address, "(unknown)");
@@ -1648,7 +1652,12 @@ nm_platform_ip6_address_to_string (const NMPlatformIP6Address *address)
s_dev = address->ifindex > 0 ? nm_platform_link_get_name (address->ifindex) : NULL;
- g_snprintf (buffer, sizeof (buffer), "%s/%d lft %u pref %u time %u dev %s",
+ rtnl_addr_flags2str(address->flags, s_flags, sizeof(s_flags));
+ str_flags = s_flags[0] ? g_strconcat (" flags ", s_flags, NULL) : NULL;
+
+ g_snprintf (buffer, sizeof (buffer), "%s/%d lft %u pref %u time %u dev %s%s",
s_address, address->plen, (guint)address->lifetime, (guint)address->preferred,
- (guint)address->timestamp, s_dev ? s_dev : "-");
+ (guint)address->timestamp, s_dev ? s_dev : "-",
+ str_flags ? str_flags : "");
+ g_free (str_flags);
return buffer;
}
@@ -1775,6 +1784,7 @@ nm_platform_ip6_address_cmp (const NMPlatformIP6Address *a, const NMPlatformIP6A
_CMP_FIELD (a, b, timestamp);
_CMP_FIELD (a, b, lifetime);
_CMP_FIELD (a, b, preferred);
+ _CMP_FIELD (a, b, flags);
return 0;
}
diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h
index eae5465..7de0280 100644
--- a/src/platform/nm-platform.h
+++ b/src/platform/nm-platform.h
@@ -24,6 +24,7 @@
#include <glib-object.h>
#include <netinet/in.h>
#include <linux/if.h>
+#include <linux/if_addr.h>
#define NM_TYPE_PLATFORM (nm_platform_get_type ())
#define NM_PLATFORM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_PLATFORM, NMPlatform))
@@ -134,6 +135,7 @@ typedef struct {
guint32 timestamp;
guint32 lifetime;
guint32 preferred;
+ guint flags; /* ifa_flags from <linux/if_addr.h>, field type "unsigned int" is as used in rtnl_addr_get_flags. */
} NMPlatformIP6Address;
typedef struct {
@@ -281,7 +283,7 @@ typedef struct {
gboolean (*ip4_address_add) (NMPlatform *, int ifindex, in_addr_t address, int plen,
guint32 lifetime, guint32 preferred_lft);
gboolean (*ip6_address_add) (NMPlatform *, int ifindex, struct in6_addr address, int plen,
- guint32 lifetime, guint32 preferred_lft);
+ guint32 lifetime, guint32 preferred_lft, guint flags);
gboolean (*ip4_address_delete) (NMPlatform *, int ifindex, in_addr_t address, int plen);
gboolean (*ip6_address_delete) (NMPlatform *, int ifindex, struct in6_addr address, int plen);
gboolean (*ip4_address_exists) (NMPlatform *, int ifindex, in_addr_t address, int plen);
@@ -402,7 +404,7 @@ GArray *nm_platform_ip6_address_get_all (int ifindex);
gboolean nm_platform_ip4_address_add (int ifindex, in_addr_t address, int plen,
guint32 lifetime, guint32 preferred_lft);
gboolean nm_platform_ip6_address_add (int ifindex, struct in6_addr address, int plen,
- guint32 lifetime, guint32 preferred_lft);
+ guint32 lifetime, guint32 preferred_lft, guint flags);
gboolean nm_platform_ip4_address_delete (int ifindex, in_addr_t address, int plen);
gboolean nm_platform_ip6_address_delete (int ifindex, struct in6_addr address, int plen);
gboolean nm_platform_ip4_address_exists (int ifindex, in_addr_t address, int plen);
diff --git a/src/platform/tests/platform.c b/src/platform/tests/platform.c
index cd274cd..c0b2c02 100644
--- a/src/platform/tests/platform.c
+++ b/src/platform/tests/platform.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <string.h>
#include <arpa/inet.h>
+#include <netlink/route/addr.h>
#include "nm-platform.h"
#include "nm-linux-platform.h"
@@ -538,8 +539,9 @@ do_ip6_address_add (char **argv)
if (ifindex && parse_ip6_address (*argv++, &address, &plen)) {
guint32 lifetime = strtol (*argv++, NULL, 10);
guint32 preferred = strtol (*argv++, NULL, 10);
+ guint flags = (*argv) ? rtnl_addr_str2flags (*argv++) : 0;
- gboolean value = nm_platform_ip6_address_add (ifindex, address, plen, lifetime, preferred);
+ gboolean value = nm_platform_ip6_address_add (ifindex, address, plen, lifetime, preferred, flags);
return value;
} else
return FALSE;
@@ -765,7 +767,7 @@ static const command_t commands[] = {
{ "ip4-address-get-all", "print all IPv4 addresses", do_ip4_address_get_all, 1, "<ifname/ifindex>" },
{ "ip6-address-get-all", "print all IPv6 addresses", do_ip6_address_get_all, 1, "<ifname/ifindex>" },
{ "ip4-address-add", "add IPv4 address", do_ip4_address_add, 4, "<ifname/ifindex> <address>/<plen> <lifetime> <>" },
- { "ip6-address-add", "add IPv6 address", do_ip6_address_add, 4, "<ifname/ifindex> <address>/<plen> <lifetime> <>" },
+ { "ip6-address-add", "add IPv6 address", do_ip6_address_add, 4, "<ifname/ifindex> <address>/<plen> <lifetime> [<flags>] <>" },
{ "ip4-address-delete", "delete IPv4 address", do_ip4_address_delete, 2,
"<ifname/ifindex> <address>/<plen>" },
{ "ip6-address-delete", "delete IPv6 address", do_ip6_address_delete, 2,
diff --git a/src/platform/tests/test-address.c b/src/platform/tests/test-address.c
index ff11384..52952c3 100644
--- a/src/platform/tests/test-address.c
+++ b/src/platform/tests/test-address.c
@@ -109,20 +109,21 @@ test_ip6_address (void)
struct in6_addr addr;
guint32 lifetime = 2000;
guint32 preferred = 1000;
+ guint flags = 0;
inet_pton (AF_INET6, IP6_ADDRESS, &addr);
/* Add address */
g_assert (!nm_platform_ip6_address_exists (ifindex, addr, IP6_PLEN));
no_error ();
- g_assert (nm_platform_ip6_address_add (ifindex, addr, IP6_PLEN, lifetime, preferred));
+ g_assert (nm_platform_ip6_address_add (ifindex, addr, IP6_PLEN, lifetime, preferred, flags));
no_error ();
g_assert (nm_platform_ip6_address_exists (ifindex, addr, IP6_PLEN));
no_error ();
accept_signal (address_added);
/* Add address again (aka update) */
- g_assert (nm_platform_ip6_address_add (ifindex, addr, IP6_PLEN, lifetime, preferred));
+ g_assert (nm_platform_ip6_address_add (ifindex, addr, IP6_PLEN, lifetime, preferred, flags));
no_error ();
accept_signal (address_changed);
@@ -205,6 +206,7 @@ test_ip6_address_external (void)
struct in6_addr addr;
guint32 lifetime = 2000;
guint32 preferred = 1000;
+ guint flags = 0;
inet_pton (AF_INET6, IP6_ADDRESS, &addr);
@@ -220,7 +222,7 @@ test_ip6_address_external (void)
/* Add/delete conflict */
run_command ("ip address add %s/%d dev %s valid_lft %d preferred_lft %d",
IP6_ADDRESS, IP6_PLEN, DEVICE_NAME, lifetime, preferred);
- g_assert (nm_platform_ip6_address_add (ifindex, addr, IP6_PLEN, lifetime, preferred));
+ g_assert (nm_platform_ip6_address_add (ifindex, addr, IP6_PLEN, lifetime, preferred, flags));
no_error ();
g_assert (nm_platform_ip6_address_exists (ifindex, addr, IP6_PLEN));
accept_signal (address_added);
diff --git a/src/platform/tests/test-cleanup.c b/src/platform/tests/test-cleanup.c
index cbfebe7..f102870 100644
--- a/src/platform/tests/test-cleanup.c
+++ b/src/platform/tests/test-cleanup.c
@@ -23,6 +23,7 @@ test_cleanup_internal ()
int preferred = NM_PLATFORM_LIFETIME_PERMANENT;
int metric = 20;
int mss = 1000;
+ guint flags = 0;
inet_pton (AF_INET, "192.0.2.1", &addr4);
inet_pton (AF_INET, "192.0.3.0", &network4);
@@ -41,7 +42,7 @@ test_cleanup_internal ()
/* Add routes and addresses */
g_assert (nm_platform_ip4_address_add (ifindex, addr4, plen4, lifetime, preferred));
- g_assert (nm_platform_ip6_address_add (ifindex, addr6, plen6, lifetime, preferred));
+ g_assert (nm_platform_ip6_address_add (ifindex, addr6, plen6, lifetime, preferred, flags));
g_assert (nm_platform_ip4_route_add (ifindex, gateway4, 32, INADDR_ANY, metric, mss));
g_assert (nm_platform_ip4_route_add (ifindex, network4, plen4, gateway4, metric, mss));
g_assert (nm_platform_ip4_route_add (ifindex, 0, 0, gateway4, metric, mss));
--
1.8.4.2

View File

@ -1,51 +0,0 @@
From ec1cabde2872337a98b1f5fb8e1e9b8219548010 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Wed, 30 Oct 2013 22:39:32 +0100
Subject: [PATCH] core: fix error in print_vpn_config to print the route
correctly
ip_address_to_string returns a static buffer, need to make a copy
in this case.
Signed-off-by: Thomas Haller <thaller@redhat.com>
---
src/vpn-manager/nm-vpn-connection.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c
index a3074aa..7d3582a 100644
--- a/src/vpn-manager/nm-vpn-connection.c
+++ b/src/vpn-manager/nm-vpn-connection.c
@@ -576,11 +576,13 @@ print_vpn_config (NMVPNConnection *connection)
num = nm_ip4_config_get_num_routes (priv->ip4_config);
for (i = 0; i < num; i++) {
const NMPlatformIP4Route *route = nm_ip4_config_get_route (priv->ip4_config, i);
+ char *s = g_strdup (ip_address_to_string (route->gateway));
nm_log_info (LOGD_VPN, " Static Route: %s/%d Next Hop: %s",
ip_address_to_string (route->network),
route->plen,
- ip_address_to_string (route->gateway));
+ s);
+ g_free (s);
}
nm_log_info (LOGD_VPN, " Forbid Default Route: %s",
@@ -615,11 +617,13 @@ print_vpn_config (NMVPNConnection *connection)
num = nm_ip6_config_get_num_routes (priv->ip6_config);
for (i = 0; i < num; i++) {
const NMPlatformIP6Route *route = nm_ip6_config_get_route (priv->ip6_config, i);
+ char *s = g_strdup (ip6_address_to_string (&route->gateway));
nm_log_info (LOGD_VPN, " Static Route: %s/%d Next Hop: %s",
ip6_address_to_string (&route->network),
route->plen,
- ip6_address_to_string (&route->gateway));
+ s);
+ g_free (s);
}
nm_log_info (LOGD_VPN, " Forbid Default Route: %s",
--
1.8.4.2

View File

@ -1,62 +0,0 @@
commit 19b040236ec59fe8f9730d9da6d9262921d28936
Author: Thomas Haller <thaller@redhat.com>
Date: Wed Oct 30 20:18:58 2013 +0100
core: fix segfault in nm-policy when setting default route for vpn
nm_vpn_connection_get_ip6_internal_gateway might return NULL. In this
case, we add a device route (to gateway '::') over the vpn.
Before, in such a case, NM crashed with SEGFAULT.
https://bugzilla.redhat.com/show_bug.cgi?id=1019021
Signed-off-by: Thomas Haller <thaller@redhat.com>
diff --git a/src/nm-policy.c b/src/nm-policy.c
index 6d15e01..49c005c 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -860,12 +860,15 @@ update_ip6_routing (NMPolicy *policy, gboolean force_update)
int parent_ifindex = nm_device_get_ip_ifindex (parent);
NMIP6Config *parent_ip6 = nm_device_get_ip6_config (parent);
guint32 parent_mss = parent_ip6 ? nm_ip6_config_get_mss (parent_ip6) : 0;
- struct in6_addr int_gw = *nm_vpn_connection_get_ip6_internal_gateway (vpn);
+ const struct in6_addr *int_gw = nm_vpn_connection_get_ip6_internal_gateway (vpn);
int mss = nm_ip6_config_get_mss (ip6_config);
- if (!nm_platform_ip6_route_add (ip_ifindex, in6addr_any, 0, int_gw, 0, mss)) {
+ if (!int_gw)
+ int_gw = &in6addr_any;
+
+ if (!nm_platform_ip6_route_add (ip_ifindex, in6addr_any, 0, *int_gw, 0, mss)) {
nm_platform_ip6_route_add (parent_ifindex, *gw_addr, 128, in6addr_any, 0, parent_mss);
- if (!nm_platform_ip6_route_add (ip_ifindex, in6addr_any, 0, int_gw, 0, mss)) {
+ if (!nm_platform_ip6_route_add (ip_ifindex, in6addr_any, 0, *int_gw, 0, mss)) {
nm_log_err (LOGD_IP6 | LOGD_VPN, "Failed to set default route.");
}
}
commit 886ca75ac33de252158a63074cc7cf9d0215c962
Author: Thomas Haller <thaller@redhat.com>
Date: Fri Nov 1 10:57:18 2013 +0100
core: fix crash when reading routes from VPN Ip6Config (bgo #706332)
https://bugzilla.gnome.org/show_bug.cgi?id=706332
Reported-by: Nicolas Iooss <nicolas.iooss.2010_nm@m4x.org>
Signed-off-by: Thomas Haller <thaller@redhat.com>
diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c
index 6962e30..263f253 100644
--- a/src/vpn-manager/nm-vpn-connection.c
+++ b/src/vpn-manager/nm-vpn-connection.c
@@ -1084,7 +1084,7 @@ nm_vpn_connection_ip6_config_get (DBusGProxy *proxy,
* the VPN server, we want to use the NM created route instead of
* whatever the server provides.
*/
- if (IN6_ARE_ADDR_EQUAL (&route.network, priv->ip6_external_gw) && route.plen == 128)
+ if (priv->ip6_external_gw && IN6_ARE_ADDR_EQUAL (&route.network, priv->ip6_external_gw) && route.plen == 128)
continue;
/* Otherwise accept the VPN-provided route */

View File

@ -1,19 +0,0 @@
commit 0a557ac01d28340e43247eef52007a8b18bb24d8
Author: Dan Winship <danw@gnome.org>
Date: Thu Oct 24 15:15:02 2013 -0400
core: fix crash when activating a never-default IPv4 connection
diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c
index 81c003e..ed1728d 100644
--- a/src/nm-ip4-config.c
+++ b/src/nm-ip4-config.c
@@ -583,7 +583,7 @@ nm_ip4_config_replace (NMIP4Config *dst, const NMIP4Config *src, gboolean *relev
/* never_default */
if (src_priv->never_default != dst_priv->never_default) {
dst_priv->never_default = src_priv->never_default;
- has_relevant_changes = TRUE;
+ has_minor_changes = TRUE;
}
/* default gateway */

View File

@ -1,55 +0,0 @@
commit 912152cf85d29db45f706522c8e3ce13eaf13197
Author: Jiří Klimeš <jklimes@redhat.com>
Date: Tue Oct 29 15:02:30 2013 +0100
ifcfg-rh: fix crash when doing managed->unmanaged transition
Testcase:
* add 'NM_CONTROLLED=no' to /etc/sysconfig/network-scripts/ifcfg-ABC
* sudo nmcli con reload
* ... NM asserts ...
We need to ref() 'existing' connection before nm_settings_connection_signal_remove(),
because the function unref()s ithe connection via connection_removed_cb().
Backtrace:
...
#4 0x00007fbcf0ea0cba in g_assertion_message_expr (domain=domain@entry=0x0,
file=file@entry=0x7fbcf4e5805d "nm-dbus-manager.c", line=line@entry=848,
func=func@entry=0x7fbcf4e585e0 <__FUNCTION__.15088> "nm_dbus_manager_unregister_object", expr=expr@entry=0x7fbcf4e5820b "G_IS_OBJECT (object)")
at gtestutils.c:2293
#5 0x00007fbcf4de69d9 in nm_dbus_manager_unregister_object (
self=0x7fbcf6fdc9c0, object=0x7fbcf70235c0) at nm-dbus-manager.c:848
#6 0x00007fbcf4dd6a23 in nm_settings_connection_signal_remove (
self=<optimized out>) at settings/nm-settings-connection.c:1541
#7 0x00007fbce6fee884 in connection_new_or_changed (
self=self@entry=0x7fbcf7006f80,
path=path@entry=0x7fbcf70c3f80 "/etc/sysconfig/network-scripts/ifcfg-ABC",
existing=existing@entry=0x7fbcf70235c0,
out_old_path=out_old_path@entry=0x7fff2b7b8988) at plugin.c:327
#8 0x00007fbce6feeca2 in read_connections (plugin=0x7fbcf7006f80)
at plugin.c:453
#9 0x00007fbcf4dd8e98 in impl_settings_reload_connections (
self=0x7fbcf6fd98c0, context=0x7fbcf70bcb30) at settings/nm-settings.c:1262
...
diff --git a/src/settings/plugins/ifcfg-rh/plugin.c b/src/settings/plugins/ifcfg-rh/plugin.c
index dbfc496..5cd24b0 100644
--- a/src/settings/plugins/ifcfg-rh/plugin.c
+++ b/src/settings/plugins/ifcfg-rh/plugin.c
@@ -320,6 +320,7 @@ connection_new_or_changed (SCPluginIfcfg *self,
if (new_unmanaged) {
if (!old_unmanaged) {
+ g_object_ref (existing);
/* Unexport the connection by telling the settings service it's
* been removed, and notify the settings service by signalling that
* unmanaged specs have changed.
@@ -331,6 +332,7 @@ connection_new_or_changed (SCPluginIfcfg *self,
g_object_set (existing, NM_IFCFG_CONNECTION_UNMANAGED, new_unmanaged, NULL);
g_signal_emit_by_name (self, NM_SYSTEM_CONFIG_INTERFACE_UNMANAGED_SPECS_CHANGED);
+ g_object_unref (existing);
}
} else {
if (old_unmanaged) { /* now managed */

View File

@ -1,35 +0,0 @@
commit 25428882839ff17c531887bfc58f6669c9708fc8
Author: Thomas Haller <thaller@redhat.com>
Date: Thu Oct 31 12:42:01 2013 +0100
ifcfg-rh: fix crash when reading connection (assert in connection_new_or_changed)
rh #1025007 reports a crash on g_assert_no_error() in
connection_new_or_changed() of src/settings/plugins/ifcfg-rh/plugin.c.
From the back trace I am not 100% sure, what the problem was, but I
think that nm_settings_connection_replace_settings failed because of
nm_connection_update_secrets. Apparently such a situation can
happen and it should simply be accepted as valid.
What might have happened, is that the connection used to have
secrets (maybe it had 802.1x configured?) and then it got changed,
so update_secrets() fails because the connection no longer has a
setting to which the secrets would apply.
https://bugzilla.redhat.com/show_bug.cgi?id=1025007
Signed-off-by: Thomas Haller <thaller@redhat.com>
diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c
index 59b29ad..7dce397 100644
--- a/src/settings/nm-settings-connection.c
+++ b/src/settings/nm-settings-connection.c
@@ -462,7 +462,7 @@ nm_settings_connection_replace_settings (NMSettingsConnection *self,
if (priv->agent_secrets) {
hash = nm_connection_to_hash (priv->agent_secrets, NM_SETTING_HASH_FLAG_ONLY_SECRETS);
if (hash) {
- success = nm_connection_update_secrets (NM_CONNECTION (self), NULL, hash, error);
+ nm_connection_update_secrets (NM_CONNECTION (self), NULL, hash, NULL);
g_hash_table_destroy (hash);
}
}

View File

@ -1,92 +0,0 @@
From 788eed99de51cd35adeb6585379b5e920c79b3f3 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Fri, 1 Nov 2013 10:32:27 +0100
Subject: [PATCH] core: workaround crash when connecting to wifi (rh #1025371)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
rh #1025371 reports a crash in handle_ip_config_timeout() because
nm_device_wifi_get_activation_ap() did not return any access point.
The handling of the AP in nm-device-wifi.c should be reworked and soon
will be fixed. For now, play it safe, and try to cope with any cases
where nm_device_wifi_get_activation_ap() might return NULL.
Later, this patch should be reverted and handling of the AP properly
cleaned up.
https://bugzilla.redhat.com/show_bug.cgi?id=1025371
Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
src/devices/nm-device-wifi.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/devices/nm-device-wifi.c b/src/devices/nm-device-wifi.c
index 855c1e7..6c19d62 100644
--- a/src/devices/nm-device-wifi.c
+++ b/src/devices/nm-device-wifi.c
@@ -2313,7 +2313,7 @@ supplicant_iface_state_cb (NMSupplicantInterface *iface,
*/
if (devstate == NM_DEVICE_STATE_CONFIG) {
NMAccessPoint *ap = nm_device_wifi_get_activation_ap (self);
- const GByteArray *ssid = nm_ap_get_ssid (ap);
+ const GByteArray *ssid = ap ? nm_ap_get_ssid (ap) : NULL;
nm_log_info (LOGD_DEVICE | LOGD_WIFI,
"Activation (%s/wireless) Stage 2 of 5 (Device Configure) "
@@ -2593,9 +2593,8 @@ supplicant_connection_timeout_cb (gpointer user_data)
g_assert (priv->mode == NM_802_11_MODE_INFRA);
ap = nm_device_wifi_get_activation_ap (self);
- g_assert (ap);
- if (priv->ssid_found && is_encrypted (ap, connection)) {
+ if (priv->ssid_found && ap && is_encrypted (ap, connection)) {
guint64 timestamp = 0;
gboolean new_secrets = TRUE;
@@ -2944,7 +2943,11 @@ act_stage2_config (NMDevice *dev, NMDeviceStateReason *reason)
g_assert (req);
ap = nm_device_wifi_get_activation_ap (self);
- g_assert (ap);
+ if (!ap) {
+ nm_log_warn (LOGD_DEVICE | LOGD_WIFI, "act_stage2_config failed due to unexpected missing activation_ap. Abort");
+ *reason = NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT;
+ goto out;
+ }
connection = nm_act_request_get_connection (req);
g_assert (connection);
@@ -3102,7 +3105,6 @@ handle_ip_config_timeout (NMDeviceWifi *self,
}
ap = nm_device_wifi_get_activation_ap (self);
- g_assert (ap);
/* If IP configuration times out and it's a static WEP connection, that
* usually means the WEP key is wrong. WEP's Open System auth mode has
@@ -3111,7 +3113,7 @@ handle_ip_config_timeout (NMDeviceWifi *self,
* types (open, WPA, 802.1x, etc) if the secrets/certs were wrong the
* connection would have failed before IP configuration.
*/
- if (is_static_wep (ap, connection) && (may_fail == FALSE)) {
+ if (ap && is_static_wep (ap, connection) && (may_fail == FALSE)) {
/* Activation failed, we must have bad encryption key */
nm_log_warn (LOGD_DEVICE | LOGD_WIFI,
"Activation (%s/wireless): could not get IP configuration for "
@@ -3203,7 +3205,7 @@ activation_success_handler (NMDevice *dev)
/* If the AP isn't fake, it was found in the scan list and all its
* details are known.
*/
- if (!nm_ap_get_fake (ap))
+ if (!ap || !nm_ap_get_fake (ap))
goto done;
/* If the activate AP was fake, it probably won't have a BSSID at all.
--
1.7.11.7

View File

@ -1,73 +0,0 @@
From 696f655d7c7b605d0344aeb6ba4ff643cd46a5b4 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Mon, 11 Nov 2013 15:43:13 -0600
Subject: [PATCH] ethernet: don't crash if device doesn't have a MAC address
(rh #1029053)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Like IBM s390 CTC devices, which aren't really ethernet but for
historical reasons we treat them as such.
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
Updated to apply for Fedora 20 snapshot.
---
src/devices/nm-device-ethernet.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c
index 7b1c248..c0b7861 100644
--- a/src/devices/nm-device-ethernet.c
+++ b/src/devices/nm-device-ethernet.c
@@ -310,6 +310,7 @@ update_permanent_hw_address (NMDevice *dev)
struct ifreq req;
struct ethtool_perm_addr *epaddr = NULL;
int fd, ret;
+ const guint8 *mac;
fd = socket (PF_INET, SOCK_DGRAM, 0);
if (fd < 0) {
@@ -332,7 +333,11 @@ update_permanent_hw_address (NMDevice *dev)
nm_log_dbg (LOGD_HW | LOGD_ETHER, "(%s): unable to read permanent MAC address (error %d)",
nm_device_get_iface (dev), errno);
/* Fall back to current address */
- memcpy (epaddr->data, nm_device_get_hw_address (dev, NULL), ETH_ALEN);
+ mac = nm_device_get_hw_address (dev, NULL);
+ if (mac)
+ memcpy (epaddr->data, mac, ETH_ALEN);
+ else
+ memset (epaddr->data, 0, ETH_ALEN);
}
if (memcmp (&priv->perm_hw_addr, epaddr->data, ETH_ALEN)) {
@@ -350,11 +355,14 @@ update_initial_hw_address (NMDevice *dev)
NMDeviceEthernet *self = NM_DEVICE_ETHERNET (dev);
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (self);
char *mac_str;
+ const guint8 *mac;
/* This sets initial MAC address from current MAC address. It should only
* be called from NMDevice constructor() to really get the initial address.
*/
- memcpy (priv->initial_hw_addr, nm_device_get_hw_address (dev, NULL), ETH_ALEN);
+ mac = nm_device_get_hw_address (dev, NULL);
+ if (mac)
+ memcpy (priv->initial_hw_addr, mac, ETH_ALEN);
mac_str = nm_utils_hwaddr_ntoa (priv->initial_hw_addr, ARPHRD_ETHER);
nm_log_dbg (LOGD_DEVICE | LOGD_ETHER, "(%s): read initial MAC address %s",
@@ -1219,7 +1219,7 @@ update_connection (NMDevice *device, NMConnection *connection)
{
NMSettingWired *s_wired = nm_connection_get_setting_wired (connection);
guint maclen;
- gconstpointer mac = nm_device_get_hw_address (device, &maclen);
+ const guint8 *mac = nm_device_get_hw_address (device, &maclen);
if (!s_wired) {
s_wired = (NMSettingWired *) nm_setting_wired_new ();
--
1.7.11.7

View File

@ -1,50 +0,0 @@
From 2086cab1273b26630840e3a0c092e8b1617e803b Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Wed, 13 Nov 2013 20:06:39 -0600
Subject: [PATCH] platform: dump objects that fail to be added (rh #1029213)
Attempt to figure out why the objects fail.
---
src/platform/nm-linux-platform.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index a35b0cc..d13abbe 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -1100,27 +1100,32 @@ refresh_object (NMPlatform *platform, struct nl_object *object, gboolean removed
/* Decreases the reference count if @obj for convenience */
static gboolean
add_object (NMPlatform *platform, struct nl_object *obj)
{
auto_nl_object struct nl_object *object = obj;
NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
int nle;
+ struct nl_dump_params dp = {
+ .dp_type = NL_DUMP_DETAILS,
+ .dp_fd = stderr,
+ };
nle = add_kernel_object (priv->nlh, object);
/* NLE_EXIST is considered equivalent to success to avoid race conditions. You
* never know when something sends an identical object just before
* NetworkManager.
*/
switch (nle) {
case -NLE_SUCCESS:
case -NLE_EXIST:
break;
default:
error ("Netlink error: %s", nl_geterror (nle));
+ nl_object_dump (object, &dp);
return FALSE;
}
return refresh_object (platform, object, FALSE, NM_PLATFORM_REASON_INTERNAL);
}
/* Decreases the reference count if @obj for convenience */
--
1.8.3.1

View File

@ -1,98 +0,0 @@
From 8586353b09460ec0a619058421743dd7d424a75d Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Wed, 20 Nov 2013 13:40:07 -0600
Subject: [PATCH] core: ignore RA-provided default routes (rh #1029213)
The router has no idea what the local configuration or user preferences are,
so sending routes with a prefix length of 0 is at best misinformed and at
worst breaks things. The kernel also ignores plen=0 routes in its in-kernel
RA processing code in net/ipv6/ndisc.c.
https://bugzilla.redhat.com/show_bug.cgi?id=1029213
---
src/devices/nm-device.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index f03ecbb..d92a94b 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -3283,20 +3283,26 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *device
/* Rebuild route list from router discovery cache. */
nm_ip6_config_reset_routes (priv->ac_ip6_config);
for (i = 0; i < rdisc->routes->len; i++) {
NMRDiscRoute *discovered_route = &g_array_index (rdisc->routes, NMRDiscRoute, i);
NMPlatformIP6Route route;
- memset (&route, 0, sizeof (route));
- route.network = discovered_route->network;
- route.plen = discovered_route->plen;
- route.gateway = discovered_route->gateway;
+ /* Only accept non-default routes. The router has no idea what the
+ * local configuration or user preferences are, so sending routes
+ * with a prefix length of 0 is quite rude and thus ignored.
+ */
+ if (discovered_route->plen > 0) {
+ memset (&route, 0, sizeof (route));
+ route.network = discovered_route->network;
+ route.plen = discovered_route->plen;
+ route.gateway = discovered_route->gateway;
- nm_ip6_config_add_route (priv->ac_ip6_config, &route);
+ nm_ip6_config_add_route (priv->ac_ip6_config, &route);
+ }
}
}
if (changed & NM_RDISC_CONFIG_DNS_SERVERS) {
/* Rebuild DNS server list from router discovery cache. */
nm_ip6_config_reset_nameservers (priv->ac_ip6_config);
--
1.8.3.1
From 6e73f01b6e69f44f8d9da4872fb796b9d80acac1 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Tue, 3 Dec 2013 14:12:55 -0600
Subject: [PATCH] platform: fix possible out-of-bounds access with RA route
masking
If the prefix length was 128, that could cause an access beyond the
end of the array. Found by Thomas Haller.
---
src/rdisc/nm-lndp-rdisc.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/rdisc/nm-lndp-rdisc.c b/src/rdisc/nm-lndp-rdisc.c
index abcc3c2..3299b32 100644
--- a/src/rdisc/nm-lndp-rdisc.c
+++ b/src/rdisc/nm-lndp-rdisc.c
@@ -411,17 +411,21 @@ set_address_masked (struct in6_addr *dst, struct in6_addr *src, guint8 plen)
guint nbytes = plen / 8;
guint nbits = plen % 8;
g_return_if_fail (plen <= 128);
g_assert (src);
g_assert (dst);
- memset (dst, 0, sizeof (*dst));
- memcpy (dst, src, nbytes);
- dst->s6_addr[nbytes] = (src->s6_addr[nbytes] & (0xFF << (8 - nbits)));
+ if (plen >= 128)
+ *dst = *src;
+ else {
+ memset (dst, 0, sizeof (*dst));
+ memcpy (dst, src, nbytes);
+ dst->s6_addr[nbytes] = (src->s6_addr[nbytes] & (0xFF << (8 - nbits)));
+ }
}
static int
receive_ra (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data)
{
NMRDisc *rdisc = (NMRDisc *) user_data;
NMLNDPRDiscPrivate *priv = NM_LNDP_RDISC_GET_PRIVATE (rdisc);
--
1.8.3.1

View File

@ -1,45 +0,0 @@
From fbcabeb7f72b710a790ca8617f7406a1ba7cf5be Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Mon, 18 Nov 2013 22:20:05 +0100
Subject: [PATCH] libnm-glib: fix crash by taking additional ref in
nm-remote-connection/result_cb
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
result_cb invokes a function pointer provided by the user. Nothing prevents
the user from destroying the NMRemoteConnection in the callback, which leads
to a crash. Take an additional ref of NMRemoteConnection to keep it
alive.
This probably caused a crash for nm-applet:
https://bugzilla.redhat.com/show_bug.cgi?id=1030403
Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
libnm-glib/nm-remote-connection.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libnm-glib/nm-remote-connection.c b/libnm-glib/nm-remote-connection.c
index a03a44b..73a2cc8 100644
--- a/libnm-glib/nm-remote-connection.c
+++ b/libnm-glib/nm-remote-connection.c
@@ -137,12 +137,14 @@ result_cb (DBusGProxy *proxy, DBusGProxyCall *proxy_call, gpointer user_data)
RemoteCall *call = user_data;
NMRemoteConnectionResultFunc func = (NMRemoteConnectionResultFunc) call->callback;
GError *error = NULL;
+ NMRemoteConnection *self = g_object_ref (call->self);
dbus_g_proxy_end_call (proxy, proxy_call, &error, G_TYPE_INVALID);
if (func)
(*func) (call->self, error, call->user_data);
g_clear_error (&error);
remote_call_complete (call->self, call);
+ g_object_unref (self);
}
/**
--
1.7.11.7

View File

@ -1,99 +0,0 @@
From 8a046bedbbf8218737d7471f949a541b35579539 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Fri, 11 Oct 2013 18:25:20 +0200
Subject: [PATCH] core: fix crash for bridge-slave with missing
NMSettingBridgePort setting
Signed-off-by: Thomas Haller <thaller@redhat.com>
---
src/devices/nm-device-bridge.c | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c
index 69e976c..2018e93 100644
--- a/src/devices/nm-device-bridge.c
+++ b/src/devices/nm-device-bridge.c
@@ -203,7 +203,7 @@ static const Option slave_options[] = {
};
static void
-commit_option (NMDevice *device, GObject *setting, const Option *option, gboolean slave)
+commit_option (NMDevice *device, NMSetting *setting, const Option *option, gboolean slave)
{
int ifindex = nm_device_get_ifindex (device);
GParamSpec *pspec;
@@ -211,12 +211,14 @@ commit_option (NMDevice *device, GObject *setting, const Option *option, gboolea
guint32 uval = 0;
gs_free char *value = NULL;
+ g_assert (setting);
+
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (setting), option->name);
g_assert (pspec);
/* Get the property's value */
g_value_init (&val, G_PARAM_SPEC_VALUE_TYPE (pspec));
- g_object_get_property (setting, option->name, &val);
+ g_object_get_property ((GObject *) setting, option->name, &val);
if (G_VALUE_HOLDS_BOOLEAN (&val))
uval = g_value_get_boolean (&val) ? 1 : 0;
else if (G_VALUE_HOLDS_UINT (&val)) {
@@ -251,25 +253,30 @@ commit_option (NMDevice *device, GObject *setting, const Option *option, gboolea
}
static void
-commit_master_options (NMDevice *device, GObject *setting)
+commit_master_options (NMDevice *device, NMSettingBridge *setting)
{
const Option *option;
-
- g_assert (setting);
+ NMSetting *s = NM_SETTING (setting);
for (option = master_options; option->name; option++)
- commit_option (device, setting, option, FALSE);
+ commit_option (device, s, option, FALSE);
}
static void
-commit_slave_options (NMDevice *device, GObject *setting)
+commit_slave_options (NMDevice *device, NMSettingBridgePort *setting)
{
const Option *option;
+ NMSetting *s, *s_clear = NULL;
- g_assert (setting);
+ if (setting)
+ s = NM_SETTING (setting);
+ else
+ s = s_clear = nm_setting_bridge_port_new ();
for (option = slave_options; option->name; option++)
- commit_option (device, setting, option, TRUE);
+ commit_option (device, s, option, TRUE);
+
+ g_clear_object (&s_clear);
}
static NMActStageReturn
@@ -284,7 +291,7 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason)
if (ret != NM_ACT_STAGE_RETURN_SUCCESS)
return ret;
- commit_master_options (device, (GObject *) nm_connection_get_setting_bridge (connection));
+ commit_master_options (device, nm_connection_get_setting_bridge (connection));
return NM_ACT_STAGE_RETURN_SUCCESS;
}
@@ -295,7 +302,7 @@ enslave_slave (NMDevice *device, NMDevice *slave, NMConnection *connection)
if (!nm_platform_link_enslave (nm_device_get_ip_ifindex (device), nm_device_get_ip_ifindex (slave)))
return FALSE;
- commit_slave_options (slave, (GObject *) nm_connection_get_setting_bridge_port (connection));
+ commit_slave_options (slave, nm_connection_get_setting_bridge_port (connection));
nm_log_info (LOGD_BRIDGE, "(%s): attached bridge port %s",
nm_device_get_ip_iface (device),
--
1.8.4.2

View File

@ -1,86 +0,0 @@
From 7eb12a5b21f87d7592ec2c5235d1ed90c4fac132 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Tue, 3 Dec 2013 11:42:28 -0600
Subject: [PATCH] platform: set IPv4 broadcast address too (rh #1032819)
When moving over the platform, setting of the IPv4 broadcast address
got lost. Bring it back.
https://bugzilla.redhat.com/show_bug.cgi?id=1032819
---
src/platform/nm-linux-platform.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index 8f0e077..3f57925 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -2213,14 +2213,33 @@ ip6_address_get_all (NMPlatform *platform, int ifindex)
nl_object_unmark (object);
}
}
return addresses;
}
+static void
+addr4_to_broadcast (struct in_addr *dst, const struct in_addr *src, guint8 plen)
+{
+ guint nbytes = plen / 8;
+ guint nbits = plen % 8;
+
+ g_return_if_fail (plen <= 32);
+ g_assert (src);
+ g_assert (dst);
+
+ if (plen >= 32)
+ *dst = *src;
+ else {
+ dst->s_addr = 0xFFFFFFFF;
+ memcpy (dst, src, nbytes);
+ ((guint8 *) dst)[nbytes] = (((const guint8 *) src)[nbytes] | (0xFF >> nbits));
+ }
+}
+
static struct nl_object *
build_rtnl_addr (int family,
int ifindex,
gconstpointer addr,
gconstpointer peer_addr,
int plen,
guint32 lifetime,
@@ -2230,18 +2249,31 @@ build_rtnl_addr (int family,
struct rtnl_addr *rtnladdr = rtnl_addr_alloc ();
int addrlen = family == AF_INET ? sizeof (in_addr_t) : sizeof (struct in6_addr);
auto_nl_addr struct nl_addr *nladdr = nl_addr_build (family, addr, addrlen);
int nle;
g_assert (rtnladdr && nladdr);
+ /* IP address */
rtnl_addr_set_ifindex (rtnladdr, ifindex);
nle = rtnl_addr_set_local (rtnladdr, nladdr);
g_assert (!nle);
+ /* IPv4 Broadcast address */
+ if (family == AF_INET) {
+ struct in_addr bcast;
+ auto_nl_addr struct nl_addr *bcaddr = NULL;
+
+ addr4_to_broadcast (&bcast, addr, plen);
+ bcaddr = nl_addr_build (family, &bcast, addrlen);
+ g_assert (bcaddr);
+ rtnl_addr_set_broadcast (rtnladdr, bcaddr);
+ }
+
+ /* Peer/point-to-point address */
if (peer_addr) {
auto_nl_addr struct nl_addr *nlpeer = nl_addr_build (family, peer_addr, addrlen);
nle = rtnl_addr_set_peer (rtnladdr, nlpeer);
g_assert (!nle);
}
--
1.8.3.1

View File

@ -1,833 +0,0 @@
From 07281f21a71fa333288821ad863accfeedfff567 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Mon, 9 Dec 2013 12:55:04 -0600
Subject: [PATCH] core: delay startup complete until carrier is found or
timeout (rh #1034921) (rh #1030583)
---
src/devices/nm-device.c | 177 ++++++++++++++++++++++++++++++++++-----------
src/nm-active-connection.c | 8 ++
2 files changed, 142 insertions(+), 43 deletions(-)
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 578ccb0..96a5d44 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -184,15 +184,15 @@ typedef struct {
gboolean initialized;
gboolean in_state_changed;
NMDeviceState state;
NMDeviceStateReason state_reason;
QueuedState queued_state;
guint queued_ip_config_id;
- guint pending_actions;
+ GArray *pending_actions;
char * udi;
char * path;
char * iface; /* may change, could be renamed by user */
int ifindex;
gboolean is_software;
char * ip_iface;
@@ -224,14 +224,15 @@ typedef struct {
gpointer act_source6_func;
/* Link stuff */
guint link_connected_id;
guint link_disconnected_id;
guint carrier_defer_id;
gboolean carrier;
+ guint carrier_wait_id;
gboolean ignore_carrier;
/* Generic DHCP stuff */
NMDHCPManager * dhcp_manager;
guint32 dhcp_timeout;
GByteArray * dhcp_anycast_address;
@@ -390,14 +391,15 @@ nm_device_init (NMDevice *self)
priv->capabilities = NM_DEVICE_CAP_NM_SUPPORTED;
priv->state = NM_DEVICE_STATE_UNMANAGED;
priv->state_reason = NM_DEVICE_STATE_REASON_NONE;
priv->dhcp_timeout = 0;
priv->rfkill_type = RFKILL_TYPE_UNKNOWN;
priv->autoconnect = DEFAULT_AUTOCONNECT;
priv->available_connections = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, NULL);
+ priv->pending_actions = g_array_sized_new (FALSE, TRUE, sizeof (GQuark), 5);
}
static void
update_accept_ra_save (NMDevice *self)
{
NMDevicePrivate *priv;
const char *ip_iface;
@@ -1154,14 +1156,20 @@ nm_device_set_carrier (NMDevice *device, gboolean carrier)
if (priv->carrier) {
nm_log_info (LOGD_DEVICE, "(%s): link connected", iface);
if (priv->carrier_defer_id) {
g_source_remove (priv->carrier_defer_id);
priv->carrier_defer_id = 0;
}
klass->carrier_changed (device, TRUE);
+
+ if (priv->carrier_wait_id) {
+ g_source_remove (priv->carrier_wait_id);
+ priv->carrier_wait_id = 0;
+ nm_device_remove_pending_action (device, "carrier wait");
+ }
} else if (state <= NM_DEVICE_STATE_DISCONNECTED) {
nm_log_info (LOGD_DEVICE, "(%s): link disconnected", iface);
klass->carrier_changed (device, FALSE);
} else {
nm_log_info (LOGD_DEVICE, "(%s): link disconnected (deferring action for %d seconds)",
iface, LINK_DISCONNECT_DELAY);
priv->carrier_defer_id = g_timeout_add_seconds (LINK_DISCONNECT_DELAY,
@@ -5110,17 +5118,28 @@ nm_device_start_ip_check (NMDevice *self)
/* If no ping was started, just advance to SECONDARIES */
if (!priv->gw_ping.pid)
nm_device_queue_state (self, NM_DEVICE_STATE_SECONDARIES, NM_DEVICE_STATE_REASON_NONE);
}
/****************************************************************/
+static gboolean
+carrier_wait_timeout (gpointer user_data)
+{
+ NMDevice *self = NM_DEVICE (user_data);
+
+ NM_DEVICE_GET_PRIVATE (self)->carrier_wait_id = 0;
+ nm_device_remove_pending_action (self, "carrier wait");
+ return G_SOURCE_REMOVE;
+}
+
gboolean
nm_device_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware)
{
+ NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
gboolean success;
guint32 tries = 0;
g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
if (nm_device_is_up (self))
goto out;
@@ -5138,14 +5157,28 @@ nm_device_bring_up (NMDevice *self, gboolean block, gboolean *no_firmware)
g_usleep (200);
if (!nm_device_is_up (self)) {
nm_log_warn (LOGD_HW, "(%s): device not up after timeout!", nm_device_get_iface (self));
return FALSE;
}
+ /* Devices that support carrier detect must be IFF_UP to report carrier
+ * changes; so after setting the device IFF_UP we must suppress startup
+ * complete (via a pending action) until either the carrier turns on, or
+ * a timeout is reached.
+ */
+ if (device_has_capability (self, NM_DEVICE_CAP_CARRIER_DETECT)) {
+ if (priv->carrier_wait_id) {
+ g_source_remove (priv->carrier_wait_id);
+ nm_device_remove_pending_action (self, "carrier wait");
+ }
+ priv->carrier_wait_id = g_timeout_add_seconds (5, carrier_wait_timeout, self);
+ nm_device_add_pending_action (self, "carrier wait");
+ }
+
out:
/* Can only get HW address of some devices when they are up */
nm_device_update_hw_address (self);
_update_ip4_address (self);
return TRUE;
}
@@ -5301,14 +5334,19 @@ dispose (GObject *object)
}
if (priv->cp_updated_id) {
g_signal_handler_disconnect (priv->con_provider, priv->cp_updated_id);
priv->cp_updated_id = 0;
}
+ if (priv->carrier_wait_id) {
+ g_source_remove (priv->carrier_wait_id);
+ priv->carrier_wait_id = 0;
+ }
+
g_hash_table_unref (priv->available_connections);
priv->available_connections = NULL;
activation_source_clear (self, TRUE, AF_INET);
activation_source_clear (self, TRUE, AF_INET6);
clear_act_request (self);
@@ -5331,14 +5369,17 @@ finalize (GObject *object)
if (priv->dhcp_manager)
g_object_unref (priv->dhcp_manager);
if (priv->fw_manager)
g_object_unref (priv->fw_manager);
+ g_array_free (priv->pending_actions, TRUE);
+ priv->pending_actions = NULL;
+
g_free (priv->udi);
g_free (priv->path);
g_free (priv->iface);
g_free (priv->ip_iface);
g_free (priv->driver);
g_free (priv->driver_version);
g_free (priv->firmware_version);
@@ -5931,46 +5972,54 @@ nm_device_set_firmware_missing (NMDevice *self, gboolean new_missing)
gboolean
nm_device_get_firmware_missing (NMDevice *self)
{
return NM_DEVICE_GET_PRIVATE (self)->firmware_missing;
}
+#define QUEUED_PREFIX "queued state change to "
+
static const char *
-state_to_string (NMDeviceState state)
+queued_state_to_string (NMDeviceState state)
{
switch (state) {
case NM_DEVICE_STATE_UNMANAGED:
- return "unmanaged";
+ return QUEUED_PREFIX "unmanaged";
case NM_DEVICE_STATE_UNAVAILABLE:
- return "unavailable";
+ return QUEUED_PREFIX "unavailable";
case NM_DEVICE_STATE_DISCONNECTED:
- return "disconnected";
+ return QUEUED_PREFIX "disconnected";
case NM_DEVICE_STATE_PREPARE:
- return "prepare";
+ return QUEUED_PREFIX "prepare";
case NM_DEVICE_STATE_CONFIG:
- return "config";
+ return QUEUED_PREFIX "config";
case NM_DEVICE_STATE_NEED_AUTH:
- return "need-auth";
+ return QUEUED_PREFIX "need-auth";
case NM_DEVICE_STATE_IP_CONFIG:
- return "ip-config";
+ return QUEUED_PREFIX "ip-config";
case NM_DEVICE_STATE_IP_CHECK:
- return "ip-check";
+ return QUEUED_PREFIX "ip-check";
case NM_DEVICE_STATE_SECONDARIES:
- return "secondaries";
+ return QUEUED_PREFIX "secondaries";
case NM_DEVICE_STATE_ACTIVATED:
- return "activated";
+ return QUEUED_PREFIX "activated";
case NM_DEVICE_STATE_DEACTIVATING:
- return "deactivating";
+ return QUEUED_PREFIX "deactivating";
case NM_DEVICE_STATE_FAILED:
- return "failed";
+ return QUEUED_PREFIX "failed";
default:
break;
}
- return "unknown";
+ return QUEUED_PREFIX "unknown";
+}
+
+static const char *
+state_to_string (NMDeviceState state)
+{
+ return queued_state_to_string (state) + strlen (QUEUED_PREFIX);
}
static const char *
reason_to_string (NMDeviceStateReason reason)
{
switch (reason) {
case NM_DEVICE_STATE_REASON_NONE:
@@ -6083,21 +6132,14 @@ reason_to_string (NMDeviceStateReason reason)
return "secondary-connection-failed";
default:
break;
}
return "unknown";
}
-static inline gboolean
-state_implies_pending_action (NMDeviceState state)
-{
- return ( state >= NM_DEVICE_STATE_PREPARE
- && state < NM_DEVICE_STATE_ACTIVATED);
-}
-
void
nm_device_state_changed (NMDevice *device,
NMDeviceState state,
NMDeviceStateReason reason)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device);
NMDeviceState old_state;
@@ -6131,18 +6173,14 @@ nm_device_state_changed (NMDevice *device,
return;
}
old_state = priv->state;
priv->state = state;
priv->state_reason = reason;
- if ( state_implies_pending_action (state)
- && !state_implies_pending_action (old_state))
- nm_device_add_pending_action (device, "activation");
-
nm_log_info (LOGD_DEVICE, "(%s): device state change: %s -> %s (reason '%s') [%d %d %d]",
nm_device_get_iface (device),
state_to_string (old_state),
state_to_string (state),
reason_to_string (reason),
old_state,
state,
@@ -6300,18 +6338,14 @@ nm_device_state_changed (NMDevice *device,
if (old_state == NM_DEVICE_STATE_ACTIVATED)
nm_dispatcher_call (DISPATCHER_ACTION_DOWN, nm_act_request_get_connection (req), device, NULL, NULL);
/* Dispose of the cached activation request */
if (req)
g_object_unref (req);
- if ( state_implies_pending_action (old_state)
- && !state_implies_pending_action (state))
- nm_device_remove_pending_action (device, "activation");
-
priv->in_state_changed = FALSE;
}
static gboolean
queued_set_state (gpointer user_data)
{
NMDevice *self = NM_DEVICE (user_data);
@@ -6330,15 +6364,15 @@ queued_set_state (gpointer user_data)
*/
priv->queued_state.id = 0;
new_state = priv->queued_state.state;
new_reason = priv->queued_state.reason;
nm_device_queued_state_clear (self);
nm_device_state_changed (self, new_state, new_reason);
- nm_device_remove_pending_action (self, "queued state change");
+ nm_device_remove_pending_action (self, queued_state_to_string (new_state));
} else {
g_warn_if_fail (priv->queued_state.state == NM_DEVICE_STATE_UNKNOWN);
g_warn_if_fail (priv->queued_state.reason == NM_DEVICE_STATE_REASON_NONE);
}
return FALSE;
}
@@ -6349,29 +6383,37 @@ nm_device_queue_state (NMDevice *self,
{
NMDevicePrivate *priv;
g_return_if_fail (NM_IS_DEVICE (self));
priv = NM_DEVICE_GET_PRIVATE (self);
+ /* "lock" the pending actions so that if there was a previously
+ * queued action that's about to be cleared, that doesn't drop
+ * the pending actions to 0 before we add the new pending action.
+ */
+ nm_device_add_pending_action (self, "queued state lock");
+
/* We should only ever have one delayed state transition at a time */
if (priv->queued_state.id) {
if (priv->queued_state.state == state)
return;
nm_log_warn (LOGD_DEVICE, "(%s): overwriting previously queued state change to %s (%s)",
nm_device_get_iface (self),
state_to_string (priv->queued_state.state),
reason_to_string (priv->queued_state.reason));
nm_device_queued_state_clear (self);
}
priv->queued_state.state = state;
priv->queued_state.reason = reason;
priv->queued_state.id = g_idle_add (queued_set_state, self);
- nm_device_add_pending_action (self, "queued state change");
+ nm_device_add_pending_action (self, queued_state_to_string (state));
+
+ nm_device_remove_pending_action (self, "queued state lock");
nm_log_dbg (LOGD_DEVICE, "(%s): queued state change to %s due to %s (id %d)",
nm_device_get_iface (self), state_to_string (state), reason_to_string (reason),
priv->queued_state.id);
}
NMDeviceState
@@ -6391,15 +6433,15 @@ nm_device_queued_state_clear (NMDevice *self)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
if (priv->queued_state.id) {
nm_log_dbg (LOGD_DEVICE, "(%s): clearing queued state transition (id %d)",
nm_device_get_iface (self), priv->queued_state.id);
g_source_remove (priv->queued_state.id);
- nm_device_remove_pending_action (self, "queued state change");
+ nm_device_remove_pending_action (self, queued_state_to_string (priv->queued_state.state));
}
memset (&priv->queued_state, 0, sizeof (priv->queued_state));
}
NMDeviceState
nm_device_get_state (NMDevice *device)
{
@@ -7102,40 +7144,89 @@ nm_device_set_hw_addr (NMDevice *device, const guint8 *addr,
}
nm_device_bring_up (device, TRUE, NULL);
g_free (mac_str);
return success;
}
+/**
+ * nm_device_add_pending_action():
+ * @device: the #NMDevice to add the pending action to
+ * @action: a static string that identifies the action
+ *
+ * Adds a pending action to the device.
+ */
void
nm_device_add_pending_action (NMDevice *device, const char *action)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device);
+ GQuark qaction;
+ guint i;
- priv->pending_actions++;
- nm_log_dbg (LOGD_DEVICE, "(%s): add_pending_action (%d): %s",
- nm_device_get_iface (device), priv->pending_actions, action);
+ qaction = g_quark_from_static_string (action);
- if (priv->pending_actions == 1)
+ /* Shouldn't ever add the same pending action twice */
+ for (i = 0; i < priv->pending_actions->len; i++) {
+ if (qaction == g_array_index (priv->pending_actions, GQuark, i)) {
+ nm_log_warn (LOGD_DEVICE, "(%s): add_pending_action (%d): '%s' already added",
+ nm_device_get_iface (device),
+ priv->pending_actions->len,
+ action);
+ g_warn_if_reached ();
+ return;
+ }
+ }
+
+ g_array_prepend_val (priv->pending_actions, qaction);
+ nm_log_dbg (LOGD_DEVICE, "(%s): add_pending_action (%d): '%s'",
+ nm_device_get_iface (device),
+ priv->pending_actions->len,
+ action);
+
+ if (priv->pending_actions->len == 1)
g_object_notify (G_OBJECT (device), NM_DEVICE_HAS_PENDING_ACTION);
}
+/**
+ * nm_device_remove_pending_action():
+ * @device: the #NMDevice to remove the pending action from
+ * @action: a static string that identifies the action
+ *
+ * Removes a pending action previously added by nm_device_add_pending_action().
+ */
void
nm_device_remove_pending_action (NMDevice *device, const char *action)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device);
+ GQuark qaction;
+ guint i;
- priv->pending_actions--;
- nm_log_dbg (LOGD_DEVICE, "(%s): remove_pending_action (%d): %s",
- nm_device_get_iface (device), priv->pending_actions, action);
+ qaction = g_quark_from_static_string (action);
- if (priv->pending_actions == 0)
- g_object_notify (G_OBJECT (device), NM_DEVICE_HAS_PENDING_ACTION);
+ /* Shouldn't ever add the same pending action twice */
+ for (i = 0; i < priv->pending_actions->len; i++) {
+ if (qaction == g_array_index (priv->pending_actions, GQuark, i)) {
+ g_array_remove_index_fast (priv->pending_actions, i);
+ nm_log_dbg (LOGD_DEVICE, "(%s): remove_pending_action (%d): '%s'",
+ nm_device_get_iface (device),
+ priv->pending_actions->len,
+ action);
+
+ if (priv->pending_actions->len == 0)
+ g_object_notify (G_OBJECT (device), NM_DEVICE_HAS_PENDING_ACTION);
+ return;
+ }
+ }
+
+ nm_log_warn (LOGD_DEVICE, "(%s): remove_pending_action (%d): '%s' never added",
+ nm_device_get_iface (device),
+ priv->pending_actions->len,
+ action);
}
gboolean
nm_device_has_pending_action (NMDevice *device)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device);
- return priv->pending_actions > 0;
+ return priv->pending_actions->len > 0;
}
diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c
index 6a825bc..34f438c 100644
--- a/src/nm-active-connection.c
+++ b/src/nm-active-connection.c
@@ -135,14 +135,20 @@ nm_active_connection_set_state (NMActiveConnection *self,
if ( new_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED
|| old_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
nm_settings_connection_update_timestamp (NM_SETTINGS_CONNECTION (priv->connection),
(guint64) time (NULL), TRUE);
}
+ if (priv->device) {
+ if ( old_state < NM_ACTIVE_CONNECTION_STATE_ACTIVATED
+ && new_state >= NM_ACTIVE_CONNECTION_STATE_ACTIVATED)
+ nm_device_remove_pending_action (priv->device, "activation");
+ }
+
if (priv->state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATED) {
/* Device is no longer relevant when deactivated */
g_clear_object (&priv->device);
g_object_notify (G_OBJECT (self), NM_ACTIVE_CONNECTION_DEVICES);
}
}
@@ -262,8 +268,10 @@ set_property (GObject *object, guint pro
case PROP_INT_DEVICE:
g_warn_if_fail (priv->device == NULL);
priv->device = g_value_dup_object (value);
- if (priv->device)
+ if (priv->device) {
g_warn_if_fail (priv->device != priv->master);
+ nm_device_add_pending_action (priv->device, "activation");
+ }
break;
case PROP_INT_USER_REQUESTED:
priv->user_requested = g_value_get_boolean (value);
--
1.8.3.1
From 813ea5995bb5a35c115c46f30eefe18db2886afb Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Mon, 16 Dec 2013 16:52:36 +0100
Subject: [PATCH 1/2] core: allow dynamic strings for pending action names
Use a GSList of the string values, instead of an array of GQuarks.
Using GQuarks does not allow to add arbitrary strings, because they
would leak the internalized strings. The next patch will begin
using unique, non-const action strings.
Given the rather small number of expected pending states, a singly
linked list seems appropriate.
Signed-off-by: Thomas Haller <thaller@redhat.com>
(some fixes and simplifications by dcbw based on patch reviews)
---
src/devices/nm-device.c | 49 +++++++++++++++++++++++++------------------------
1 file changed, 25 insertions(+), 24 deletions(-)
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index c1c7c69..e4644bf 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -184,15 +184,15 @@ typedef struct {
gboolean initialized;
gboolean in_state_changed;
NMDeviceState state;
NMDeviceStateReason state_reason;
QueuedState queued_state;
guint queued_ip_config_id;
- GArray *pending_actions;
+ GSList *pending_actions;
char * udi;
char * path;
char * iface; /* may change, could be renamed by user */
int ifindex;
gboolean is_software;
char * ip_iface;
@@ -391,15 +391,14 @@ nm_device_init (NMDevice *self)
priv->capabilities = NM_DEVICE_CAP_NM_SUPPORTED;
priv->state = NM_DEVICE_STATE_UNMANAGED;
priv->state_reason = NM_DEVICE_STATE_REASON_NONE;
priv->dhcp_timeout = 0;
priv->rfkill_type = RFKILL_TYPE_UNKNOWN;
priv->autoconnect = DEFAULT_AUTOCONNECT;
priv->available_connections = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, NULL);
- priv->pending_actions = g_array_sized_new (FALSE, TRUE, sizeof (GQuark), 5);
}
static void
update_accept_ra_save (NMDevice *self)
{
NMDevicePrivate *priv;
const char *ip_iface;
@@ -5368,16 +5367,15 @@ finalize (GObject *object)
if (priv->dhcp_manager)
g_object_unref (priv->dhcp_manager);
if (priv->fw_manager)
g_object_unref (priv->fw_manager);
- g_array_free (priv->pending_actions, TRUE);
- priv->pending_actions = NULL;
+ g_slist_free_full (priv->pending_actions, g_free);
g_free (priv->udi);
g_free (priv->path);
g_free (priv->iface);
g_free (priv->ip_iface);
g_free (priv->driver);
g_free (priv->driver_version);
@@ -7153,78 +7152,80 @@ nm_device_set_hw_addr (NMDevice *device, const guint8 *addr,
*
* Adds a pending action to the device.
*/
void
nm_device_add_pending_action (NMDevice *device, const char *action)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device);
- GQuark qaction;
- guint i;
+ GSList *iter;
+ guint count;
- qaction = g_quark_from_static_string (action);
+ g_return_if_fail (action);
/* Shouldn't ever add the same pending action twice */
- for (i = 0; i < priv->pending_actions->len; i++) {
- if (qaction == g_array_index (priv->pending_actions, GQuark, i)) {
+ for (iter = priv->pending_actions; iter; iter = iter->next) {
+ if (!strcmp (action, iter->data)) {
nm_log_warn (LOGD_DEVICE, "(%s): add_pending_action (%d): '%s' already added",
nm_device_get_iface (device),
- priv->pending_actions->len,
+ g_slist_length (priv->pending_actions),
action);
- g_warn_if_reached ();
- return;
+ g_return_val_if_reached (FALSE);
}
}
- g_array_prepend_val (priv->pending_actions, qaction);
+ priv->pending_actions = g_slist_append (priv->pending_actions, g_strdup (action));
+ count = g_slist_length (priv->pending_actions);
+
nm_log_dbg (LOGD_DEVICE, "(%s): add_pending_action (%d): '%s'",
nm_device_get_iface (device),
- priv->pending_actions->len,
+ count,
action);
- if (priv->pending_actions->len == 1)
+ if (count == 1)
g_object_notify (G_OBJECT (device), NM_DEVICE_HAS_PENDING_ACTION);
}
/**
* nm_device_remove_pending_action():
* @device: the #NMDevice to remove the pending action from
* @action: a static string that identifies the action
*
* Removes a pending action previously added by nm_device_add_pending_action().
*/
void
nm_device_remove_pending_action (NMDevice *device, const char *action)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device);
- GQuark qaction;
- guint i;
+ GSList *iter;
- qaction = g_quark_from_static_string (action);
+ g_return_if_fail (action);
/* Shouldn't ever add the same pending action twice */
- for (i = 0; i < priv->pending_actions->len; i++) {
- if (qaction == g_array_index (priv->pending_actions, GQuark, i)) {
- g_array_remove_index_fast (priv->pending_actions, i);
+ for (iter = priv->pending_actions; iter; iter = iter->next) {
+ if (!strcmp (action, iter->data)) {
+ g_free (iter->data);
+ priv->pending_actions = g_slist_delete_link (priv->pending_actions, iter);
nm_log_dbg (LOGD_DEVICE, "(%s): remove_pending_action (%d): '%s'",
nm_device_get_iface (device),
- priv->pending_actions->len,
+ g_slist_length (priv->pending_actions),
action);
- if (priv->pending_actions->len == 0)
+ if (priv->pending_actions == NULL)
g_object_notify (G_OBJECT (device), NM_DEVICE_HAS_PENDING_ACTION);
return;
}
}
nm_log_warn (LOGD_DEVICE, "(%s): remove_pending_action (%d): '%s' never added",
nm_device_get_iface (device),
- priv->pending_actions->len,
+ g_slist_length (priv->pending_actions),
action);
+ g_return_if_reached ();
}
gboolean
nm_device_has_pending_action (NMDevice *device)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (device);
- return priv->pending_actions->len > 0;
+ return !!priv->pending_actions;
}
--
1.8.3.1
From b6ef165cfefba44a496cc336e1f91bb93b28f3ff Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Mon, 16 Dec 2013 15:02:38 +0100
Subject: [PATCH 2/2] core: fix NMActiveConnection to properly add/remove
pending action "activation"
When a new activation request is received, NetworkManager creates a new
NMActiveConnection to track that request. The device may already be activated,
in which case NetworkManager stops the old activation and starts the new one,
but both exist in parallel for a short period of time. If the old
NMActiveConnection is activating and already has a pending 'activation'
action, when the new NMActiveConnection adds its own 'activating' action,
they will clash. This is fixed by making each NMActiveConnection's activation
pending action uniquely named.
This fixes a g_warning with the following back trace:
#0 0x000000328224edfd in g_logv () from /lib64/libglib-2.0.so.0
#1 0x000000328224efe2 in g_log () from /lib64/libglib-2.0.so.0
#2 0x000000328224f2e6 in g_warn_message () from /lib64/libglib-2.0.so.0
#3 0x0000000000440aee in nm_device_add_pending_action (device=0x14002e0, action=0x50704a "activation") at devices/nm-device.c:7172
#4 0x000000000047525c in nm_active_connection_set_device (self=0x141b3c0, device=0x14002e0) at nm-active-connection.c:364
#5 0x0000000000475ec1 in set_property (object=0x141b3c0, prop_id=11, value=0x7fff7ff36c20, pspec=0x1405f70) at nm-active-connection.c:647
#6 0x0000003282615d3e in g_object_newv () from /lib64/libgobject-2.0.so.0
#7 0x00000032826162e6 in g_object_new_valist () from /lib64/libgobject-2.0.so.0
#8 0x0000003282616654 in g_object_new () from /lib64/libgobject-2.0.so.0
#9 0x0000000000474193 in nm_act_request_new (connection=0x13bb0e0, specific_object=0x0, subject=0x1447740, device=0x14002e0) at nm-activation-request.c:376
#10 0x000000000048e477 in _new_active_connection (self=0x13e8060, connection=0x13bb0e0, specific_object=0x0, device=0x14002e0, subject=0x1447740, error=0x7fff7ff36f90) at nm-manager.c:2947
#11 0x000000000048ed77 in impl_manager_activate_connection (self=0x13e8060, connection_path=0x134d590 "/org/freedesktop/NetworkManager/Settings/9", device_path=0x134d550 "/org/freedesktop/NetworkManager/Devices/1",
specific_object_path=0x0, context=0x143a9b0) at nm-manager.c:3206
#12 0x00000000004876c8 in dbus_glib_marshal_nm_manager_VOID__BOXED_BOXED_BOXED_POINTER (closure=0x7fff7ff37220, return_value=0x0, n_param_values=5, param_values=0x1448830, invocation_hint=0x0,
marshal_data=0x48e9dd <impl_manager_activate_connection>) at nm-manager-glue.h:189
#13 0x0000003284a0d6a9 in object_registration_message () from /lib64/libdbus-glib-1.so.2
#14 0x000000348ea1ce66 in _dbus_object_tree_dispatch_and_unlock () from /lib64/libdbus-1.so.3
#15 0x000000348ea0fa31 in dbus_connection_dispatch () from /lib64/libdbus-1.so.3
#16 0x0000003284a0acc5 in message_queue_dispatch () from /lib64/libdbus-glib-1.so.2
#17 0x0000003282247df6 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#18 0x0000003282248148 in g_main_context_iterate.isra.22 () from /lib64/libglib-2.0.so.0
#19 0x000000328224854a in g_main_loop_run () from /lib64/libglib-2.0.so.0
#20 0x000000000042c6c0 in main (argc=1, argv=0x7fff7ff379b8) at main.c:629
Signed-off-by: Thomas Haller <thaller@redhat.com>
---
src/nm-active-connection.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c
index cb42417..a8a422c 100644
--- a/src/nm-active-connection.c
+++ b/src/nm-active-connection.c
@@ -42,14 +42,16 @@ G_DEFINE_ABSTRACT_TYPE (NMActiveConnection, nm_active_connection, G_TYPE_OBJECT)
NMDevice *device;
gboolean is_default;
gboolean is_default6;
NMActiveConnectionState state;
gboolean vpn;
+ char *pending_activation_id;
+
gboolean user_requested;
gulong user_uid;
NMDevice *master;
} NMActiveConnectionPrivate;
enum {
PROP_0,
@@ -138,16 +140,20 @@ nm_active_connection_set_state (NMActiveConnection *self,
|| old_state == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
nm_settings_connection_update_timestamp (NM_SETTINGS_CONNECTION (priv->connection),
(guint64) time (NULL), TRUE);
}
if (priv->device) {
if ( old_state < NM_ACTIVE_CONNECTION_STATE_ACTIVATED
- && new_state >= NM_ACTIVE_CONNECTION_STATE_ACTIVATED)
- nm_device_remove_pending_action (priv->device, "activation");
+ && new_state >= NM_ACTIVE_CONNECTION_STATE_ACTIVATED &&
+ priv->pending_activation_id)
+ {
+ nm_device_remove_pending_action (priv->device, priv->pending_activation_id);
+ g_clear_pointer (&priv->pending_activation_id, g_free);
+ }
}
if (priv->state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATED) {
/* Device is no longer relevant when deactivated */
g_clear_object (&priv->device);
g_object_notify (G_OBJECT (self), NM_ACTIVE_CONNECTION_DEVICES);
}
@@ -357,15 +363,16 @@ set_property (GObject *object, guint prop_id,
priv->connection = g_value_dup_object (value);
break;
case PROP_INT_DEVICE:
g_warn_if_fail (priv->device == NULL);
priv->device = g_value_dup_object (value);
if (priv->device) {
g_warn_if_fail (priv->device != priv->master);
- nm_device_add_pending_action (priv->device, "activation");
+ priv->pending_activation_id = g_strdup_printf ("activation::%p", (void *)object);
+ nm_device_add_pending_action (priv->device, priv->pending_activation_id);
}
break;
case PROP_INT_USER_REQUESTED:
priv->user_requested = g_value_get_boolean (value);
break;
case PROP_INT_USER_UID:
priv->user_uid = g_value_get_ulong (value);
@@ -732,14 +739,18 @@ static void
g_free (priv->path);
priv->path = NULL;
g_free (priv->specific_object);
priv->specific_object = NULL;
g_clear_object (&priv->connection);
+ if (priv->pending_activation_id) {
+ nm_device_remove_pending_action (priv->device, priv->pending_activation_id);
+ g_clear_pointer (&priv->pending_activation_id, g_free);
+ }
g_clear_object (&priv->device);
g_clear_object (&priv->master);
G_OBJECT_CLASS (nm_active_connection_parent_class)->dispose (object);
}
static void
--
1.8.3.1

View File

@ -1,431 +0,0 @@
From 8d3618a07baccc8abd9cfe7cf5b000b5d8c3340b Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Wed, 23 Oct 2013 18:37:02 +0200
Subject: [PATCH] rdisc: emit config_change signal for update of address
lifetime
Signed-off-by: Thomas Haller <thaller@redhat.com>
---
src/rdisc/nm-lndp-rdisc.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/rdisc/nm-lndp-rdisc.c b/src/rdisc/nm-lndp-rdisc.c
index 3299b32..f94d82a 100644
--- a/src/rdisc/nm-lndp-rdisc.c
+++ b/src/rdisc/nm-lndp-rdisc.c
@@ -101,16 +101,19 @@ add_address (NMRDisc *rdisc, const NMRDiscAddress *new)
{
int i;
for (i = 0; i < rdisc->addresses->len; i++) {
NMRDiscAddress *item = &g_array_index (rdisc->addresses, NMRDiscAddress, i);
if (IN6_ARE_ADDR_EQUAL (&item->address, &new->address)) {
- memcpy (item, new, sizeof (*new));
- return FALSE;
+ gboolean changed = item->timestamp + item->lifetime != new->timestamp + new->lifetime ||
+ item->timestamp + item->preferred != new->timestamp + new->preferred;
+
+ *item = *new;
+ return changed;
}
}
g_array_insert_val (rdisc->addresses, i, *new);
return TRUE;
}
--
1.8.3.1
From 4f3f789fa5dad459a2aecabd77ef4a595dec5013 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Thu, 19 Dec 2013 10:58:46 -0600
Subject: [PATCH] rdisc: ensure RDNSS and DNSSL lifetimes are updated (rh
#1044757) (bgo #720760)
The DNS server and domain timestamps and lifetimes weren't updated
when a new RA was received. When half the lifetime for either of
them had passed, clean_dns_servers() and clean_domains() request a
Router Solicitation to ensure the DNS information does not expire.
This obviously results in a new Router Advertisement, but since the
timestamps don't get updated, clean_dns_servers() and clean_domains()
simply request another solicitation because 'now' is still greater
than half the old lifetime. This casues another solicit request,
which causes another RA, which... etc.
https://bugzilla.redhat.com/show_bug.cgi?id=1044757
https://bugzilla.gnome.org/show_bug.cgi?id=720760
---
src/devices/nm-device.c | 9 +++--
src/rdisc/nm-lndp-rdisc.c | 97 +++++++++++++++++++++++++++++------------------
2 files changed, 67 insertions(+), 39 deletions(-)
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 74d443d..6f2383b 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -3315,14 +3315,17 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *device
NMRDiscDNSServer *discovered_server = &g_array_index (rdisc->dns_servers, NMRDiscDNSServer, i);
nm_ip6_config_add_nameserver (priv->ac_ip6_config, &discovered_server->address);
}
}
if (changed & NM_RDISC_CONFIG_DNS_DOMAINS) {
+ /* Rebuild domain list from router discovery cache. */
+ nm_ip6_config_reset_domains (priv->ac_ip6_config);
+
for (i = 0; i < rdisc->dns_domains->len; i++) {
NMRDiscDNSDomain *discovered_domain = &g_array_index (rdisc->dns_domains, NMRDiscDNSDomain, i);
nm_ip6_config_add_domain (priv->ac_ip6_config, discovered_domain->domain);
}
}
@@ -3357,28 +3360,29 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *device
static gboolean
addrconf6_start (NMDevice *self)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
NMConnection *connection;
+ const char *ip_iface = nm_device_get_ip_iface (self);
connection = nm_device_get_connection (self);
g_assert (connection);
g_warn_if_fail (priv->ac_ip6_config == NULL);
if (priv->ac_ip6_config) {
g_object_unref (priv->ac_ip6_config);
priv->ac_ip6_config = NULL;
}
- priv->rdisc = nm_lndp_rdisc_new (nm_device_get_ip_ifindex (self), nm_device_get_ip_iface (self));
+ priv->rdisc = nm_lndp_rdisc_new (nm_device_get_ip_ifindex (self), ip_iface);
nm_platform_sysctl_set (priv->ip6_accept_ra_path, "0");
if (!priv->rdisc) {
- nm_log_err (LOGD_IP6, "Failed to start router discovery.");
+ nm_log_err (LOGD_IP6, "(%s): failed to start router discovery.", ip_iface);
return FALSE;
}
priv->rdisc_config_changed_sigid = g_signal_connect (
priv->rdisc, NM_RDISC_CONFIG_CHANGED, G_CALLBACK (rdisc_config_changed), self);
/* FIXME: what if interface has no lladdr, like PPP? */
diff --git a/src/rdisc/nm-lndp-rdisc.c b/src/rdisc/nm-lndp-rdisc.c
index f94d82a..2e22fd9 100644
--- a/src/rdisc/nm-lndp-rdisc.c
+++ b/src/rdisc/nm-lndp-rdisc.c
@@ -140,44 +140,68 @@ add_route (NMRDisc *rdisc, const NMRDiscRoute *new)
}
g_array_insert_val (rdisc->routes, i, *new);
return TRUE;
}
static gboolean
-add_server (NMRDisc *rdisc, const NMRDiscDNSServer *new)
+add_dns_server (NMRDisc *rdisc, const NMRDiscDNSServer *new)
{
int i;
for (i = 0; i < rdisc->dns_servers->len; i++) {
NMRDiscDNSServer *item = &g_array_index (rdisc->dns_servers, NMRDiscDNSServer, i);
- if (IN6_ARE_ADDR_EQUAL (&item->address, &new->address))
- return FALSE;
+ if (IN6_ARE_ADDR_EQUAL (&item->address, &new->address)) {
+ gboolean changed = item->timestamp != new->timestamp ||
+ item->lifetime != new->lifetime;
+ if (changed) {
+ item->timestamp = new->timestamp;
+ item->lifetime = new->lifetime;
+ }
+ return changed;
+ }
}
+ /* DNS server should no longer be used */
+ if (new->lifetime == 0)
+ return FALSE;
+
g_array_insert_val (rdisc->dns_servers, i, *new);
-
return TRUE;
}
+/* Always copies new->domain */
static gboolean
add_domain (NMRDisc *rdisc, const NMRDiscDNSDomain *new)
{
+ NMRDiscDNSDomain *item;
int i;
for (i = 0; i < rdisc->dns_domains->len; i++) {
- NMRDiscDNSDomain *item = &g_array_index (rdisc->dns_domains, NMRDiscDNSDomain, i);
+ item = &g_array_index (rdisc->dns_domains, NMRDiscDNSDomain, i);
- if (!g_strcmp0 (item->domain, new->domain))
- return FALSE;
+ if (!g_strcmp0 (item->domain, new->domain)) {
+ gboolean changed = item->timestamp != new->timestamp ||
+ item->lifetime != new->lifetime;
+ if (changed) {
+ item->timestamp = new->timestamp;
+ item->lifetime = new->lifetime;
+ }
+ return changed;
+ }
}
+ /* Domain should no longer be used */
+ if (new->lifetime == 0)
+ return FALSE;
+
g_array_insert_val (rdisc->dns_domains, i, *new);
-
+ item = &g_array_index (rdisc->dns_domains, NMRDiscDNSDomain, i);
+ item->domain = g_strdup (new->domain);
return TRUE;
}
#define RETRY 10
static gboolean
send_rs (NMRDisc *rdisc)
@@ -186,15 +210,15 @@ send_rs (NMRDisc *rdisc)
struct ndp_msg *msg;
int error;
error = ndp_msg_new (&msg, NDP_MSG_RS);
g_assert (!error);
ndp_msg_ifindex_set (msg, rdisc->ifindex);
- debug ("(%s): sending router solicitation: %d", rdisc->ifname, rdisc->ifindex);
+ debug ("(%s): sending router solicitation", rdisc->ifname);
error = ndp_msg_send (priv->ndp, msg);
if (error)
error ("(%s): cannot send router solicitation: %d.", rdisc->ifname, error);
ndp_msg_destroy (msg);
@@ -218,139 +242,140 @@ solicit (NMRDisc *rdisc)
static void
clean_gateways (NMRDisc *rdisc, guint32 now, NMRDiscConfigMap *changed, guint32 *nextevent)
{
int i;
for (i = 0; i < rdisc->gateways->len; i++) {
NMRDiscGateway *item = &g_array_index (rdisc->gateways, NMRDiscGateway, i);
- guint32 expiry = item->timestamp + item->lifetime;
+ guint64 expiry = item->timestamp + item->lifetime;
- if (item->lifetime == UINT_MAX)
+ if (item->lifetime == G_MAXUINT32)
continue;
if (now >= expiry) {
g_array_remove_index (rdisc->gateways, i--);
*changed |= NM_RDISC_CONFIG_GATEWAYS;
} else if (*nextevent > expiry)
- *nextevent = expiry;
+ *nextevent = (guint32) expiry;
}
}
static void
clean_addresses (NMRDisc *rdisc, guint32 now, NMRDiscConfigMap *changed, guint32 *nextevent)
{
int i;
for (i = 0; i < rdisc->addresses->len; i++) {
NMRDiscAddress *item = &g_array_index (rdisc->addresses, NMRDiscAddress, i);
- guint32 expiry = item->timestamp + item->lifetime;
+ guint64 expiry = item->timestamp + item->lifetime;
- if (item->lifetime == UINT_MAX)
+ if (item->lifetime == G_MAXUINT32)
continue;
if (now >= expiry) {
g_array_remove_index (rdisc->addresses, i--);
*changed |= NM_RDISC_CONFIG_ADDRESSES;
} else if (*nextevent > expiry)
- *nextevent = expiry;
+ *nextevent = (guint32) expiry;
}
}
static void
clean_routes (NMRDisc *rdisc, guint32 now, NMRDiscConfigMap *changed, guint32 *nextevent)
{
int i;
for (i = 0; i < rdisc->routes->len; i++) {
NMRDiscRoute *item = &g_array_index (rdisc->routes, NMRDiscRoute, i);
- guint32 expiry = item->timestamp + item->lifetime;
+ guint64 expiry = item->timestamp + item->lifetime;
- if (item->lifetime == UINT_MAX)
+ if (item->lifetime == G_MAXUINT32)
continue;
if (now >= expiry) {
g_array_remove_index (rdisc->routes, i--);
*changed |= NM_RDISC_CONFIG_ROUTES;
} else if (*nextevent > expiry)
- *nextevent = expiry;
+ *nextevent = (guint32) expiry;
}
}
static void
-clean_servers (NMRDisc *rdisc, guint32 now, NMRDiscConfigMap *changed, guint32 *nextevent)
+clean_dns_servers (NMRDisc *rdisc, guint32 now, NMRDiscConfigMap *changed, guint32 *nextevent)
{
int i;
for (i = 0; i < rdisc->dns_servers->len; i++) {
NMRDiscDNSServer *item = &g_array_index (rdisc->dns_servers, NMRDiscDNSServer, i);
- guint32 expiry = item->timestamp + item->lifetime;
- guint32 refresh = item->timestamp + item->lifetime / 2;
+ guint64 expiry = item->timestamp + item->lifetime;
+ guint64 refresh = item->timestamp + item->lifetime / 2;
- if (item->lifetime == UINT_MAX)
+ if (item->lifetime == G_MAXUINT32)
continue;
if (now >= expiry) {
g_array_remove_index (rdisc->dns_servers, i--);
- *changed |= NM_RDISC_CONFIG_ROUTES;
+ *changed |= NM_RDISC_CONFIG_DNS_SERVERS;
} else if (now >= refresh)
solicit (rdisc);
else if (*nextevent > refresh)
- *nextevent = refresh;
+ *nextevent = (guint32) refresh;
}
}
static void
clean_domains (NMRDisc *rdisc, guint32 now, NMRDiscConfigMap *changed, guint32 *nextevent)
{
int i;
for (i = 0; i < rdisc->dns_domains->len; i++) {
NMRDiscDNSDomain *item = &g_array_index (rdisc->dns_domains, NMRDiscDNSDomain, i);
- guint32 expiry = item->timestamp + item->lifetime;
- guint32 refresh = item->timestamp + item->lifetime / 2;
+ guint64 expiry = item->timestamp + item->lifetime;
+ guint64 refresh = item->timestamp + item->lifetime / 2;
- if (item->lifetime == UINT_MAX)
+ if (item->lifetime == G_MAXUINT32)
continue;
if (now >= expiry) {
+ g_free (item->domain);
g_array_remove_index (rdisc->dns_domains, i--);
- *changed |= NM_RDISC_CONFIG_ROUTES;
+ *changed |= NM_RDISC_CONFIG_DNS_DOMAINS;
} else if (now >= refresh)
solicit (rdisc);
else if (*nextevent >=refresh)
- *nextevent = refresh;
+ *nextevent = (guint32) refresh;
}
}
static gboolean timeout_cb (gpointer user_data);
static void
check_timestamps (NMRDisc *rdisc, guint32 now, NMRDiscConfigMap changed)
{
NMLNDPRDiscPrivate *priv = NM_LNDP_RDISC_GET_PRIVATE (rdisc);
- /* Use a magic date in distant enough future as there's no guint32 max macro. */
- guint32 never = G_MAXINT32;
+ /* Use a magic date in the distant future (~68 years) */
+ guint32 never = G_MAXINT32;
guint32 nextevent = never;
if (priv->timeout_id) {
g_source_remove (priv->timeout_id);
priv->timeout_id = 0;
}
clean_gateways (rdisc, now, &changed, &nextevent);
clean_addresses (rdisc, now, &changed, &nextevent);
clean_routes (rdisc, now, &changed, &nextevent);
- clean_servers (rdisc, now, &changed, &nextevent);
+ clean_dns_servers (rdisc, now, &changed, &nextevent);
clean_domains (rdisc, now, &changed, &nextevent);
if (changed)
g_signal_emit_by_name (rdisc, NM_RDISC_CONFIG_CHANGED, changed);
if (nextevent != never) {
- debug ("Scheduling next now/lifetime check: %d seconds", (int) nextevent);
+ debug ("(%s): scheduling next now/lifetime check: %u seconds", rdisc->ifname, nextevent);
priv->timeout_id = g_timeout_add_seconds (nextevent, timeout_cb, rdisc);
}
}
static guint32
get_time (void)
{
@@ -450,15 +475,15 @@ receive_ra (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data)
*
* The biggest difference from good old DHCP is that all configuration
* items have their own lifetimes and they are merged from various
* sources. Router discovery is *not* contract-based, so there is *no*
* single time when the configuration is finished and updates can
* come at any time.
*/
- debug ("Recieved router advertisement: %d at %d", rdisc->ifindex, (int) now);
+ debug ("(%s): received router advertisement at %u", rdisc->ifname, now);
if (priv->send_rs_id) {
g_source_remove (priv->send_rs_id);
priv->send_rs_id = 0;
}
/* DHCP level:
@@ -559,27 +584,27 @@ receive_ra (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data)
/* Pad the lifetime somewhat to give a bit of slack in cases
* where one RA gets lost or something (which can happen on unreliable
* links like WiFi where certain types of frames are not retransmitted).
* Note that 0 has special meaning and is therefore not adjusted.
*/
if (dns_server.lifetime && dns_server.lifetime < 7200)
dns_server.lifetime = 7200;
- if (add_server (rdisc, &dns_server))
+ if (add_dns_server (rdisc, &dns_server))
changed |= NM_RDISC_CONFIG_DNS_SERVERS;
}
}
ndp_msg_opt_for_each_offset(offset, msg, NDP_MSG_OPT_DNSSL) {
char *domain;
int domain_index;
ndp_msg_opt_dnssl_for_each_domain (domain, domain_index, msg, offset) {
NMRDiscDNSDomain dns_domain;
memset (&dns_domain, 0, sizeof (dns_domain));
- dns_domain.domain = g_strdup (domain);
+ dns_domain.domain = domain;
dns_domain.timestamp = now;
dns_domain.lifetime = ndp_msg_opt_rdnss_lifetime (msg, offset);
/* Pad the lifetime somewhat to give a bit of slack in cases
* where one RA gets lost or something (which can happen on unreliable
* links like WiFi where certain types of frames are not retransmitted).
* Note that 0 has special meaning and is therefore not adjusted.
*/
--
1.8.3.1

View File

@ -1,21 +0,0 @@
diff -up NetworkManager-0.9.9.0/src/bluez-manager/nm-bluez-device.c.bluez-crash NetworkManager-0.9.9.0/src/bluez-manager/nm-bluez-device.c
--- NetworkManager-0.9.9.0/src/bluez-manager/nm-bluez-device.c.bluez-crash 2013-10-03 15:00:51.000000000 -0400
+++ NetworkManager-0.9.9.0/src/bluez-manager/nm-bluez-device.c 2014-01-06 12:09:14.449583005 -0500
@@ -686,7 +686,7 @@ static void
on_adapter_acquired (GObject *object, GAsyncResult *res, NMBluezDevice *self)
{
NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self);
- GError *error;
+ GError *error = NULL;
GVariant *v;
priv->adapter = g_dbus_proxy_new_for_bus_finish (res, &error);
@@ -923,7 +923,7 @@ static void
on_proxy_acquired (GObject *object, GAsyncResult *res, NMBluezDevice *self)
{
NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self);
- GError *error;
+ GError *error = NULL;
priv->proxy5 = g_dbus_proxy_new_for_bus_finish (res, &error);

View File

@ -1 +1 @@
7251704430cb206f2c29bfebc45bd0fb NetworkManager-0.9.9.0.git20131003.tar.bz2
SHA512 (NetworkManager-1.43.6.tar.xz) = e1d898d3e6154018defcf189bc017a962ed93b9f5d7bafd90642cd70f9bbd4885874b24f716d524e52cf9e44c7ba338e3c416e78bd7b6ec6eaa1cb5066244504

13
tests/tests.yml Normal file
View File

@ -0,0 +1,13 @@
# Tests for NetworkManager
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
repositories:
- repo: "https://github.com/NetworkManager/NetworkManager-ci"
dest: "NetworkManager-ci"
tests:
- sanity-tests:
dir: NetworkManager-ci
run: run/osci/run-tests fedora28