Change-Id: I2f34567bef3c63e73b6334b1e2c8a085de794039
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/1721
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>
... | ... |
@@ -1,42 +1,43 @@ |
1 |
-Summary: NetworkManager |
|
2 |
-Name: NetworkManager |
|
3 |
-Version: 1.0.10 |
|
4 |
-Release: 2%{?dist} |
|
5 |
-License: LGPLv2+ |
|
6 |
-URL: https://wiki.gnome.org/Projects/NetworkManager |
|
7 |
-Source0: https://download.gnome.org/sources/NetworkManager/1.0/%{name}-%{version}.tar.xz |
|
1 |
+Summary: NetworkManager |
|
2 |
+Name: NetworkManager |
|
3 |
+Version: 1.0.10 |
|
4 |
+Release: 3%{?dist} |
|
5 |
+License: LGPLv2+ |
|
6 |
+URL: https://wiki.gnome.org/Projects/NetworkManager |
|
7 |
+Source0: https://download.gnome.org/sources/NetworkManager/1.0/%{name}-%{version}.tar.xz |
|
8 | 8 |
%define sha1 NetworkManager=1c199fdfb9fff9e7f540d51952699ce815a12369 |
9 |
-Group: System Environment/Base |
|
10 |
-Vendor: VMware, Inc. |
|
11 |
-Distribution: Photon |
|
12 |
-BuildRequires: intltool |
|
13 |
-BuildRequires: iptables |
|
14 |
-BuildRequires: dbus-devel |
|
15 |
-BuildRequires: dbus-glib-devel |
|
16 |
-BuildRequires: libnl-devel |
|
17 |
-BuildRequires: readline-devel |
|
18 |
-BuildRequires: ncurses-devel |
|
19 |
-BuildRequires: nss-devel |
|
20 |
-BuildRequires: libndp-devel |
|
21 |
-BuildRequires: python2 |
|
22 |
-BuildRequires: python2-libs |
|
9 |
+Group: System Environment/Base |
|
10 |
+Vendor: VMware, Inc. |
|
11 |
+Distribution: Photon |
|
12 |
+BuildRequires: intltool |
|
13 |
+BuildRequires: iptables |
|
14 |
+BuildRequires: dbus-devel |
|
15 |
+BuildRequires: dbus-glib-devel |
|
16 |
+BuildRequires: libnl-devel |
|
17 |
+BuildRequires: readline-devel |
|
18 |
+BuildRequires: ncurses-devel |
|
19 |
+BuildRequires: nss-devel |
|
20 |
+BuildRequires: libndp-devel |
|
21 |
+BuildRequires: python2 |
|
22 |
+BuildRequires: python2-libs |
|
23 | 23 |
BuildRequires: python-xml |
24 |
-BuildRequires: dhcp-client |
|
25 |
-BuildRequires: libsoup-devel |
|
24 |
+BuildRequires: dhcp-client |
|
25 |
+BuildRequires: libsoup-devel |
|
26 | 26 |
BuildRequires: autogen |
27 | 27 |
BuildRequires: libgudev-devel |
28 |
-Requires: libnl |
|
29 |
-Requires: dbus-glib |
|
30 |
-Requires: glib |
|
31 |
-Requires: libndp |
|
32 |
-Requires: libsoup |
|
33 |
-Requires: nss |
|
34 |
-Requires: ncurses |
|
35 |
-Requires: readline |
|
36 |
-Requires: dbus |
|
28 |
+BuildRequires: systemd-devel |
|
29 |
+Requires: libnl |
|
30 |
+Requires: dbus-glib |
|
31 |
+Requires: glib |
|
32 |
+Requires: libndp |
|
33 |
+Requires: libsoup |
|
34 |
+Requires: nss |
|
35 |
+Requires: ncurses |
|
36 |
+Requires: readline |
|
37 |
+Requires: dbus |
|
37 | 38 |
%package devel |
38 |
-Summary: Libraries and header files for NetworkManager |
|
39 |
-Requires: NetworkManager |
|
39 |
+Summary: Libraries and header files for NetworkManager |
|
40 |
+Requires: NetworkManager |
|
40 | 41 |
|
41 | 42 |
%description devel |
42 | 43 |
Headers and libraries for the NetworkManager. |
... | ... |
@@ -48,13 +49,13 @@ NetworkManager is a set of co-operative tools that make networking simple and st |
48 | 48 |
%setup -q |
49 | 49 |
%build |
50 | 50 |
./configure \ |
51 |
- --prefix=%{_prefix} \ |
|
52 |
- --disable-ppp \ |
|
53 |
- --disable-gtk-doc \ |
|
54 |
- --sysconfdir=%{_sysconfdir} \ |
|
51 |
+ --prefix=%{_prefix} \ |
|
52 |
+ --disable-ppp \ |
|
53 |
+ --disable-gtk-doc \ |
|
54 |
+ --sysconfdir=%{_sysconfdir} \ |
|
55 | 55 |
--with-dhclient=yes \ |
56 |
- --enable-ifcfg-rh=yes \ |
|
57 |
- --with-setting-plugins-default='ifcfg-rh,ibft' |
|
56 |
+ --enable-ifcfg-rh=yes \ |
|
57 |
+ --with-setting-plugins-default='ifcfg-rh,ibft' |
|
58 | 58 |
|
59 | 59 |
|
60 | 60 |
make %{?_smp_mflags} |
... | ... |
@@ -65,8 +66,8 @@ cat >> %{buildroot}/etc/NetworkManager/NetworkManager.conf << "EOF" |
65 | 65 |
plugins=ifcfg-rh,ibft |
66 | 66 |
EOF |
67 | 67 |
|
68 |
-%post -p /sbin/ldconfig |
|
69 |
-%postun -p /sbin/ldconfig |
|
68 |
+%post -p /sbin/ldconfig |
|
69 |
+%postun -p /sbin/ldconfig |
|
70 | 70 |
%files |
71 | 71 |
%defattr(-,root,root) |
72 | 72 |
%{_sysconfdir}/NetworkManager/NetworkManager.conf |
... | ... |
@@ -95,16 +96,19 @@ EOF |
95 | 95 |
%{_includedir}/libnm-glib/*.h |
96 | 96 |
%{_libdir}/*.so |
97 | 97 |
%{_libdir}/pkgconfig/*.pc |
98 |
+ |
|
98 | 99 |
%changelog |
99 |
-* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.10-2 |
|
100 |
-- GA - Bump release of all rpms |
|
101 |
-* Tue Feb 23 2016 Anish Swaminathan <anishs@vmware.com> 1.0.10-1 |
|
102 |
-- Upgrade to 1.0.10 |
|
103 |
-* Mon Dec 14 2015 Anish Swaminathan<anishs@vmware.com> 1.0.2-4 |
|
104 |
-- Adding the missing BuildRequires |
|
105 |
-* Tue Sep 22 2015 Harish Udaiya Kumar<hudaiyakumar@vmware.com> 1.0.2-3 |
|
106 |
-- Adding the missing Requires list |
|
107 |
-* Thu Jul 23 2015 Divya Thaluru <dthaluru@vmware.com> 1.0.2-2 |
|
108 |
-- Building with dhclient. |
|
109 |
-* Tue Jun 23 2015 Divya Thaluru <dthaluru@vmware.com> 1.0.2-1 |
|
110 |
-- Initial build. |
|
100 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 1.0.10-3 |
|
101 |
+- Change systemd dependency |
|
102 |
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.10-2 |
|
103 |
+- GA - Bump release of all rpms |
|
104 |
+* Tue Feb 23 2016 Anish Swaminathan <anishs@vmware.com> 1.0.10-1 |
|
105 |
+- Upgrade to 1.0.10 |
|
106 |
+* Mon Dec 14 2015 Anish Swaminathan<anishs@vmware.com> 1.0.2-4 |
|
107 |
+- Adding the missing BuildRequires |
|
108 |
+* Tue Sep 22 2015 Harish Udaiya Kumar<hudaiyakumar@vmware.com> 1.0.2-3 |
|
109 |
+- Adding the missing Requires list |
|
110 |
+* Thu Jul 23 2015 Divya Thaluru <dthaluru@vmware.com> 1.0.2-2 |
|
111 |
+- Building with dhclient. |
|
112 |
+* Tue Jun 23 2015 Divya Thaluru <dthaluru@vmware.com> 1.0.2-1 |
|
113 |
+- Initial build. |
... | ... |
@@ -1,27 +1,27 @@ |
1 |
-Summary: DBus for systemd |
|
2 |
-Name: dbus |
|
3 |
-Version: 1.8.8 |
|
4 |
-Release: 6%{?dist} |
|
5 |
-License: GPLv2+ or AFL |
|
6 |
-URL: http://www.freedesktop.org/wiki/Software/dbus |
|
7 |
-Group: Applications/File |
|
8 |
-Source0: http://dbus.freedesktop.org/releases/dbus/%{name}-%{version}.tar.gz |
|
1 |
+Summary: DBus for systemd |
|
2 |
+Name: dbus |
|
3 |
+Version: 1.8.8 |
|
4 |
+Release: 7%{?dist} |
|
5 |
+License: GPLv2+ or AFL |
|
6 |
+URL: http://www.freedesktop.org/wiki/Software/dbus |
|
7 |
+Group: Applications/File |
|
8 |
+Source0: http://dbus.freedesktop.org/releases/dbus/%{name}-%{version}.tar.gz |
|
9 | 9 |
%define sha1 dbus=e0d10e8b4494383c7e366ac80a942ba45a705a96 |
10 |
-Vendor: VMware, Inc. |
|
11 |
-Distribution: Photon |
|
12 |
-BuildRequires: expat |
|
13 |
-BuildRequires: systemd |
|
14 |
-BuildRequires: xz-devel |
|
15 |
-Requires: expat |
|
16 |
-Requires: systemd |
|
17 |
-Requires: xz |
|
10 |
+Vendor: VMware, Inc. |
|
11 |
+Distribution: Photon |
|
12 |
+BuildRequires: expat |
|
13 |
+BuildRequires: systemd-devel |
|
14 |
+BuildRequires: xz-devel |
|
15 |
+Requires: expat |
|
16 |
+Requires: systemd |
|
17 |
+Requires: xz |
|
18 | 18 |
%description |
19 | 19 |
The dbus package contains dbus. |
20 | 20 |
|
21 |
-%package devel |
|
22 |
-Summary: Header and development files |
|
23 |
-Requires: %{name} = %{version} |
|
24 |
-%description devel |
|
21 |
+%package devel |
|
22 |
+Summary: Header and development files |
|
23 |
+Requires: %{name} = %{version} |
|
24 |
+%description devel |
|
25 | 25 |
It contains the libraries and header files to create applications |
26 | 26 |
|
27 | 27 |
%prep |
... | ... |
@@ -62,7 +62,7 @@ make %{?_smp_mflags} check |
62 | 62 |
%exclude %{_libdir}/*.so |
63 | 63 |
%exclude %{_libdir}/pkgconfig/*.pc |
64 | 64 |
|
65 |
-%files devel |
|
65 |
+%files devel |
|
66 | 66 |
%defattr(-,root,root) |
67 | 67 |
%{_includedir}/* |
68 | 68 |
%{_libdir}/pkgconfig/*.pc |
... | ... |
@@ -71,15 +71,17 @@ make %{?_smp_mflags} check |
71 | 71 |
%{_libdir}/*.so |
72 | 72 |
|
73 | 73 |
%changelog |
74 |
-* Wed Oct 05 2016 ChangLee <changlee@vmware.com> 1.8.8-6 |
|
75 |
-- Modified %check |
|
76 |
-* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.8.8-5 |
|
77 |
-- GA - Bump release of all rpms |
|
78 |
-* Tue Sep 22 2015 Harish Udaiya Kumar <hudaiyakumar@vmware.com> 1.8.8-4 |
|
79 |
-- Created devel sub-package |
|
74 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 1.8.8-7 |
|
75 |
+- Change systemd dependency |
|
76 |
+* Wed Oct 05 2016 ChangLee <changlee@vmware.com> 1.8.8-6 |
|
77 |
+- Modified %check |
|
78 |
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.8.8-5 |
|
79 |
+- GA - Bump release of all rpms |
|
80 |
+* Tue Sep 22 2015 Harish Udaiya Kumar <hudaiyakumar@vmware.com> 1.8.8-4 |
|
81 |
+- Created devel sub-package |
|
80 | 82 |
* Thu Jun 25 2015 Sharath George <sharathg@vmware.com> 1.8.8-3 |
81 | 83 |
- Remove debug files. |
82 | 84 |
* Mon May 18 2015 Touseef Liaqat <tliaqat@vmware.com> 1.8.8-2 |
83 | 85 |
- Update according to UsrMove. |
84 |
-* Sun Apr 06 2014 Sharath George <sharathg@vmware.com> 1.8.8 |
|
85 |
-- Initial build. First version |
|
86 |
+* Sun Apr 06 2014 Sharath George <sharathg@vmware.com> 1.8.8 |
|
87 |
+- Initial build. First version |
... | ... |
@@ -1,39 +1,41 @@ |
1 |
-Summary: Provide tools to manage multipath devices |
|
2 |
-Name: device-mapper-multipath |
|
3 |
-Version: 0.5.0 |
|
4 |
-Release: 2%{?dist} |
|
5 |
-License: GPL+ |
|
6 |
-Group: System Environment/Base |
|
7 |
-URL: http://christophe.varoqui.free.fr/ |
|
8 |
-Source0: http://christophe.varoqui.free.fr/multipath-tools/multipath-tools-0.5.0.tar.bz2 |
|
1 |
+Summary: Provide tools to manage multipath devices |
|
2 |
+Name: device-mapper-multipath |
|
3 |
+Version: 0.5.0 |
|
4 |
+Release: 3%{?dist} |
|
5 |
+License: GPL+ |
|
6 |
+Group: System Environment/Base |
|
7 |
+URL: http://christophe.varoqui.free.fr/ |
|
8 |
+Source0: http://christophe.varoqui.free.fr/multipath-tools/multipath-tools-0.5.0.tar.bz2 |
|
9 | 9 |
%define sha1 multipath-tools=dcd889c09bcb1f2b89900838da6ac1ed970104cb |
10 |
-BuildRequires: libaio-devel |
|
11 |
-BuildRequires: device-mapper-devel |
|
12 |
-BuildRequires: libselinux-devel |
|
13 |
-BuildRequires: libsepol-devel |
|
14 |
-BuildRequires: readline-devel |
|
15 |
-BuildRequires: ncurses-devel |
|
16 |
-BuildRequires: systemd |
|
17 |
-Requires: libaio |
|
18 |
-Requires: device-mapper |
|
19 |
-Requires: libselinux |
|
20 |
-Requires: libsepol |
|
21 |
-Requires: readline |
|
22 |
-Requires: ncurses |
|
23 |
-Requires: kpartx = %{version}-%{release} |
|
10 |
+Patch0: makefile-systemd.patch |
|
11 |
+BuildRequires: libaio-devel |
|
12 |
+BuildRequires: device-mapper-devel |
|
13 |
+BuildRequires: libselinux-devel |
|
14 |
+BuildRequires: libsepol-devel |
|
15 |
+BuildRequires: readline-devel |
|
16 |
+BuildRequires: ncurses-devel |
|
17 |
+BuildRequires: systemd-devel |
|
18 |
+Requires: libaio |
|
19 |
+Requires: device-mapper |
|
20 |
+Requires: libselinux |
|
21 |
+Requires: libsepol |
|
22 |
+Requires: readline |
|
23 |
+Requires: ncurses |
|
24 |
+Requires: kpartx = %{version}-%{release} |
|
24 | 25 |
|
25 | 26 |
%description |
26 | 27 |
Device-mapper-multipath provides tools to manage multipath devices by |
27 | 28 |
instructing the device-mapper multipath kernel module what to do. |
28 | 29 |
|
29 | 30 |
%package -n kpartx |
30 |
-Summary: Partition device manager for device-mapper devices |
|
31 |
+Summary: Partition device manager for device-mapper devices |
|
31 | 32 |
|
32 | 33 |
%description -n kpartx |
33 | 34 |
kpartx manages partition creation and removal for device-mapper devices. |
34 | 35 |
|
35 | 36 |
%prep |
36 | 37 |
%setup -qn multipath-tools-0.5.0 |
38 |
+%patch0 -p1 |
|
37 | 39 |
|
38 | 40 |
%build |
39 | 41 |
make %{?_smp_mflags} |
... | ... |
@@ -71,8 +73,10 @@ rm -rf %{buildroot} |
71 | 71 |
%{_mandir}/man8/kpartx.8.gz |
72 | 72 |
|
73 | 73 |
%changelog |
74 |
-* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 0.5.0-2 |
|
75 |
-- GA - Bump release of all rpms |
|
76 |
-* Mon Jun 22 2015 Divya Thaluru <dthaluru@vmware.com> 0.5.0-1 |
|
77 |
-- Initial build. First version |
|
74 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 0.5.0-3 |
|
75 |
+- Change systemd dependency |
|
76 |
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 0.5.0-2 |
|
77 |
+- GA - Bump release of all rpms |
|
78 |
+* Mon Jun 22 2015 Divya Thaluru <dthaluru@vmware.com> 0.5.0-1 |
|
79 |
+- Initial build. First version |
|
78 | 80 |
|
79 | 81 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,32 @@ |
0 |
+diff -rup multipath-tools-0.5.0/libmultipath/Makefile multipath-tools-0.5.0-new/libmultipath/Makefile |
|
1 |
+--- multipath-tools-0.5.0/libmultipath/Makefile 2013-12-17 13:40:41.000000000 -0800 |
|
2 |
+@@ -9,7 +9,11 @@ DEVLIB = libmultipath.so |
|
3 |
+ LIBS = $(DEVLIB).$(SONAME) |
|
4 |
+ LIBDEPS = -lpthread -ldl -ldevmapper -ludev |
|
5 |
+ ifdef SYSTEMD |
|
6 |
+- LIBDEPS += -lsystemd-daemon |
|
7 |
++ ifeq ($(shell test $(SYSTEMD) -gt 209 && echo 1), 1) |
|
8 |
++ LIBDEPS += -lsystemd |
|
9 |
++ else |
|
10 |
++ LIBDEPS += -lsystemd-daemon |
|
11 |
++ endif |
|
12 |
+ endif |
|
13 |
+ |
|
14 |
+ OBJS = memory.o parser.o vector.o devmapper.o callout.o \ |
|
15 |
+diff -rup multipath-tools-0.5.0/multipathd/Makefile multipath-tools-0.5.0-new/multipathd/Makefile |
|
16 |
+--- multipath-tools-0.5.0/multipathd/Makefile 2013-12-17 13:40:41.000000000 -0800 |
|
17 |
+@@ -11,7 +11,11 @@ ifdef SYSTEMD |
|
18 |
+ endif |
|
19 |
+ LDFLAGS += -lpthread -ldevmapper -lreadline |
|
20 |
+ ifdef SYSTEMD |
|
21 |
+- LDFLAGS += -lsystemd-daemon |
|
22 |
++ ifeq ($(shell test $(SYSTEMD) -gt 209 && echo 1), 1) |
|
23 |
++ LDFLAGS += -lsystemd |
|
24 |
++ else |
|
25 |
++ LDFLAGS += -lsystemd-daemon |
|
26 |
++ endif |
|
27 |
+ endif |
|
28 |
+ LDFLAGS += -ludev -ldl \ |
|
29 |
+ -L$(multipathdir) -lmultipath -L$(mpathpersistdir) -lmpathpersist |
0 | 30 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,21 @@ |
0 |
+From d4efc0aeeecc470d9a267b7f3c130f472488905c Mon Sep 17 00:00:00 2001 |
|
1 |
+From: Harald Hoyer <harald@redhat.com> |
|
2 |
+Date: Wed, 25 May 2016 15:06:29 +0200 |
|
3 |
+Subject: [PATCH] systemd-initrd: add initrd-root-device.target |
|
4 |
+ |
|
5 |
+--- |
|
6 |
+ modules.d/01systemd-initrd/module-setup.sh | 1 + |
|
7 |
+ 1 file changed, 1 insertion(+) |
|
8 |
+ |
|
9 |
+diff --git a/modules.d/01systemd-initrd/module-setup.sh b/modules.d/01systemd-initrd/module-setup.sh |
|
10 |
+index fb6a9ea..c1ccd2a 100755 |
|
11 |
+--- a/modules.d/01systemd-initrd/module-setup.sh |
|
12 |
+@@ -28,6 +28,7 @@ install() { |
|
13 |
+ inst_multiple -o \ |
|
14 |
+ $systemdsystemunitdir/initrd.target \ |
|
15 |
+ $systemdsystemunitdir/initrd-fs.target \ |
|
16 |
++ $systemdsystemunitdir/initrd-root-device.target \ |
|
17 |
+ $systemdsystemunitdir/initrd-root-fs.target \ |
|
18 |
+ $systemdsystemunitdir/initrd-switch-root.target \ |
|
19 |
+ $systemdsystemunitdir/initrd-switch-root.service \ |
... | ... |
@@ -5,7 +5,7 @@ |
5 | 5 |
|
6 | 6 |
Name: dracut |
7 | 7 |
Version: 044 |
8 |
-Release: 4%{?dist} |
|
8 |
+Release: 5%{?dist} |
|
9 | 9 |
Group: System Environment/Base |
10 | 10 |
# The entire source code is GPLv2+ |
11 | 11 |
# except install/* which is LGPLv2+ |
... | ... |
@@ -18,6 +18,7 @@ Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar |
18 | 18 |
Source1: https://sourceforge.net/projects/asciidoc/files/asciidoc/8.6.9/asciidoc-8.6.9.tar.gz |
19 | 19 |
%define sha1 asciidoc=82e574dd061640561fa0560644bc74df71fb7305 |
20 | 20 |
Patch0: https://www.gnu.org/licenses/lgpl-2.1.txt |
21 |
+Patch1: dracut-add-systemd-initrd-module.patch |
|
21 | 22 |
Summary: dracut to create initramfs |
22 | 23 |
Vendor: VMware, Inc. |
23 | 24 |
Distribution: Photon |
... | ... |
@@ -47,6 +48,7 @@ This package contains tools to assemble the local initrd and host configuration. |
47 | 47 |
%setup -q -n %{name}-%{version} |
48 | 48 |
cp %{PATCH0} . |
49 | 49 |
tar xf %{SOURCE1} --no-same-owner |
50 |
+%patch1 -p1 |
|
50 | 51 |
|
51 | 52 |
%build |
52 | 53 |
%configure --systemdsystemunitdir=%{_unitdir} --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) --libdir=%{_prefix}/lib \ |
... | ... |
@@ -156,6 +158,8 @@ rm -rf -- $RPM_BUILD_ROOT |
156 | 156 |
%dir /var/lib/dracut/overlay |
157 | 157 |
|
158 | 158 |
%changelog |
159 |
+* Wed Nov 23 2016 Anish Swaminathan <anishs@vmware.com> 044-5 |
|
160 |
+- Add systemd initrd root device target to list of modules |
|
159 | 161 |
* Fri Oct 07 2016 ChangLee <changlee@vmware.com> 044-4 |
160 | 162 |
- Modified %check |
161 | 163 |
* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 044-3 |
... | ... |
@@ -1,20 +1,21 @@ |
1 | 1 |
%define debug_package %{nil} |
2 | 2 |
%define __os_install_post %{nil} |
3 |
-Summary: GRand Unified Bootloader |
|
4 |
-Name: grub2-efi |
|
5 |
-Version: 2.02 |
|
6 |
-Release: 3%{?dist} |
|
7 |
-License: GPLv3+ |
|
8 |
-URL: http://www.gnu.org/software/grub |
|
9 |
-Group: Applications/System |
|
10 |
-Vendor: VMware, Inc. |
|
11 |
-Distribution: Photon |
|
12 |
-Source0: http://alpha.gnu.org/gnu/grub/grub-2.02~beta2.tar.gz |
|
3 |
+Summary: GRand Unified Bootloader |
|
4 |
+Name: grub2-efi |
|
5 |
+Version: 2.02 |
|
6 |
+Release: 4%{?dist} |
|
7 |
+License: GPLv3+ |
|
8 |
+URL: http://www.gnu.org/software/grub |
|
9 |
+Group: Applications/System |
|
10 |
+Vendor: VMware, Inc. |
|
11 |
+Distribution: Photon |
|
12 |
+Source0: http://alpha.gnu.org/gnu/grub/grub-2.02~beta2.tar.gz |
|
13 | 13 |
%define sha1 grub=b2c9227f9a54587532ae3f727d197ab112cdbbb3 |
14 |
-BuildRequires: device-mapper-devel |
|
15 |
-BuildRequires: xz-devel |
|
16 |
-Requires: xz |
|
17 |
-Requires: device-mapper |
|
14 |
+BuildRequires: device-mapper-devel |
|
15 |
+BuildRequires: xz-devel |
|
16 |
+BuildRequires: systemd-devel |
|
17 |
+Requires: xz |
|
18 |
+Requires: device-mapper |
|
18 | 19 |
%description |
19 | 20 |
The GRUB package contains the GRand Unified Bootloader. |
20 | 21 |
|
... | ... |
@@ -32,14 +33,14 @@ These are the additional language files of grub. |
32 | 32 |
%build |
33 | 33 |
|
34 | 34 |
./configure \ |
35 |
- --prefix=%{_prefix} \ |
|
36 |
- --sbindir=/sbin \ |
|
37 |
- --sysconfdir=%{_sysconfdir} \ |
|
38 |
- --disable-grub-emu-usb \ |
|
39 |
- --disable-werror \ |
|
35 |
+ --prefix=%{_prefix} \ |
|
36 |
+ --sbindir=/sbin \ |
|
37 |
+ --sysconfdir=%{_sysconfdir} \ |
|
38 |
+ --disable-grub-emu-usb \ |
|
39 |
+ --disable-werror \ |
|
40 | 40 |
--disable-efiemu \ |
41 |
- --program-transform-name=s,grub,%{name}, \ |
|
42 |
- --with-grubdir=grub2 \ |
|
41 |
+ --program-transform-name=s,grub,%{name}, \ |
|
42 |
+ --with-grubdir=grub2 \ |
|
43 | 43 |
--with-platform=efi \ |
44 | 44 |
--target=x86_64 \ |
45 | 45 |
--with-program-prefix="" \ |
... | ... |
@@ -56,8 +57,8 @@ ln -sf %{_sysconfdir}/default/grub %{buildroot}%{_sysconfdir}/sysconfig/grub |
56 | 56 |
mkdir -p %{buildroot}/boot/%{name} |
57 | 57 |
touch %{buildroot}/boot/%{name}/grub.cfg |
58 | 58 |
rm -rf %{buildroot}%{_infodir} |
59 |
-%post -p /sbin/ldconfig |
|
60 |
-%postun -p /sbin/ldconfig |
|
59 |
+%post -p /sbin/ldconfig |
|
60 |
+%postun -p /sbin/ldconfig |
|
61 | 61 |
%files |
62 | 62 |
%defattr(-,root,root) |
63 | 63 |
%dir %{_sysconfdir}/grub.d |
... | ... |
@@ -82,9 +83,11 @@ rm -rf %{buildroot}%{_infodir} |
82 | 82 |
/usr/share/locale/* |
83 | 83 |
|
84 | 84 |
%changelog |
85 |
-* Thu Oct 06 2016 ChangLee <changlee@vmware.com> 2.02-3 |
|
86 |
-- Modified %check |
|
87 |
-* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.02-2 |
|
88 |
-- GA - Bump release of all rpms |
|
89 |
-* Fri Jul 31 2015 Sharath George <sharathg@vmware.com> 2.02-1 |
|
90 |
-- Adding EFI support. |
|
85 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 2.02-4 |
|
86 |
+- Change systemd dependency |
|
87 |
+* Thu Oct 06 2016 ChangLee <changlee@vmware.com> 2.02-3 |
|
88 |
+- Modified %check |
|
89 |
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.02-2 |
|
90 |
+- GA - Bump release of all rpms |
|
91 |
+* Fri Jul 31 2015 Sharath George <sharathg@vmware.com> 2.02-1 |
|
92 |
+- Adding EFI support. |
... | ... |
@@ -1,21 +1,22 @@ |
1 | 1 |
%define debug_package %{nil} |
2 | 2 |
%define __os_install_post %{nil} |
3 |
-Summary: GRand Unified Bootloader |
|
4 |
-Name: grub2 |
|
5 |
-Version: 2.02 |
|
6 |
-Release: 5%{?dist} |
|
7 |
-License: GPLv3+ |
|
8 |
-URL: http://www.gnu.org/software/grub |
|
9 |
-Group: Applications/System |
|
10 |
-Vendor: VMware, Inc. |
|
11 |
-Distribution: Photon |
|
12 |
-Source0: http://alpha.gnu.org/gnu/grub/grub-2.02~beta2.tar.gz |
|
3 |
+Summary: GRand Unified Bootloader |
|
4 |
+Name: grub2 |
|
5 |
+Version: 2.02 |
|
6 |
+Release: 6%{?dist} |
|
7 |
+License: GPLv3+ |
|
8 |
+URL: http://www.gnu.org/software/grub |
|
9 |
+Group: Applications/System |
|
10 |
+Vendor: VMware, Inc. |
|
11 |
+Distribution: Photon |
|
12 |
+Source0: http://alpha.gnu.org/gnu/grub/grub-2.02~beta2.tar.gz |
|
13 | 13 |
%define sha1 grub=b2c9227f9a54587532ae3f727d197ab112cdbbb3 |
14 |
-Patch0: Fix_to_boot_entries_with_out_password.patch |
|
15 |
-BuildRequires: device-mapper-devel |
|
16 |
-BuildRequires: xz-devel |
|
17 |
-Requires: xz |
|
18 |
-Requires: device-mapper |
|
14 |
+Patch0: Fix_to_boot_entries_with_out_password.patch |
|
15 |
+BuildRequires: device-mapper-devel |
|
16 |
+BuildRequires: xz-devel |
|
17 |
+BuildRequires: systemd-devel |
|
18 |
+Requires: xz |
|
19 |
+Requires: device-mapper |
|
19 | 20 |
%description |
20 | 21 |
The GRUB package contains the GRand Unified Bootloader. |
21 | 22 |
|
... | ... |
@@ -33,14 +34,14 @@ These are the additional language files of grub. |
33 | 33 |
#sed -i -e '/gets is a/d' grub-core/gnulib/stdio.in.h |
34 | 34 |
%build |
35 | 35 |
./configure \ |
36 |
- --prefix=%{_prefix} \ |
|
37 |
- --sbindir=/sbin \ |
|
38 |
- --sysconfdir=%{_sysconfdir} \ |
|
39 |
- --disable-grub-emu-usb \ |
|
40 |
- --disable-efiemu \ |
|
41 |
- --disable-werror \ |
|
42 |
- --program-transform-name=s,grub,%{name}, \ |
|
43 |
- --with-grubdir=%{name} |
|
36 |
+ --prefix=%{_prefix} \ |
|
37 |
+ --sbindir=/sbin \ |
|
38 |
+ --sysconfdir=%{_sysconfdir} \ |
|
39 |
+ --disable-grub-emu-usb \ |
|
40 |
+ --disable-efiemu \ |
|
41 |
+ --disable-werror \ |
|
42 |
+ --program-transform-name=s,grub,%{name}, \ |
|
43 |
+ --with-grubdir=%{name} |
|
44 | 44 |
make %{?_smp_mflags} |
45 | 45 |
|
46 | 46 |
%install |
... | ... |
@@ -52,8 +53,8 @@ ln -sf %{_sysconfdir}/default/grub %{buildroot}%{_sysconfdir}/sysconfig/grub |
52 | 52 |
mkdir -p %{buildroot}/boot/%{name} |
53 | 53 |
touch %{buildroot}/boot/%{name}/grub.cfg |
54 | 54 |
rm -rf %{buildroot}%{_infodir} |
55 |
-%post -p /sbin/ldconfig |
|
56 |
-%postun -p /sbin/ldconfig |
|
55 |
+%post -p /sbin/ldconfig |
|
56 |
+%postun -p /sbin/ldconfig |
|
57 | 57 |
%files |
58 | 58 |
%defattr(-,root,root) |
59 | 59 |
%dir %{_sysconfdir}/grub.d |
... | ... |
@@ -78,15 +79,17 @@ rm -rf %{buildroot}%{_infodir} |
78 | 78 |
/usr/share/locale/* |
79 | 79 |
|
80 | 80 |
%changelog |
81 |
-* Thu Oct 06 2016 ChangLee <changlee@vmware.com> 2.02-5 |
|
82 |
-- Modified %check |
|
83 |
-* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.02-4 |
|
84 |
-- GA - Bump release of all rpms |
|
85 |
-* Fri Oct 02 2015 Divya Thaluru <dthaluru@vmware.com> 2.02-3 |
|
86 |
-- Adding patch to boot entries with out password. |
|
87 |
-* Wed Jul 22 2015 Divya Thaluru <dthaluru@vmware.com> 2.02-2 |
|
88 |
-- Changing program name from grub to grub2. |
|
89 |
-* Mon Jun 29 2015 Divya Thaluru <dthaluru@vmware.com> 2.02-1 |
|
90 |
-- Updating grub to 2.02 |
|
91 |
-* Wed Nov 5 2014 Divya Thaluru <dthaluru@vmware.com> 2.00-1 |
|
92 |
-- Initial build. First version |
|
81 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 2.02-6 |
|
82 |
+- Change systemd dependency |
|
83 |
+* Thu Oct 06 2016 ChangLee <changlee@vmware.com> 2.02-5 |
|
84 |
+- Modified %check |
|
85 |
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.02-4 |
|
86 |
+- GA - Bump release of all rpms |
|
87 |
+* Fri Oct 02 2015 Divya Thaluru <dthaluru@vmware.com> 2.02-3 |
|
88 |
+- Adding patch to boot entries with out password. |
|
89 |
+* Wed Jul 22 2015 Divya Thaluru <dthaluru@vmware.com> 2.02-2 |
|
90 |
+- Changing program name from grub to grub2. |
|
91 |
+* Mon Jun 29 2015 Divya Thaluru <dthaluru@vmware.com> 2.02-1 |
|
92 |
+- Updating grub to 2.02 |
|
93 |
+* Wed Nov 5 2014 Divya Thaluru <dthaluru@vmware.com> 2.00-1 |
|
94 |
+- Initial build. First version |
... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
Summary: initramfs |
2 | 2 |
Name: initramfs |
3 | 3 |
Version: 1.0 |
4 |
-Release: 5%{?kernelsubrelease}%{?dist} |
|
4 |
+Release: 6%{?kernelsubrelease}%{?dist} |
|
5 | 5 |
License: Apache License |
6 | 6 |
Group: System Environment/Base |
7 | 7 |
Vendor: VMware, Inc. |
... | ... |
@@ -44,6 +44,8 @@ rm -rf $RPM_BUILD_ROOT |
44 | 44 |
/boot/initrd.img-%{KERNEL_VERSION}-%{KERNEL_RELEASE} |
45 | 45 |
|
46 | 46 |
%changelog |
47 |
+* Wed Nov 23 2016 Anish Swaminathan <anishs@vmware.com> 1.0-6 |
|
48 |
+- Dracut module change to include systemd initrd target |
|
47 | 49 |
* Tue Sep 20 2016 Alexey Makhalov <amakhalov@vmware.com> 1.0-5 |
48 | 50 |
- Added fsck tools |
49 | 51 |
- Use kernel version and release number in initrd file name |
... | ... |
@@ -1,15 +1,15 @@ |
1 |
-Summary: Irqbalance daemon |
|
2 |
-Name: irqbalance |
|
3 |
-Version: 1.1.0 |
|
4 |
-Release: 3%{?dist} |
|
5 |
-License: GPLv2 |
|
6 |
-URL: https://github.com/Irqbalance/irqbalance |
|
7 |
-Group: System Environment/Services |
|
8 |
-Vendor: VMware, Inc. |
|
9 |
-Distribution: Photon |
|
10 |
-Source0: https://github.com/Irqbalance/%{name}/archive/v%{version}.tar.gz |
|
1 |
+Summary: Irqbalance daemon |
|
2 |
+Name: irqbalance |
|
3 |
+Version: 1.1.0 |
|
4 |
+Release: 4%{?dist} |
|
5 |
+License: GPLv2 |
|
6 |
+URL: https://github.com/Irqbalance/irqbalance |
|
7 |
+Group: System Environment/Services |
|
8 |
+Vendor: VMware, Inc. |
|
9 |
+Distribution: Photon |
|
10 |
+Source0: https://github.com/Irqbalance/%{name}/archive/v%{version}.tar.gz |
|
11 | 11 |
%define sha1 v1=bffafb547dd24a15645dbd1968c440218de6425d |
12 |
-BuildRequires: systemd |
|
12 |
+BuildRequires: systemd-devel |
|
13 | 13 |
Requires: systemd |
14 | 14 |
%description |
15 | 15 |
Irqbalance is a daemon to help balance the cpu load generated by |
... | ... |
@@ -17,12 +17,13 @@ interrupts across all of a systems cpus. |
17 | 17 |
%prep |
18 | 18 |
%setup -q |
19 | 19 |
%build |
20 |
+sed -i 's/libsystemd-journal/libsystemd/' configure.ac |
|
20 | 21 |
./autogen.sh |
21 | 22 |
./configure \ |
22 |
- --prefix=%{_prefix} \ |
|
23 |
- --disable-static \ |
|
24 |
- --with-systemd |
|
25 |
- |
|
23 |
+ --prefix=%{_prefix} \ |
|
24 |
+ --disable-static \ |
|
25 |
+ --with-systemd |
|
26 |
+ |
|
26 | 27 |
make %{?_smp_mflags} |
27 | 28 |
%install |
28 | 29 |
make DESTDIR=%{buildroot} install |
... | ... |
@@ -46,9 +47,11 @@ install -D -m 0644 misc/irqbalance.service %{buildroot}%{_prefix}/lib/systemd/sy |
46 | 46 |
%{_datadir}/* |
47 | 47 |
|
48 | 48 |
%changelog |
49 |
-* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.1.0-3 |
|
50 |
-- GA - Bump release of all rpms |
|
51 |
-* Thu May 05 2016 Kumar Kaushik <kaushikk@vmware.com> 1.1.0-2 |
|
52 |
-- Adding package upgrade support. |
|
53 |
-* Fri Jan 15 2016 Alexey Makhalov <amakhalov@vmware.com> 1.1.0-1 |
|
54 |
-- Initial version |
|
49 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 1.1.0-4 |
|
50 |
+- Change systemd dependency |
|
51 |
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.1.0-3 |
|
52 |
+- GA - Bump release of all rpms |
|
53 |
+* Thu May 05 2016 Kumar Kaushik <kaushikk@vmware.com> 1.1.0-2 |
|
54 |
+- Adding package upgrade support. |
|
55 |
+* Fri Jan 15 2016 Alexey Makhalov <amakhalov@vmware.com> 1.1.0-1 |
|
56 |
+- Initial version |
... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
Summary: A library providing GObject bindings for libudev |
2 | 2 |
Name: libgudev |
3 | 3 |
Version: 230 |
4 |
-Release: 3%{?dist} |
|
4 |
+Release: 4%{?dist} |
|
5 | 5 |
License: LGPL2.1 |
6 | 6 |
URL: https://git.gnome.org/browse/libgudev/ |
7 | 7 |
Source0: https://git.gnome.org/browse/%{name}/snapshot/%{name}-%{version}.tar.xz |
... | ... |
@@ -14,7 +14,7 @@ BuildRequires: gnome-common |
14 | 14 |
BuildRequires: gobject-introspection |
15 | 15 |
BuildRequires: gtk-doc |
16 | 16 |
BuildRequires: pkg-config |
17 |
-BuildRequires: systemd |
|
17 |
+BuildRequires: systemd-devel |
|
18 | 18 |
BuildRequires: which |
19 | 19 |
Requires: systemd |
20 | 20 |
Provides: libgudev-1.0.so=0-64 |
... | ... |
@@ -44,9 +44,9 @@ make %{?_smp_mflags} |
44 | 44 |
%install |
45 | 45 |
make DESTDIR=%{buildroot} install |
46 | 46 |
|
47 |
-%post -p /sbin/ldconfig |
|
47 |
+%post -p /sbin/ldconfig |
|
48 | 48 |
|
49 |
-%postun -p /sbin/ldconfig |
|
49 |
+%postun -p /sbin/ldconfig |
|
50 | 50 |
|
51 | 51 |
%files |
52 | 52 |
%defattr(-,root,root) |
... | ... |
@@ -66,10 +66,12 @@ make DESTDIR=%{buildroot} install |
66 | 66 |
%{_libdir}/pkgconfig/gudev-1.0.pc |
67 | 67 |
|
68 | 68 |
%changelog |
69 |
-* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 230-3 |
|
70 |
-- GA - Bump release of all rpms |
|
71 |
-* Thu Aug 13 2015 Vinay Kulkarni <kulkarniv@vmware.com> 230-2 |
|
72 |
-- Split header files into devel package. |
|
73 |
-* Tue Aug 11 2015 Vinay Kulkarni <kulkarniv@vmware.com> 230-1 |
|
74 |
-- Add libgudev v230 |
|
69 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 230-4 |
|
70 |
+- Change systemd dependency |
|
71 |
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 230-3 |
|
72 |
+- GA - Bump release of all rpms |
|
73 |
+* Thu Aug 13 2015 Vinay Kulkarni <kulkarniv@vmware.com> 230-2 |
|
74 |
+- Split header files into devel package. |
|
75 |
+* Tue Aug 11 2015 Vinay Kulkarni <kulkarniv@vmware.com> 230-1 |
|
76 |
+- Add libgudev v230 |
|
75 | 77 |
|
... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
Summary: A library which allows userspace access to USB devices |
2 | 2 |
Name: libusb |
3 | 3 |
Version: 1.0.20 |
4 |
-Release: 3%{?dist} |
|
4 |
+Release: 4%{?dist} |
|
5 | 5 |
License: LGPLv2+ |
6 | 6 |
URL: http://sourceforge.net/projects/libusb/ |
7 | 7 |
Group: System Environment/Libraries |
... | ... |
@@ -9,7 +9,7 @@ Vendor: VMware, Inc. |
9 | 9 |
Distribution: Photon |
10 | 10 |
Source: http://downloads.sourceforge.net/libusb/libusb-%{version}.tar.bz2 |
11 | 11 |
%define sha1 libusb=9537243f165927bde74ad742e6b3effb0bd50cd2 |
12 |
-BuildRequires: systemd |
|
12 |
+BuildRequires: systemd-devel |
|
13 | 13 |
Requires: systemd |
14 | 14 |
|
15 | 15 |
%description |
... | ... |
@@ -54,10 +54,12 @@ popd |
54 | 54 |
%{_libdir}/pkgconfig/* |
55 | 55 |
|
56 | 56 |
%changelog |
57 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 1.0.20-4 |
|
58 |
+- Change systemd dependency |
|
57 | 59 |
* Tue Jul 12 2016 Xiaolin Li <xiaolinl@vmware.com> 1.0.20-3 |
58 | 60 |
- Build libusb single threaded. |
59 |
-* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.20-2 |
|
60 |
-- GA - Bump release of all rpms |
|
61 |
-* Thu May 05 2016 Nick Shi <nshi@vmware.com> 1.0.20-1 |
|
62 |
-- Initial version |
|
61 |
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.0.20-2 |
|
62 |
+- GA - Bump release of all rpms |
|
63 |
+* Thu May 05 2016 Nick Shi <nshi@vmware.com> 1.0.20-1 |
|
64 |
+- Initial version |
|
63 | 65 |
|
... | ... |
@@ -1,29 +1,29 @@ |
1 |
-Summary: Userland logical volume management tools |
|
2 |
-Name: lvm2 |
|
3 |
-Version: 2.02.141 |
|
4 |
-Release: 5%{?dist} |
|
5 |
-License: GPLv2 |
|
6 |
-Group: System Environment/Base |
|
7 |
-URL: http://sources.redhat.com/dm |
|
8 |
-Vendor: VMware, Inc. |
|
9 |
-Distribution: Photon |
|
10 |
-Source0: ftp://sources.redhat.com/pub/lvm2/releases/LVM2.%{version}.tgz |
|
1 |
+Summary: Userland logical volume management tools |
|
2 |
+Name: lvm2 |
|
3 |
+Version: 2.02.141 |
|
4 |
+Release: 6%{?dist} |
|
5 |
+License: GPLv2 |
|
6 |
+Group: System Environment/Base |
|
7 |
+URL: http://sources.redhat.com/dm |
|
8 |
+Vendor: VMware, Inc. |
|
9 |
+Distribution: Photon |
|
10 |
+Source0: ftp://sources.redhat.com/pub/lvm2/releases/LVM2.%{version}.tgz |
|
11 | 11 |
%define sha1 LVM2=d48b403ca10d407df394889d8dafd167a4bd4819 |
12 |
-Source1: lvm2-activate.service |
|
13 |
-Patch0: lvm2-set-default-preferred_names.patch |
|
14 |
-Patch1: lvm2-enable-lvmetad-by-default.patch |
|
15 |
-Patch2: lvm2-remove-mpath-device-handling-from-udev-rules.patch |
|
16 |
-BuildRequires: libselinux-devel, libsepol-devel |
|
17 |
-BuildRequires: ncurses-devel |
|
18 |
-BuildRequires: readline-devel |
|
19 |
-BuildRequires: python2-devel |
|
20 |
-BuildRequires: python2-libs |
|
21 |
-BuildRequires: systemd |
|
22 |
-BuildRequires: thin-provisioning-tools |
|
23 |
-Requires: device-mapper-libs = %{version}-%{release} |
|
24 |
-Requires: device-mapper-event-libs = %{version}-%{release} |
|
12 |
+Source1: lvm2-activate.service |
|
13 |
+Patch0: lvm2-set-default-preferred_names.patch |
|
14 |
+Patch1: lvm2-enable-lvmetad-by-default.patch |
|
15 |
+Patch2: lvm2-remove-mpath-device-handling-from-udev-rules.patch |
|
16 |
+BuildRequires: libselinux-devel, libsepol-devel |
|
17 |
+BuildRequires: ncurses-devel |
|
18 |
+BuildRequires: readline-devel |
|
19 |
+BuildRequires: python2-devel |
|
20 |
+BuildRequires: python2-libs |
|
21 |
+BuildRequires: systemd-devel |
|
22 |
+BuildRequires: thin-provisioning-tools |
|
23 |
+Requires: device-mapper-libs = %{version}-%{release} |
|
24 |
+Requires: device-mapper-event-libs = %{version}-%{release} |
|
25 | 25 |
Requires: device-mapper-event = %{version}-%{release} |
26 |
-Requires: device-mapper = %{version}-%{release} |
|
26 |
+Requires: device-mapper = %{version}-%{release} |
|
27 | 27 |
Requires: systemd |
28 | 28 |
|
29 | 29 |
%description |
... | ... |
@@ -34,72 +34,73 @@ losetup(8)), creating volume groups (kind of virtual disks) from one |
34 | 34 |
or more physical volumes and creating one or more logical volumes |
35 | 35 |
(kind of logical partitions) in volume groups. |
36 | 36 |
|
37 |
-%package devel |
|
38 |
-Summary: Development libraries and headers |
|
39 |
-Group: Development/Libraries |
|
40 |
-License: LGPLv2 |
|
41 |
-Requires: %{name} = %{version}-%{release} |
|
42 |
-Requires: device-mapper-devel = %{version}-%{release} |
|
37 |
+%package devel |
|
38 |
+Summary: Development libraries and headers |
|
39 |
+Group: Development/Libraries |
|
40 |
+License: LGPLv2 |
|
41 |
+Requires: %{name} = %{version}-%{release} |
|
42 |
+Requires: device-mapper-devel = %{version}-%{release} |
|
43 | 43 |
Requires: util-linux-devel |
44 | 44 |
|
45 |
-%description devel |
|
45 |
+%description devel |
|
46 | 46 |
This package contains files needed to develop applications that use |
47 | 47 |
the lvm2 libraries. |
48 | 48 |
|
49 |
-%package libs |
|
50 |
-Summary: Shared libraries for lvm2 |
|
51 |
-License: LGPLv2 |
|
52 |
-Group: System Environment/Libraries |
|
53 |
-Requires: device-mapper-libs = %{version}-%{release} |
|
54 |
-Requires: device-mapper-event-libs = %{version}-%{release} |
|
49 |
+%package libs |
|
50 |
+Summary: Shared libraries for lvm2 |
|
51 |
+License: LGPLv2 |
|
52 |
+Group: System Environment/Libraries |
|
53 |
+Requires: device-mapper-libs = %{version}-%{release} |
|
54 |
+Requires: device-mapper-event-libs = %{version}-%{release} |
|
55 | 55 |
|
56 |
-%description libs |
|
56 |
+%description libs |
|
57 | 57 |
This package contains shared lvm2 libraries for applications. |
58 | 58 |
|
59 | 59 |
%post libs -p /sbin/ldconfig |
60 | 60 |
|
61 | 61 |
%postun libs -p /sbin/ldconfig |
62 | 62 |
|
63 |
-%package python-libs |
|
64 |
-Summary: Python module to access LVM |
|
65 |
-License: LGPLv2 |
|
66 |
-Group: Development/Libraries |
|
67 |
-Requires: %{name}-libs = %{version}-%{release} |
|
68 |
-Requires: python2-libs |
|
69 |
-Requires: python2 |
|
63 |
+%package python-libs |
|
64 |
+Summary: Python module to access LVM |
|
65 |
+License: LGPLv2 |
|
66 |
+Group: Development/Libraries |
|
67 |
+Requires: %{name}-libs = %{version}-%{release} |
|
68 |
+Requires: python2-libs |
|
69 |
+Requires: python2 |
|
70 | 70 |
|
71 |
-%description python-libs |
|
71 |
+%description python-libs |
|
72 | 72 |
Python module to allow the creation and use of LVM |
73 | 73 |
logical volumes, physical volumes, and volume groups. |
74 | 74 |
|
75 |
-%package -n device-mapper |
|
76 |
-Summary: Device mapper utility |
|
77 |
-Group: System Environment/Base |
|
78 |
-URL: http://sources.redhat.com/dm |
|
79 |
-Requires: device-mapper-libs |
|
80 |
-%description -n device-mapper |
|
75 |
+%package -n device-mapper |
|
76 |
+Summary: Device mapper utility |
|
77 |
+Group: System Environment/Base |
|
78 |
+URL: http://sources.redhat.com/dm |
|
79 |
+Requires: device-mapper-libs |
|
80 |
+Requires: systemd-devel |
|
81 |
+%description -n device-mapper |
|
81 | 82 |
This package contains the supporting userspace utility, dmsetup, |
82 | 83 |
for the kernel device-mapper. |
83 | 84 |
|
84 |
-%package -n device-mapper-devel |
|
85 |
-Summary: Development libraries and headers for device-mapper |
|
86 |
-License: LGPLv2 |
|
87 |
-Group: Development/Libraries |
|
88 |
-Requires: device-mapper = %{version}-%{release} |
|
89 |
-Requires: libselinux-devel |
|
90 |
-Provides: pkgconfig(devmapper) |
|
85 |
+%package -n device-mapper-devel |
|
86 |
+Summary: Development libraries and headers for device-mapper |
|
87 |
+License: LGPLv2 |
|
88 |
+Group: Development/Libraries |
|
89 |
+Requires: device-mapper = %{version}-%{release} |
|
90 |
+Requires: libselinux-devel |
|
91 |
+Provides: pkgconfig(devmapper) |
|
91 | 92 |
|
92 | 93 |
%description -n device-mapper-devel |
93 | 94 |
This package contains files needed to develop applications that use |
94 | 95 |
the device-mapper libraries. |
95 | 96 |
|
96 |
-%package -n device-mapper-libs |
|
97 |
-Summary: Device-mapper shared library |
|
98 |
-License: LGPLv2 |
|
99 |
-Group: System Environment/Libraries |
|
100 |
-Requires: libselinux |
|
101 |
-Requires: libsepol |
|
102 |
-Requires: systemd |
|
97 |
+%package -n device-mapper-libs |
|
98 |
+Summary: Device-mapper shared library |
|
99 |
+License: LGPLv2 |
|
100 |
+Group: System Environment/Libraries |
|
101 |
+Requires: libselinux |
|
102 |
+Requires: libsepol |
|
103 |
+Requires: systemd |
|
103 | 104 |
|
104 | 105 |
%description -n device-mapper-libs |
105 | 106 |
This package contains the device-mapper shared library, libdevmapper. |
... | ... |
@@ -110,11 +111,11 @@ This package contains the device-mapper shared library, libdevmapper. |
110 | 110 |
%postun -n device-mapper-libs |
111 | 111 |
/sbin/ldconfig |
112 | 112 |
|
113 |
-%package -n device-mapper-event |
|
114 |
-Summary: Device-mapper event daemon |
|
115 |
-Group: System Environment/Base |
|
116 |
-Requires: device-mapper = %{version}-%{release} |
|
117 |
-Requires: device-mapper-event-libs = %{version}-%{release} |
|
113 |
+%package -n device-mapper-event |
|
114 |
+Summary: Device-mapper event daemon |
|
115 |
+Group: System Environment/Base |
|
116 |
+Requires: device-mapper = %{version}-%{release} |
|
117 |
+Requires: device-mapper-event-libs = %{version}-%{release} |
|
118 | 118 |
Requires: systemd |
119 | 119 |
|
120 | 120 |
%description -n device-mapper-event |
... | ... |
@@ -137,11 +138,11 @@ fi |
137 | 137 |
%postun -n device-mapper-event |
138 | 138 |
%systemd_postun_with_restart dm-event.service dm-event.socket |
139 | 139 |
|
140 |
-%package -n device-mapper-event-libs |
|
141 |
-Summary: Device-mapper event daemon shared library |
|
142 |
-License: LGPLv2 |
|
143 |
-Group: System Environment/Libraries |
|
144 |
-Requires: device-mapper-libs = %{version}-%{release} |
|
140 |
+%package -n device-mapper-event-libs |
|
141 |
+Summary: Device-mapper event daemon shared library |
|
142 |
+License: LGPLv2 |
|
143 |
+Group: System Environment/Libraries |
|
144 |
+Requires: device-mapper-libs = %{version}-%{release} |
|
145 | 145 |
|
146 | 146 |
%description -n device-mapper-event-libs |
147 | 147 |
This package contains the device-mapper event daemon shared library, |
... | ... |
@@ -153,12 +154,12 @@ libdevmapper-event. |
153 | 153 |
%postun -n device-mapper-event-libs |
154 | 154 |
/sbin/ldconfig |
155 | 155 |
|
156 |
-%package -n device-mapper-event-devel |
|
157 |
-Summary: Development libraries and headers for the device-mapper event daemon |
|
158 |
-License: LGPLv2 |
|
159 |
-Group: Development/Libraries |
|
160 |
-Requires: device-mapper-event = %{version}-%{release} |
|
161 |
-Requires: device-mapper-devel = %{version}-%{release} |
|
156 |
+%package -n device-mapper-event-devel |
|
157 |
+Summary: Development libraries and headers for the device-mapper event daemon |
|
158 |
+License: LGPLv2 |
|
159 |
+Group: Development/Libraries |
|
160 |
+Requires: device-mapper-event = %{version}-%{release} |
|
161 |
+Requires: device-mapper-devel = %{version}-%{release} |
|
162 | 162 |
|
163 | 163 |
%description -n device-mapper-event-devel |
164 | 164 |
This package contains files needed to develop applications that use |
... | ... |
@@ -178,28 +179,28 @@ the device-mapper event library. |
178 | 178 |
%define _udevdir /lib/udev/rules.d |
179 | 179 |
|
180 | 180 |
%configure \ |
181 |
- --prefix=%{_prefix} \ |
|
182 |
- --with-usrlibdir=%{_libdir} \ |
|
183 |
- --with-default-dm-run-dir=%{_default_dm_run_dir} \ |
|
184 |
- --with-default-run-dir=%{_default_run_dir} \ |
|
185 |
- --with-default-pid-dir=%{_default_pid_dir} \ |
|
186 |
- --with-default-locking-dir=%{_default_locking_dir} \ |
|
187 |
- --enable-lvm1_fallback \ |
|
188 |
- --enable-fsadm \ |
|
189 |
- --with-pool=internal \ |
|
190 |
- --enable-write_install \ |
|
191 |
- --enable-pkgconfig \ |
|
192 |
- --enable-applib \ |
|
193 |
- --enable-cmdlib \ |
|
194 |
- --enable-dmeventd \ |
|
195 |
- --enable-use_lvmetad \ |
|
196 |
- --enable-python-bindings \ |
|
197 |
- --enable-blkid_wiping \ |
|
198 |
- --enable-lvmetad \ |
|
199 |
- --with-udevdir=%{_udevdir} --enable-udev_sync \ |
|
200 |
- --with-thin=internal \ |
|
201 |
- --with-cache=internal \ |
|
202 |
- --with-cluster=internal --with-clvmd=none |
|
181 |
+ --prefix=%{_prefix} \ |
|
182 |
+ --with-usrlibdir=%{_libdir} \ |
|
183 |
+ --with-default-dm-run-dir=%{_default_dm_run_dir} \ |
|
184 |
+ --with-default-run-dir=%{_default_run_dir} \ |
|
185 |
+ --with-default-pid-dir=%{_default_pid_dir} \ |
|
186 |
+ --with-default-locking-dir=%{_default_locking_dir} \ |
|
187 |
+ --enable-lvm1_fallback \ |
|
188 |
+ --enable-fsadm \ |
|
189 |
+ --with-pool=internal \ |
|
190 |
+ --enable-write_install \ |
|
191 |
+ --enable-pkgconfig \ |
|
192 |
+ --enable-applib \ |
|
193 |
+ --enable-cmdlib \ |
|
194 |
+ --enable-dmeventd \ |
|
195 |
+ --enable-use_lvmetad \ |
|
196 |
+ --enable-python-bindings \ |
|
197 |
+ --enable-blkid_wiping \ |
|
198 |
+ --enable-lvmetad \ |
|
199 |
+ --with-udevdir=%{_udevdir} --enable-udev_sync \ |
|
200 |
+ --with-thin=internal \ |
|
201 |
+ --with-cache=internal \ |
|
202 |
+ --with-cluster=internal --with-clvmd=none |
|
203 | 203 |
|
204 | 204 |
|
205 | 205 |
make %{?_smp_mflags} |
... | ... |
@@ -223,7 +224,7 @@ cp %{SOURCE1} %{buildroot}/lib/systemd/system/lvm2-activate.service |
223 | 223 |
/sbin/ldconfig |
224 | 224 |
%systemd_postun_with_restart lvm2-lvmetad.service lvm2-monitor.service lvm2-activate.service |
225 | 225 |
|
226 |
-%files devel |
|
226 |
+%files devel |
|
227 | 227 |
%defattr(-,root,root,-) |
228 | 228 |
%{_libdir}/liblvm2app.so |
229 | 229 |
%{_libdir}/liblvm2cmd.so |
... | ... |
@@ -248,7 +249,7 @@ cp %{SOURCE1} %{buildroot}/lib/systemd/system/lvm2-activate.service |
248 | 248 |
%{_libdir}/libdevmapper-event-lvm2thin.so |
249 | 249 |
%{_libdir}/device-mapper/libdevmapper-event-lvm2thin.so |
250 | 250 |
|
251 |
-%files python-libs |
|
251 |
+%files python-libs |
|
252 | 252 |
%{python_sitearch}/* |
253 | 253 |
|
254 | 254 |
%files -n device-mapper |
... | ... |
@@ -424,8 +425,10 @@ cp %{SOURCE1} %{buildroot}/lib/systemd/system/lvm2-activate.service |
424 | 424 |
/etc/lvm/profile/cache-smq.profile |
425 | 425 |
|
426 | 426 |
%changelog |
427 |
-* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.02.141-5 |
|
428 |
-- GA - Bump release of all rpms |
|
427 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 2.02.141-6 |
|
428 |
+- Change systemd dependency |
|
429 |
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 2.02.141-5 |
|
430 |
+- GA - Bump release of all rpms |
|
429 | 431 |
* Thu May 05 2016 Kumar Kaushik <kaushikk@vmware.com> 2.02.141-4 |
430 | 432 |
- Adding upgrade support in pre/post/un scripts. |
431 | 433 |
* Thu Jan 28 2016 Anish Swaminathan <anishs@vmware.com> 2.02.141-3 |
... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
Summary: A cloud-init implementation in C. |
2 | 2 |
Name: micro-config-drive |
3 | 3 |
Version: 25 |
4 |
-Release: 1%{?dist} |
|
4 |
+Release: 2%{?dist} |
|
5 | 5 |
Group: Development/Tools |
6 | 6 |
License: GPL-3.0 |
7 | 7 |
URL: https://github.com/clearlinux/micro-config-drive |
... | ... |
@@ -15,7 +15,7 @@ BuildRequires: json-glib-devel |
15 | 15 |
BuildRequires: curl |
16 | 16 |
BuildRequires: parted |
17 | 17 |
BuildRequires: libyaml-devel |
18 |
-BuildRequires: systemd |
|
18 |
+BuildRequires: systemd-devel |
|
19 | 19 |
Requires: json-glib |
20 | 20 |
Requires: glib |
21 | 21 |
Requires: libyaml |
... | ... |
@@ -58,5 +58,7 @@ rm -rf $RPM_BUILD_ROOT |
58 | 58 |
%doc /usr/share/man/man5/* |
59 | 59 |
|
60 | 60 |
%changelog |
61 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 25-2 |
|
62 |
+- Change systemd dependency |
|
61 | 63 |
* Wed Aug 3 2016 Divya Thaluru <dthaluru@vmware.com> 25-1 |
62 | 64 |
- Initial version |
... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
Summary: Git for operating system binaries |
2 | 2 |
Name: ostree |
3 | 3 |
Version: 2015.7 |
4 |
-Release: 7%{?dist} |
|
4 |
+Release: 8%{?dist} |
|
5 | 5 |
Source0: http://ftp.gnome.org/pub/GNOME/sources/ostree/%{version}/%{name}-%{version}.tar.gz |
6 | 6 |
%define sha1 ostree=baa502aa46363cd4828d257fb87f5e18a7ed000a |
7 | 7 |
Source1: 91-ostree.preset |
... | ... |
@@ -40,7 +40,7 @@ BuildRequires: libsoup-devel |
40 | 40 |
BuildRequires: mkinitcpio |
41 | 41 |
BuildRequires: dracut |
42 | 42 |
BuildRequires: dracut-tools |
43 |
-BuildRequires: systemd |
|
43 |
+BuildRequires: systemd-devel |
|
44 | 44 |
BuildRequires: libarchive |
45 | 45 |
BuildRequires: libarchive-devel |
46 | 46 |
|
... | ... |
@@ -129,6 +129,8 @@ rm -rf %{buildroot} |
129 | 129 |
%{_datadir}/gir-1.0/OSTree-1.0.gir |
130 | 130 |
|
131 | 131 |
%changelog |
132 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 2015.7-8 |
|
133 |
+- Change systemd dependency |
|
132 | 134 |
* Thu Nov 17 2016 Alexey Makhalov <amakhalov@vmware.com> 2015.7-7 |
133 | 135 |
- Use %setup instead of %autosetup |
134 | 136 |
* Fri Oct 07 2016 ChangLee <changlee@vmware.com> 2015.7-6 |
... | ... |
@@ -1,20 +1,20 @@ |
1 |
-Summary: RPC program number mapper |
|
2 |
-Name: rpcbind |
|
3 |
-Version: 0.2.3 |
|
4 |
-Release: 7%{?dist} |
|
5 |
-License: BSD |
|
6 |
-URL: http://nfsv4.bullopensource.org |
|
7 |
-Group: Applications/Daemons |
|
8 |
-Source0: http://downloads.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2 |
|
1 |
+Summary: RPC program number mapper |
|
2 |
+Name: rpcbind |
|
3 |
+Version: 0.2.3 |
|
4 |
+Release: 8%{?dist} |
|
5 |
+License: BSD |
|
6 |
+URL: http://nfsv4.bullopensource.org |
|
7 |
+Group: Applications/Daemons |
|
8 |
+Source0: http://downloads.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2 |
|
9 | 9 |
%define sha1 rpcbind=e79974a99d09b6d6fff9d86bf00225dc33723ce2 |
10 |
-Source1: rpcbind.service |
|
11 |
-Source2: rpcbind.socket |
|
12 |
-Source3: rpcbind.sysconfig |
|
13 |
-Patch0: http://www.linuxfromscratch.org/patches/blfs/svn/rpcbind-0.2.3-tirpc_fix-1.patch |
|
14 |
-Vendor: VMware, Inc. |
|
10 |
+Source1: rpcbind.service |
|
11 |
+Source2: rpcbind.socket |
|
12 |
+Source3: rpcbind.sysconfig |
|
13 |
+Patch0: http://www.linuxfromscratch.org/patches/blfs/svn/rpcbind-0.2.3-tirpc_fix-1.patch |
|
14 |
+Vendor: VMware, Inc. |
|
15 | 15 |
Distribution: Photon |
16 |
-BuildRequires: libtirpc-devel |
|
17 |
-BuildRequires: systemd |
|
16 |
+BuildRequires: libtirpc-devel |
|
17 |
+BuildRequires: systemd-devel |
|
18 | 18 |
Requires: libtirpc |
19 | 19 |
Requires: systemd |
20 | 20 |
%description |
... | ... |
@@ -54,18 +54,18 @@ make %{?_smp_mflags} check |
54 | 54 |
%pre |
55 | 55 |
rpcid=`getent passwd rpc | cut -d: -f 3` |
56 | 56 |
if [ -n "$rpcid" -a "$rpcid" != "31" ]; then |
57 |
- userdel rpc 2> /dev/null || : |
|
58 |
- groupdel rpc 2> /dev/null || : |
|
57 |
+ userdel rpc 2> /dev/null || : |
|
58 |
+ groupdel rpc 2> /dev/null || : |
|
59 | 59 |
fi |
60 | 60 |
if [ -z "$rpcid" -o "$rpcid" != "31" ]; then |
61 |
- groupadd -g 31 rpc > /dev/null 2>&1 |
|
62 |
- useradd -d /var/lib/rpcbind -g rpc -s /bin/false -u 31 rpc > /dev/null 2>&1 |
|
61 |
+ groupadd -g 31 rpc > /dev/null 2>&1 |
|
62 |
+ useradd -d /var/lib/rpcbind -g rpc -s /bin/false -u 31 rpc > /dev/null 2>&1 |
|
63 | 63 |
fi |
64 | 64 |
%preun |
65 | 65 |
%systemd_preun rpcbind.service rpcbind.socket |
66 | 66 |
if [ $1 -eq 0 ]; then |
67 |
- userdel rpc 2>/dev/null || : |
|
68 |
- groupdel rpc 2>/dev/null || : |
|
67 |
+ userdel rpc 2>/dev/null || : |
|
68 |
+ groupdel rpc 2>/dev/null || : |
|
69 | 69 |
fi |
70 | 70 |
|
71 | 71 |
%post |
... | ... |
@@ -82,17 +82,19 @@ fi |
82 | 82 |
%clean |
83 | 83 |
rm -rf %{buildroot}/* |
84 | 84 |
%changelog |
85 |
-* Wed Oct 05 2016 ChangLee <changlee@vmware.com> 0.2.3-7 |
|
86 |
-- Modified %check |
|
87 |
-* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 0.2.3-6 |
|
88 |
-- GA - Bump release of all rpms |
|
89 |
-* Wed May 04 2016 Anish Swaminathan <anishs@vmware.com> 0.2.3-5 |
|
90 |
-- Edit scriptlets. |
|
91 |
-* Fri Feb 05 2016 Anish Swaminathan <anishs@vmware.com> 0.2.3-4 |
|
92 |
-- Add pre install scripts in the rpm |
|
93 |
-* Wed Feb 03 2016 Anish Swaminathan <anishs@vmware.com> 0.2.3-3 |
|
94 |
-- Edit scripts in the rpm |
|
95 |
-* Thu Dec 10 2015 Xiaolin Li <xiaolinl@vmware.com> 0.2.3-2 |
|
96 |
-- Add systemd to Requires and BuildRequires. |
|
97 |
-* Tue Dec 8 2015 Divya Thaluru <dthaluru@vmware.com> 0.2.3-1 |
|
98 |
-- Initial build. First version |
|
85 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 0.2.3-8 |
|
86 |
+- Change systemd dependency |
|
87 |
+* Wed Oct 05 2016 ChangLee <changlee@vmware.com> 0.2.3-7 |
|
88 |
+- Modified %check |
|
89 |
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 0.2.3-6 |
|
90 |
+- GA - Bump release of all rpms |
|
91 |
+* Wed May 04 2016 Anish Swaminathan <anishs@vmware.com> 0.2.3-5 |
|
92 |
+- Edit scriptlets. |
|
93 |
+* Fri Feb 05 2016 Anish Swaminathan <anishs@vmware.com> 0.2.3-4 |
|
94 |
+- Add pre install scripts in the rpm |
|
95 |
+* Wed Feb 03 2016 Anish Swaminathan <anishs@vmware.com> 0.2.3-3 |
|
96 |
+- Edit scripts in the rpm |
|
97 |
+* Thu Dec 10 2015 Xiaolin Li <xiaolinl@vmware.com> 0.2.3-2 |
|
98 |
+- Add systemd to Requires and BuildRequires. |
|
99 |
+* Tue Dec 8 2015 Divya Thaluru <dthaluru@vmware.com> 0.2.3-1 |
|
100 |
+- Initial build. First version |
... | ... |
@@ -1,45 +1,46 @@ |
1 |
-Summary: Rocket-fast system for log processing |
|
2 |
-Name: rsyslog |
|
3 |
-Version: 8.15.0 |
|
4 |
-Release: 6%{?dist} |
|
5 |
-License: GPLv3+ and ASL 2.0 |
|
6 |
-URL: http://www.rsyslog.com/ |
|
7 |
-Source0: http://www.rsyslog.com/files/download/rsyslog/%{name}-%{version}.tar.gz |
|
1 |
+Summary: Rocket-fast system for log processing |
|
2 |
+Name: rsyslog |
|
3 |
+Version: 8.15.0 |
|
4 |
+Release: 7%{?dist} |
|
5 |
+License: GPLv3+ and ASL 2.0 |
|
6 |
+URL: http://www.rsyslog.com/ |
|
7 |
+Source0: http://www.rsyslog.com/files/download/rsyslog/%{name}-%{version}.tar.gz |
|
8 | 8 |
%define sha1 rsyslog=e1d5ff63c96bce9945dc65581c8e195950256d3c |
9 | 9 |
Source1: rsyslog.service |
10 | 10 |
Source2: 50-rsyslog-journald.conf |
11 |
-Group: System Environment/Base |
|
12 |
-Vendor: VMware, Inc. |
|
13 |
-Distribution: Photon |
|
14 |
-BuildRequires: systemd |
|
15 |
-BuildRequires: libestr-devel |
|
16 |
-BuildRequires: json-c-devel |
|
17 |
-BuildRequires: libgcrypt-devel |
|
18 |
-BuildRequires: liblogging-devel |
|
19 |
-BuildRequires: librelp-devel |
|
11 |
+Group: System Environment/Base |
|
12 |
+Vendor: VMware, Inc. |
|
13 |
+Distribution: Photon |
|
14 |
+BuildRequires: systemd-devel |
|
15 |
+BuildRequires: libestr-devel |
|
16 |
+BuildRequires: json-c-devel |
|
17 |
+BuildRequires: libgcrypt-devel |
|
18 |
+BuildRequires: liblogging-devel |
|
19 |
+BuildRequires: librelp-devel |
|
20 | 20 |
BuildRequires: autogen |
21 | 21 |
BuildRequires: gnutls-devel |
22 |
-Requires: gnutls |
|
23 |
-Requires: systemd |
|
24 |
-Requires: libestr |
|
25 |
-Requires: json-c |
|
26 |
-Requires: libgcrypt |
|
27 |
-Requires: liblogging |
|
28 |
-Requires: librelp |
|
22 |
+Requires: gnutls |
|
23 |
+Requires: systemd |
|
24 |
+Requires: libestr |
|
25 |
+Requires: json-c |
|
26 |
+Requires: libgcrypt |
|
27 |
+Requires: liblogging |
|
28 |
+Requires: librelp |
|
29 | 29 |
%description |
30 | 30 |
RSYSLOG is the rocket-fast system for log processing. |
31 | 31 |
It offers high-performance, great security features and a modular design. While it started as a regular syslogd, rsyslog has evolved into a kind of swiss army knife of logging, being able to accept inputs from a wide variety of sources, transform them, and output to the results to diverse destinations. |
32 | 32 |
%prep |
33 | 33 |
%setup -q |
34 | 34 |
%build |
35 |
+sed -i 's/libsystemd-journal/libsystemd/' configure |
|
35 | 36 |
./configure \ |
36 |
- --prefix=%{_prefix} \ |
|
37 |
- --enable-relp \ |
|
38 |
- --enable-gnutls\ |
|
39 |
- --enable-imfile \ |
|
40 |
- --enable-imjournal \ |
|
41 |
- --enable-impstats \ |
|
42 |
- --enable-imptcp |
|
37 |
+ --prefix=%{_prefix} \ |
|
38 |
+ --enable-relp \ |
|
39 |
+ --enable-gnutls\ |
|
40 |
+ --enable-imfile \ |
|
41 |
+ --enable-imjournal \ |
|
42 |
+ --enable-impstats \ |
|
43 |
+ --enable-imptcp |
|
43 | 44 |
|
44 | 45 |
make %{?_smp_mflags} |
45 | 46 |
%install |
... | ... |
@@ -74,18 +75,20 @@ make %{?_smp_mflags} check |
74 | 74 |
%{_libdir}/systemd/system/rsyslog.service |
75 | 75 |
%{_sysconfdir}/systemd/journald.conf.d/* |
76 | 76 |
%changelog |
77 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 8.15.0-7 |
|
78 |
+- Change systemd dependency |
|
77 | 79 |
* Wed Oct 05 2016 ChangLee <changlee@vmware.com> 8.15.0-6 |
78 | 80 |
- Modified %check |
79 | 81 |
* Thu May 26 2016 Divya Thaluru <dthaluru@vmware.com> 8.15.0-5 |
80 | 82 |
- Fixed logic to restart the active services after upgrade |
81 |
-* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 8.15.0-4 |
|
82 |
-- GA - Bump release of all rpms |
|
83 |
-* Wed May 4 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 8.15.0-3 |
|
84 |
-- Use systemd macros for post, preun and postun to respect upgrades |
|
85 |
-* Wed Feb 17 2016 Anish Swaminathan <anishs@vmware.com> 8.15.0-2 |
|
86 |
-- Add journald conf and new service file. |
|
87 |
-* Mon Jan 11 2016 Xiaolin Li <xiaolinl@vmware.com> 8.15.0-1 |
|
88 |
-- Update rsyslog to 8.15.0 |
|
89 |
-* Wed Jun 17 2015 Divya Thaluru <dthaluru@vmware.com> 8.10.0-1 |
|
90 |
-- Initial build. First version |
|
83 |
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 8.15.0-4 |
|
84 |
+- GA - Bump release of all rpms |
|
85 |
+* Wed May 4 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 8.15.0-3 |
|
86 |
+- Use systemd macros for post, preun and postun to respect upgrades |
|
87 |
+* Wed Feb 17 2016 Anish Swaminathan <anishs@vmware.com> 8.15.0-2 |
|
88 |
+- Add journald conf and new service file. |
|
89 |
+* Mon Jan 11 2016 Xiaolin Li <xiaolinl@vmware.com> 8.15.0-1 |
|
90 |
+- Update rsyslog to 8.15.0 |
|
91 |
+* Wed Jun 17 2015 Divya Thaluru <dthaluru@vmware.com> 8.10.0-1 |
|
92 |
+- Initial build. First version |
|
91 | 93 |
|
... | ... |
@@ -1,10 +1,10 @@ |
1 |
-diff -ruN systemd-228/src/udev/udev-builtin-net_id.c systemd-228-new/src/udev/udev-builtin-net_id.c |
|
2 |
-+++ systemd-228-new/src/udev/udev-builtin-net_id.c 2015-12-11 18:22:07.910440956 -0800 |
|
3 |
-@@ -149,6 +149,21 @@ |
|
1 |
+diff -rup systemd-232/src/udev/udev-builtin-net_id.c systemd-232-new/src/udev/udev-builtin-net_id.c |
|
2 |
+--- systemd-232/src/udev/udev-builtin-net_id.c 2016-11-03 10:16:42.000000000 -0700 |
|
3 |
+@@ -153,6 +153,20 @@ static int dev_pci_onboard(struct udev_d |
|
4 |
+ idx = strtoul(attr, NULL, 0); |
|
4 | 5 |
if (idx <= 0) |
5 | 6 |
return -EINVAL; |
6 |
- |
|
7 | 7 |
+ if (idx >> 24) { |
8 | 8 |
+ unsigned domain, bus, slot, func; |
9 | 9 |
+ /* |
... | ... |
@@ -19,8 +19,6 @@ diff -ruN systemd-228/src/udev/udev-builtin-net_id.c systemd-228-new/src/udev/ud |
19 | 19 |
+ if ((idx & 0xffff) == ((bus << 8) | (slot << 3) | func)) |
20 | 20 |
+ idx >>= 24; |
21 | 21 |
+ } |
22 |
-+ |
|
23 |
- /* kernel provided port index for multiple ports on a single PCI function */ |
|
24 |
- attr = udev_device_get_sysattr_value(dev, "dev_port"); |
|
25 |
- if (attr) |
|
26 |
- |
|
22 |
+ |
|
23 |
+ /* Some BIOSes report rubbish indexes that are excessively high (2^24-1 is an index VMware likes to report for |
|
24 |
+ * example). Let's define a cut-off where we don't consider the index reliable anymore. We pick some arbitrary |
27 | 25 |
deleted file mode 100644 |
... | ... |
@@ -1,15 +0,0 @@ |
1 |
-diff --git a/src/core/manager.c b/src/core/manager.c |
|
2 |
-index fa8deb9..43e231c 100644 |
|
3 |
-+++ b/src/core/manager.c |
|
4 |
-@@ -1721,6 +1721,10 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t |
|
5 |
- |
|
6 |
- return -errno; |
|
7 |
- } |
|
8 |
-+ if (n == 0) { |
|
9 |
-+ log_debug("Got zero-length notification message. Ignoring."); |
|
10 |
-+ return 0; |
|
11 |
-+ } |
|
12 |
- |
|
13 |
- CMSG_FOREACH(cmsg, &msghdr) { |
|
14 |
- if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { |
15 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,197 +0,0 @@ |
1 |
-From 0d43d2fcb7ac5264c739dc2f67f93ed0985a418a Mon Sep 17 00:00:00 2001 |
|
2 |
-From: Tom Gundersen <teg@jklm.no> |
|
3 |
-Date: Tue, 24 Nov 2015 18:25:52 +0100 |
|
4 |
-Subject: [PATCH] libsystemd-network: clean up recv functions |
|
5 |
- |
|
6 |
- src/libsystemd-network/sd-dhcp-client.c | 43 ++++++++++++++++---------------- |
|
7 |
- src/libsystemd-network/sd-dhcp-server.c | 13 ++++++---- |
|
8 |
- src/libsystemd-network/sd-dhcp6-client.c | 22 ++++++++++------ |
|
9 |
- src/libsystemd-network/sd-ndisc.c | 12 ++++++--- |
|
10 |
- 4 files changed, 54 insertions(+), 36 deletions(-) |
|
11 |
- |
|
12 |
-diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c |
|
13 |
-index 5ec0e66..66b8f10 100644 |
|
14 |
-+++ b/src/libsystemd-network/sd-dhcp-client.c |
|
15 |
-@@ -1513,9 +1513,8 @@ static int client_receive_message_udp(sd_event_source *s, int fd, |
|
16 |
- |
|
17 |
- r = ioctl(fd, FIONREAD, &buflen); |
|
18 |
- if (r < 0) |
|
19 |
-- return r; |
|
20 |
-- |
|
21 |
-- if (buflen < 0) |
|
22 |
-+ return -errno; |
|
23 |
-+ else if (buflen < 0) |
|
24 |
- /* this can't be right */ |
|
25 |
- return -EIO; |
|
26 |
- |
|
27 |
-@@ -1525,26 +1524,28 @@ static int client_receive_message_udp(sd_event_source *s, int fd, |
|
28 |
- |
|
29 |
- len = read(fd, message, buflen); |
|
30 |
- if (len < 0) { |
|
31 |
-- log_dhcp_client(client, "could not receive message from UDP " |
|
32 |
-- "socket: %m"); |
|
33 |
-- return 0; |
|
34 |
-+ if (errno == EAGAIN || errno == EINTR) |
|
35 |
-+ return 0; |
|
36 |
-+ |
|
37 |
-+ log_dhcp_client(client, "Could not receive message from UDP socket: %m"); |
|
38 |
-+ return -errno; |
|
39 |
- } else if ((size_t)len < sizeof(DHCPMessage)) { |
|
40 |
-- log_dhcp_client(client, "too small to be a DHCP message: ignoring"); |
|
41 |
-+ log_dhcp_client(client, "Too small to be a DHCP message: ignoring"); |
|
42 |
- return 0; |
|
43 |
- } |
|
44 |
- |
|
45 |
- if (be32toh(message->magic) != DHCP_MAGIC_COOKIE) { |
|
46 |
-- log_dhcp_client(client, "not a DHCP message: ignoring"); |
|
47 |
-+ log_dhcp_client(client, "Not a DHCP message: ignoring"); |
|
48 |
- return 0; |
|
49 |
- } |
|
50 |
- |
|
51 |
- if (message->op != BOOTREPLY) { |
|
52 |
-- log_dhcp_client(client, "not a BOOTREPLY message: ignoring"); |
|
53 |
-+ log_dhcp_client(client, "Not a BOOTREPLY message: ignoring"); |
|
54 |
- return 0; |
|
55 |
- } |
|
56 |
- |
|
57 |
- if (message->htype != client->arp_type) { |
|
58 |
-- log_dhcp_client(client, "packet type does not match client type"); |
|
59 |
-+ log_dhcp_client(client, "Packet type does not match client type"); |
|
60 |
- return 0; |
|
61 |
- } |
|
62 |
- |
|
63 |
-@@ -1558,13 +1559,12 @@ static int client_receive_message_udp(sd_event_source *s, int fd, |
|
64 |
- } |
|
65 |
- |
|
66 |
- if (message->hlen != expected_hlen) { |
|
67 |
-- log_dhcp_client(client, "unexpected packet hlen %d", message->hlen); |
|
68 |
-+ log_dhcp_client(client, "Unexpected packet hlen %d", message->hlen); |
|
69 |
- return 0; |
|
70 |
- } |
|
71 |
- |
|
72 |
- if (memcmp(&message->chaddr[0], expected_chaddr, ETH_ALEN)) { |
|
73 |
-- log_dhcp_client(client, "received chaddr does not match " |
|
74 |
-- "expected: ignoring"); |
|
75 |
-+ log_dhcp_client(client, "Received chaddr does not match expected: ignoring"); |
|
76 |
- return 0; |
|
77 |
- } |
|
78 |
- |
|
79 |
-@@ -1572,8 +1572,7 @@ static int client_receive_message_udp(sd_event_source *s, int fd, |
|
80 |
- be32toh(message->xid) != client->xid) { |
|
81 |
- /* in BOUND state, we may receive FORCERENEW with xid set by server, |
|
82 |
- so ignore the xid in this case */ |
|
83 |
-- log_dhcp_client(client, "received xid (%u) does not match " |
|
84 |
-- "expected (%u): ignoring", |
|
85 |
-+ log_dhcp_client(client, "Received xid (%u) does not match expected (%u): ignoring", |
|
86 |
- be32toh(message->xid), client->xid); |
|
87 |
- return 0; |
|
88 |
- } |
|
89 |
-@@ -1602,9 +1601,8 @@ static int client_receive_message_raw(sd_event_source *s, int fd, |
|
90 |
- |
|
91 |
- r = ioctl(fd, FIONREAD, &buflen); |
|
92 |
- if (r < 0) |
|
93 |
-- return r; |
|
94 |
-- |
|
95 |
-- if (buflen < 0) |
|
96 |
-+ return -errno; |
|
97 |
-+ else if (buflen < 0) |
|
98 |
- /* this can't be right */ |
|
99 |
- return -EIO; |
|
100 |
- |
|
101 |
-@@ -1617,9 +1615,12 @@ static int client_receive_message_raw(sd_event_source *s, int fd, |
|
102 |
- |
|
103 |
- len = recvmsg(fd, &msg, 0); |
|
104 |
- if (len < 0) { |
|
105 |
-- log_dhcp_client(client, "could not receive message from raw " |
|
106 |
-- "socket: %m"); |
|
107 |
-- return 0; |
|
108 |
-+ if (errno == EAGAIN || errno == EINTR) |
|
109 |
-+ return 0; |
|
110 |
-+ |
|
111 |
-+ log_dhcp_client(client, "Could not receive message from raw socket: %m"); |
|
112 |
-+ |
|
113 |
-+ return -errno; |
|
114 |
- } else if ((size_t)len < sizeof(DHCPPacket)) |
|
115 |
- return 0; |
|
116 |
- |
|
117 |
-diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c |
|
118 |
-index 277c88e..3e2ecda 100644 |
|
119 |
-+++ b/src/libsystemd-network/sd-dhcp-server.c |
|
120 |
-@@ -963,10 +963,10 @@ static int server_receive_message(sd_event_source *s, int fd, |
|
121 |
- |
|
122 |
- if (ioctl(fd, FIONREAD, &buflen) < 0) |
|
123 |
- return -errno; |
|
124 |
-- if (buflen < 0) |
|
125 |
-+ else if (buflen < 0) |
|
126 |
- return -EIO; |
|
127 |
- |
|
128 |
-- message = malloc0(buflen); |
|
129 |
-+ message = malloc(buflen); |
|
130 |
- if (!message) |
|
131 |
- return -ENOMEM; |
|
132 |
- |
|
133 |
-@@ -974,9 +974,12 @@ static int server_receive_message(sd_event_source *s, int fd, |
|
134 |
- iov.iov_len = buflen; |
|
135 |
- |
|
136 |
- len = recvmsg(fd, &msg, 0); |
|
137 |
-- if (len < buflen) |
|
138 |
-- return 0; |
|
139 |
-- else if ((size_t)len < sizeof(DHCPMessage)) |
|
140 |
-+ if (len < 0) { |
|
141 |
-+ if (errno == EAGAIN || errno == EINTR) |
|
142 |
-+ return 0; |
|
143 |
-+ |
|
144 |
-+ return -errno; |
|
145 |
-+ } else if ((size_t)len < sizeof(DHCPMessage)) |
|
146 |
- return 0; |
|
147 |
- |
|
148 |
- CMSG_FOREACH(cmsg, &msg) { |
|
149 |
-diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c |
|
150 |
-index 801331d..36d909a 100644 |
|
151 |
-+++ b/src/libsystemd-network/sd-dhcp6-client.c |
|
152 |
-@@ -895,7 +895,7 @@ static int client_receive_advertise(sd_dhcp6_client *client, DHCP6Message *adver |
|
153 |
- static int client_receive_message(sd_event_source *s, int fd, uint32_t revents, void *userdata) { |
|
154 |
- sd_dhcp6_client *client = userdata; |
|
155 |
- DHCP6_CLIENT_DONT_DESTROY(client); |
|
156 |
-- _cleanup_free_ DHCP6Message *message; |
|
157 |
-+ _cleanup_free_ DHCP6Message *message = NULL; |
|
158 |
- int r, buflen, len; |
|
159 |
- |
|
160 |
- assert(s); |
|
161 |
-@@ -903,18 +903,26 @@ static int client_receive_message(sd_event_source *s, int fd, uint32_t revents, |
|
162 |
- assert(client->event); |
|
163 |
- |
|
164 |
- r = ioctl(fd, FIONREAD, &buflen); |
|
165 |
-- if (r < 0 || buflen <= 0) |
|
166 |
-- buflen = DHCP6_MIN_OPTIONS_SIZE; |
|
167 |
-+ if (r < 0) |
|
168 |
-+ return -errno; |
|
169 |
-+ else if (buflen < 0) |
|
170 |
-+ /* This really should not happen */ |
|
171 |
-+ return -EIO; |
|
172 |
- |
|
173 |
-- message = malloc0(buflen); |
|
174 |
-+ message = malloc(buflen); |
|
175 |
- if (!message) |
|
176 |
- return -ENOMEM; |
|
177 |
- |
|
178 |
- len = read(fd, message, buflen); |
|
179 |
-- if ((size_t)len < sizeof(DHCP6Message)) { |
|
180 |
-- log_dhcp6_client(client, "could not receive message from UDP socket: %m"); |
|
181 |
-+ if (len < 0) { |
|
182 |
-+ if (errno == EAGAIN || errno == EINTR) |
|
183 |
-+ return 0; |
|
184 |
-+ |
|
185 |
-+ log_dhcp6_client(client, "Could not receive message from UDP socket: %m"); |
|
186 |
-+ |
|
187 |
-+ return -errno; |
|
188 |
-+ } else if ((size_t)len < sizeof(DHCP6Message)) |
|
189 |
- return 0; |
|
190 |
-- } |
|
191 |
- |
|
192 |
- switch(message->type) { |
|
193 |
- case DHCP6_SOLICIT: |
194 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,23 +0,0 @@ |
1 |
-diff -uNr systemd-228/src/resolve/resolved-manager.c systemd-228-new/src/resolve/resolved-manager.c |
|
2 |
-+++ systemd-228-new/src/resolve/resolved-manager.c 2016-06-17 14:13:29.401993491 +0000 |
|
3 |
-@@ -463,6 +463,7 @@ |
|
4 |
- int manager_new(Manager **ret) { |
|
5 |
- _cleanup_(manager_freep) Manager *m = NULL; |
|
6 |
- int r; |
|
7 |
-+ char *default_dns_servers; |
|
8 |
- |
|
9 |
- assert(ret); |
|
10 |
- |
|
11 |
-@@ -477,7 +478,10 @@ |
|
12 |
- m->llmnr_support = SUPPORT_YES; |
|
13 |
- m->read_resolv_conf = true; |
|
14 |
- |
|
15 |
-- r = manager_parse_dns_server(m, DNS_SERVER_FALLBACK, DNS_SERVERS); |
|
16 |
-+ default_dns_servers = secure_getenv("DEFAULT_DNS_SERVERS"); |
|
17 |
-+ if (default_dns_servers == NULL) |
|
18 |
-+ default_dns_servers = DNS_SERVERS; |
|
19 |
-+ r = manager_parse_dns_server(m, DNS_SERVER_FALLBACK, default_dns_servers); |
|
20 |
- if (r < 0) |
|
21 |
- return r; |
|
22 |
- |
23 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,186 +0,0 @@ |
1 |
-diff -uNr systemd-228/src/network/networkd-conf.c systemd-228-duid/src/network/networkd-conf.c |
|
2 |
-+++ systemd-228-duid/src/network/networkd-conf.c 2016-06-23 13:46:08.990634508 +0000 |
|
3 |
-@@ -21,9 +21,11 @@ |
|
4 |
- |
|
5 |
- #include <ctype.h> |
|
6 |
- |
|
7 |
-+#include "alloc-util.h" |
|
8 |
- #include "conf-parser.h" |
|
9 |
- #include "def.h" |
|
10 |
- #include "dhcp-identifier.h" |
|
11 |
-+#include "hexdecoct.h" |
|
12 |
- #include "networkd-conf.h" |
|
13 |
- #include "string-table.h" |
|
14 |
- |
|
15 |
-@@ -32,7 +34,7 @@ |
|
16 |
- |
|
17 |
- return config_parse_many(PKGSYSCONFDIR "/networkd.conf", |
|
18 |
- CONF_PATHS_NULSTR("systemd/networkd.conf.d"), |
|
19 |
-- "DUID\0", |
|
20 |
-+ "DHCP\0", |
|
21 |
- config_item_perf_lookup, networkd_gperf_lookup, |
|
22 |
- false, m); |
|
23 |
- } |
|
24 |
-@@ -58,17 +60,13 @@ |
|
25 |
- const char *rvalue, |
|
26 |
- void *data, |
|
27 |
- void *userdata) { |
|
28 |
-- int r; |
|
29 |
-- long byte; |
|
30 |
-- char *cbyte, *pnext; |
|
31 |
-- const char *pduid = rvalue; |
|
32 |
-- size_t count = 0, duid_index = 0; |
|
33 |
- Manager *m; |
|
34 |
- Network *n; |
|
35 |
- DUIDType *duid_type; |
|
36 |
- uint16_t *dhcp_duid_type; |
|
37 |
- size_t *dhcp_duid_len; |
|
38 |
- uint8_t *dhcp_duid; |
|
39 |
-+ size_t count = 0; |
|
40 |
- |
|
41 |
- assert(filename); |
|
42 |
- assert(lvalue); |
|
43 |
-@@ -90,66 +88,50 @@ |
|
44 |
- dhcp_duid = n->dhcp_duid; |
|
45 |
- } |
|
46 |
- |
|
47 |
-- if (*duid_type == _DUID_TYPE_INVALID) |
|
48 |
-- *duid_type = DUID_TYPE_RAW; |
|
49 |
-- |
|
50 |
-- switch (*duid_type) { |
|
51 |
-- case DUID_TYPE_LLT: |
|
52 |
-- /* RawData contains DUID-LLT link-layer address (offset 6) */ |
|
53 |
-- duid_index = 6; |
|
54 |
-- break; |
|
55 |
-- case DUID_TYPE_EN: |
|
56 |
-- /* RawData contains DUID-EN identifier (offset 4) */ |
|
57 |
-- duid_index = 4; |
|
58 |
-- break; |
|
59 |
-- case DUID_TYPE_LL: |
|
60 |
-- /* RawData contains DUID-LL link-layer address (offset 2) */ |
|
61 |
-- duid_index = 2; |
|
62 |
-- break; |
|
63 |
-- case DUID_TYPE_UUID: |
|
64 |
-- /* RawData specifies UUID (offset 0) - fall thru */ |
|
65 |
-- case DUID_TYPE_RAW: |
|
66 |
-- /* First two bytes of RawData is DUID Type - fall thru */ |
|
67 |
-- default: |
|
68 |
-- break; |
|
69 |
-+ if ((*duid_type < DUID_TYPE_LLT) || (*duid_type > DUID_TYPE_UUID)) { |
|
70 |
-+ log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid DUID type, ignoring assignment: %s.", rvalue); |
|
71 |
-+ return 0; |
|
72 |
- } |
|
73 |
-+ *dhcp_duid_type = (uint16_t)(*duid_type); |
|
74 |
- |
|
75 |
-- if (*duid_type != DUID_TYPE_RAW) |
|
76 |
-- *dhcp_duid_type = (uint16_t)(*duid_type); |
|
77 |
-+ /* RawData contains DUID in format "NN:NN:NN..." */ |
|
78 |
-+ for (;;) { |
|
79 |
-+ int n1, n2, len, r; |
|
80 |
-+ uint32_t byte; |
|
81 |
-+ _cleanup_free_ char *cbyte = NULL; |
|
82 |
- |
|
83 |
-- /* RawData contains DUID in format " NN:NN:NN... " */ |
|
84 |
-- while (true) { |
|
85 |
-- r = extract_first_word(&pduid, &cbyte, ":", 0); |
|
86 |
-+ r = extract_first_word(&rvalue, &cbyte, ":", 0); |
|
87 |
- if (r < 0) { |
|
88 |
-- log_error("Failed to read DUID."); |
|
89 |
-- return -EINVAL; |
|
90 |
-+ log_syntax(unit, LOG_ERR, filename, line, r, "Failed to read DUID, ignoring assignment: %s.", rvalue); |
|
91 |
-+ return 0; |
|
92 |
- } |
|
93 |
- if (r == 0) |
|
94 |
- break; |
|
95 |
-- if (duid_index >= MAX_DUID_LEN) { |
|
96 |
-- log_error("DUID length exceeds maximum length."); |
|
97 |
-- return -EINVAL; |
|
98 |
-+ if (count >= MAX_DUID_LEN) { |
|
99 |
-+ log_syntax(unit, LOG_ERR, filename, line, 0, "Max DUID length exceeded, ignoring assignment: %s.", rvalue); |
|
100 |
-+ return 0; |
|
101 |
- } |
|
102 |
- |
|
103 |
-- errno = 0; |
|
104 |
-- byte = strtol(cbyte, &pnext, 16); |
|
105 |
-- if ((errno == ERANGE && (byte == LONG_MAX || byte == LONG_MIN)) |
|
106 |
-- || (errno != 0 && byte == 0) || (cbyte == pnext)) { |
|
107 |
-- log_error("Invalid DUID byte: %s.", cbyte); |
|
108 |
-- return -EINVAL; |
|
109 |
-+ len = strlen(cbyte); |
|
110 |
-+ if (len != 1 && len != 2) { |
|
111 |
-+ log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid length - DUID byte: %s, ignoring assignment: %s.", cbyte, rvalue); |
|
112 |
-+ return 0; |
|
113 |
- } |
|
114 |
-- |
|
115 |
-- /* If DUID_TYPE_RAW, first two bytes hold DHCP DUID type code */ |
|
116 |
-- if ((*duid_type == DUID_TYPE_RAW) && (count < 2)) { |
|
117 |
-- *dhcp_duid_type |= (byte << (8 * (1 - count))); |
|
118 |
-- count++; |
|
119 |
-- continue; |
|
120 |
-+ n1 = unhexchar(cbyte[0]); |
|
121 |
-+ if (len == 2) |
|
122 |
-+ n2 = unhexchar(cbyte[1]); |
|
123 |
-+ else |
|
124 |
-+ n2 = 0; |
|
125 |
-+ |
|
126 |
-+ if (n1 < 0 || n2 < 0) { |
|
127 |
-+ log_syntax(unit, LOG_ERR, filename, line, 0, "Invalid DUID byte: %s. Ignoring assignment: %s.", cbyte, rvalue); |
|
128 |
-+ return 0; |
|
129 |
- } |
|
130 |
- |
|
131 |
-- dhcp_duid[duid_index++] = byte; |
|
132 |
-+ byte = ((uint8_t) n1 << (4 * (len-1))) | (uint8_t) n2; |
|
133 |
-+ dhcp_duid[count++] = byte; |
|
134 |
- } |
|
135 |
- |
|
136 |
-- *dhcp_duid_len = duid_index; |
|
137 |
-- |
|
138 |
-+ *dhcp_duid_len = count; |
|
139 |
- return 0; |
|
140 |
- } |
|
141 |
-diff -uNr systemd-228/src/network/networkd-gperf.gperf systemd-228-duid/src/network/networkd-gperf.gperf |
|
142 |
-+++ systemd-228-duid/src/network/networkd-gperf.gperf 2016-06-21 21:17:18.179685521 +0000 |
|
143 |
-@@ -14,5 +14,5 @@ |
|
144 |
- %struct-type |
|
145 |
- %includes |
|
146 |
- %% |
|
147 |
--DUID.Type, config_parse_duid_type, 0, offsetof(Manager, duid_type) |
|
148 |
--DUID.RawData, config_parse_duid_rawdata, DUID_CONFIG_SOURCE_GLOBAL, offsetof(Manager, dhcp_duid) |
|
149 |
-+DHCP.DUIDType, config_parse_duid_type, 0, offsetof(Manager, duid_type) |
|
150 |
-+DHCP.DUIDRawData, config_parse_duid_rawdata, DUID_CONFIG_SOURCE_GLOBAL, offsetof(Manager, dhcp_duid) |
|
151 |
-diff -uNr systemd-228/src/network/networkd-network-gperf.gperf systemd-228-duid/src/network/networkd-network-gperf.gperf |
|
152 |
-+++ systemd-228-duid/src/network/networkd-network-gperf.gperf 2016-06-21 21:16:14.571682488 +0000 |
|
153 |
-@@ -27,9 +27,6 @@ |
|
154 |
- Match.Architecture, config_parse_net_condition, CONDITION_ARCHITECTURE, offsetof(Network, match_arch) |
|
155 |
- Link.MACAddress, config_parse_hwaddr, 0, offsetof(Network, mac) |
|
156 |
- Link.MTUBytes, config_parse_iec_size, 0, offsetof(Network, mtu) |
|
157 |
--Link.IAID, config_parse_iaid, 0, offsetof(Network, iaid) |
|
158 |
--DUID.Type, config_parse_duid_type, 0, offsetof(Network, duid_type) |
|
159 |
--DUID.RawData, config_parse_duid_rawdata, DUID_CONFIG_SOURCE_NETWORK, offsetof(Network, dhcp_duid) |
|
160 |
- Network.Description, config_parse_string, 0, offsetof(Network, description) |
|
161 |
- Network.Bridge, config_parse_netdev, 0, offsetof(Network, bridge) |
|
162 |
- Network.Bond, config_parse_netdev, 0, offsetof(Network, bond) |
|
163 |
-@@ -82,6 +79,9 @@ |
|
164 |
- DHCP.VendorClassIdentifier, config_parse_string, 0, offsetof(Network, dhcp_vendor_class_identifier) |
|
165 |
- DHCP.RouteMetric, config_parse_unsigned, 0, offsetof(Network, dhcp_route_metric) |
|
166 |
- DHCP.UseTimezone, config_parse_bool, 0, offsetof(Network, dhcp_timezone) |
|
167 |
-+DHCP.DUIDType, config_parse_duid_type, 0, offsetof(Network, duid_type) |
|
168 |
-+DHCP.DUIDRawData, config_parse_duid_rawdata, DUID_CONFIG_SOURCE_NETWORK, offsetof(Network, dhcp_duid) |
|
169 |
-+DHCP.IAID, config_parse_iaid, 0, offsetof(Network, iaid) |
|
170 |
- DHCPServer.MaxLeaseTimeSec, config_parse_sec, 0, offsetof(Network, dhcp_server_max_lease_time_usec) |
|
171 |
- DHCPServer.DefaultLeaseTimeSec, config_parse_sec, 0, offsetof(Network, dhcp_server_default_lease_time_usec) |
|
172 |
- DHCPServer.EmitDNS, config_parse_bool, 0, offsetof(Network, dhcp_server_emit_dns) |
|
173 |
-diff -uNr systemd-228/src/network/networkd-network.c systemd-228-duid/src/network/networkd-network.c |
|
174 |
-+++ systemd-228-duid/src/network/networkd-network.c 2016-06-23 13:46:37.878635885 +0000 |
|
175 |
-@@ -133,7 +133,6 @@ |
|
176 |
- r = config_parse(NULL, filename, file, |
|
177 |
- "Match\0" |
|
178 |
- "Link\0" |
|
179 |
-- "DUID\0" |
|
180 |
- "Network\0" |
|
181 |
- "Address\0" |
|
182 |
- "Route\0" |
183 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,17 +0,0 @@ |
1 |
-diff -uNr systemd-228/src/resolve/resolved-dns-transaction.c systemd-228-dnsfix/src/resolve/resolved-dns-transaction.c |
|
2 |
-+++ systemd-228-dnsfix/src/resolve/resolved-dns-transaction.c 2016-08-17 03:04:05.393604993 +0000 |
|
3 |
-@@ -342,10 +342,12 @@ |
|
4 |
- |
|
5 |
- assert(t); |
|
6 |
- assert(p); |
|
7 |
-- assert(t->state == DNS_TRANSACTION_PENDING); |
|
8 |
- assert(t->scope); |
|
9 |
- assert(t->scope->manager); |
|
10 |
- |
|
11 |
-+ if (t->state != DNS_TRANSACTION_PENDING) |
|
12 |
-+ return; |
|
13 |
-+ |
|
14 |
- /* Note that this call might invalidate the query. Callers |
|
15 |
- * should hence not attempt to access the query or transaction |
|
16 |
- * after calling this function. */ |
17 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,23 +0,0 @@ |
1 |
-diff -uNr systemd-228/src/resolve/resolved-link.c systemd-228-domains/src/resolve/resolved-link.c |
|
2 |
-+++ systemd-228-domains/src/resolve/resolved-link.c 2016-07-14 08:54:42.500318017 +0000 |
|
3 |
-@@ -91,14 +91,11 @@ |
|
4 |
- |
|
5 |
- assert(l); |
|
6 |
- |
|
7 |
-- if (l->dns_servers) { |
|
8 |
-- if (!l->unicast_scope) { |
|
9 |
-- r = dns_scope_new(l->manager, &l->unicast_scope, l, DNS_PROTOCOL_DNS, AF_UNSPEC); |
|
10 |
-- if (r < 0) |
|
11 |
-- log_warning_errno(r, "Failed to allocate DNS scope: %m"); |
|
12 |
-- } |
|
13 |
-- } else |
|
14 |
-- l->unicast_scope = dns_scope_free(l->unicast_scope); |
|
15 |
-+ if (!l->unicast_scope) { |
|
16 |
-+ r = dns_scope_new(l->manager, &l->unicast_scope, l, DNS_PROTOCOL_DNS, AF_UNSPEC); |
|
17 |
-+ if (r < 0) |
|
18 |
-+ log_warning_errno(r, "Failed to allocate DNS scope: %m"); |
|
19 |
-+ } |
|
20 |
- |
|
21 |
- if (link_relevant(l, AF_INET) && |
|
22 |
- l->llmnr_support != SUPPORT_NO && |
23 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,771 +0,0 @@ |
1 |
-diff -uNr systemd-228/Makefile.am systemd-228-duid/Makefile.am |
|
2 |
-+++ systemd-228-duid/Makefile.am 2016-03-30 20:02:08.116710472 +0000 |
|
3 |
-@@ -5288,6 +5288,8 @@ |
|
4 |
- libnetworkd_core_la_SOURCES = \ |
|
5 |
- src/libsystemd-network/network-internal.h \ |
|
6 |
- src/network/networkd.h \ |
|
7 |
-+ src/network/networkd-conf.h \ |
|
8 |
-+ src/network/networkd-conf.c \ |
|
9 |
- src/network/networkd-link.h \ |
|
10 |
- src/network/networkd-link.c \ |
|
11 |
- src/network/networkd-netdev.h \ |
|
12 |
-@@ -5334,6 +5336,7 @@ |
|
13 |
- src/network/networkd-util.c |
|
14 |
- |
|
15 |
- nodist_libnetworkd_core_la_SOURCES = \ |
|
16 |
-+ src/network/networkd-gperf.c \ |
|
17 |
- src/network/networkd-network-gperf.c \ |
|
18 |
- src/network/networkd-netdev-gperf.c |
|
19 |
- |
|
20 |
-@@ -5425,6 +5428,7 @@ |
|
21 |
- org.freedesktop.network1.busname |
|
22 |
- |
|
23 |
- gperf_gperf_sources += \ |
|
24 |
-+ src/network/networkd-gperf.gperf \ |
|
25 |
- src/network/networkd-network-gperf.gperf \ |
|
26 |
- src/network/networkd-netdev-gperf.gperf |
|
27 |
- endif |
|
28 |
-diff -uNr systemd-228/src/libsystemd-network/dhcp-identifier.c systemd-228-duid/src/libsystemd-network/dhcp-identifier.c |
|
29 |
-+++ systemd-228-duid/src/libsystemd-network/dhcp-identifier.c 2016-03-30 19:59:27.311768320 +0000 |
|
30 |
-@@ -45,7 +45,7 @@ |
|
31 |
- if (r < 0) |
|
32 |
- return r; |
|
33 |
- |
|
34 |
-- unaligned_write_be16(&duid->type, DHCP6_DUID_EN); |
|
35 |
-+ unaligned_write_be16(&duid->type, DUID_TYPE_EN); |
|
36 |
- unaligned_write_be32(&duid->en.pen, SYSTEMD_PEN); |
|
37 |
- |
|
38 |
- *len = sizeof(duid->type) + sizeof(duid->en); |
|
39 |
-diff -uNr systemd-228/src/libsystemd-network/dhcp-identifier.h systemd-228-duid/src/libsystemd-network/dhcp-identifier.h |
|
40 |
-+++ systemd-228-duid/src/libsystemd-network/dhcp-identifier.h 2016-03-30 19:59:27.312768295 +0000 |
|
41 |
-@@ -27,13 +27,23 @@ |
|
42 |
- #include "sparse-endian.h" |
|
43 |
- #include "unaligned.h" |
|
44 |
- |
|
45 |
-+typedef enum DUIDType { |
|
46 |
-+ DUID_TYPE_RAW = 0, |
|
47 |
-+ DUID_TYPE_LLT = 1, |
|
48 |
-+ DUID_TYPE_EN = 2, |
|
49 |
-+ DUID_TYPE_LL = 3, |
|
50 |
-+ DUID_TYPE_UUID = 4, |
|
51 |
-+ _DUID_TYPE_MAX, |
|
52 |
-+ _DUID_TYPE_INVALID = -1, |
|
53 |
-+} DUIDType; |
|
54 |
-+ |
|
55 |
- /* RFC 3315 section 9.1: |
|
56 |
- * A DUID can be no more than 128 octets long (not including the type code). |
|
57 |
- */ |
|
58 |
- #define MAX_DUID_LEN 128 |
|
59 |
- |
|
60 |
- struct duid { |
|
61 |
-- uint16_t type; |
|
62 |
-+ be16_t type; |
|
63 |
- union { |
|
64 |
- struct { |
|
65 |
- /* DHCP6_DUID_LLT */ |
|
66 |
-@@ -63,3 +73,32 @@ |
|
67 |
- |
|
68 |
- int dhcp_identifier_set_duid_en(struct duid *duid, size_t *len); |
|
69 |
- int dhcp_identifier_set_iaid(int ifindex, uint8_t *mac, size_t mac_len, void *_id); |
|
70 |
-+ |
|
71 |
-+static inline int dhcp_validate_duid_len(uint16_t duid_type, size_t duid_len) { |
|
72 |
-+ struct duid d; |
|
73 |
-+ |
|
74 |
-+ assert_return(duid_len > 0 && duid_len <= MAX_DUID_LEN, -EINVAL); |
|
75 |
-+ |
|
76 |
-+ switch (duid_type) { |
|
77 |
-+ case DUID_TYPE_LLT: |
|
78 |
-+ if (duid_len <= sizeof(d.llt)) |
|
79 |
-+ return -EINVAL; |
|
80 |
-+ break; |
|
81 |
-+ case DUID_TYPE_EN: |
|
82 |
-+ if (duid_len != sizeof(d.en)) |
|
83 |
-+ return -EINVAL; |
|
84 |
-+ break; |
|
85 |
-+ case DUID_TYPE_LL: |
|
86 |
-+ if (duid_len <= sizeof(d.ll)) |
|
87 |
-+ return -EINVAL; |
|
88 |
-+ break; |
|
89 |
-+ case DUID_TYPE_UUID: |
|
90 |
-+ if (duid_len != sizeof(d.uuid)) |
|
91 |
-+ return -EINVAL; |
|
92 |
-+ break; |
|
93 |
-+ default: |
|
94 |
-+ /* accept unknown type in order to be forward compatible */ |
|
95 |
-+ break; |
|
96 |
-+ } |
|
97 |
-+ return 0; |
|
98 |
-+} |
|
99 |
-diff -uNr systemd-228/src/libsystemd-network/dhcp6-protocol.h systemd-228-duid/src/libsystemd-network/dhcp6-protocol.h |
|
100 |
-+++ systemd-228-duid/src/libsystemd-network/dhcp6-protocol.h 2016-03-30 19:59:27.311768320 +0000 |
|
101 |
-@@ -64,13 +64,6 @@ |
|
102 |
- #define DHCP6_REB_TIMEOUT 10 * USEC_PER_SEC |
|
103 |
- #define DHCP6_REB_MAX_RT 600 * USEC_PER_SEC |
|
104 |
- |
|
105 |
--enum { |
|
106 |
-- DHCP6_DUID_LLT = 1, |
|
107 |
-- DHCP6_DUID_EN = 2, |
|
108 |
-- DHCP6_DUID_LL = 3, |
|
109 |
-- DHCP6_DUID_UUID = 4, |
|
110 |
--}; |
|
111 |
-- |
|
112 |
- enum DHCP6State { |
|
113 |
- DHCP6_STATE_STOPPED = 0, |
|
114 |
- DHCP6_STATE_INFORMATION_REQUEST = 1, |
|
115 |
-diff -uNr systemd-228/src/libsystemd-network/network-internal.c systemd-228-duid/src/libsystemd-network/network-internal.c |
|
116 |
-+++ systemd-228-duid/src/libsystemd-network/network-internal.c 2016-03-30 19:59:27.312768295 +0000 |
|
117 |
-@@ -337,6 +337,35 @@ |
|
118 |
- return 0; |
|
119 |
- } |
|
120 |
- |
|
121 |
-+int config_parse_iaid(const char *unit, |
|
122 |
-+ const char *filename, |
|
123 |
-+ unsigned line, |
|
124 |
-+ const char *section, |
|
125 |
-+ unsigned section_line, |
|
126 |
-+ const char *lvalue, |
|
127 |
-+ int ltype, |
|
128 |
-+ const char *rvalue, |
|
129 |
-+ void *data, |
|
130 |
-+ void *userdata) { |
|
131 |
-+ uint32_t iaid; |
|
132 |
-+ int r; |
|
133 |
-+ |
|
134 |
-+ assert(filename); |
|
135 |
-+ assert(lvalue); |
|
136 |
-+ assert(rvalue); |
|
137 |
-+ assert(data); |
|
138 |
-+ |
|
139 |
-+ r = safe_atou32(rvalue, &iaid); |
|
140 |
-+ if (r < 0) { |
|
141 |
-+ log_syntax(unit, LOG_ERR, filename, line, 0, "Unable to read IAID: %s", rvalue); |
|
142 |
-+ return r; |
|
143 |
-+ } |
|
144 |
-+ |
|
145 |
-+ *((uint32_t *)data) = iaid; |
|
146 |
-+ |
|
147 |
-+ return 0; |
|
148 |
-+} |
|
149 |
-+ |
|
150 |
- void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size) { |
|
151 |
- unsigned i; |
|
152 |
- |
|
153 |
-diff -uNr systemd-228/src/libsystemd-network/network-internal.h systemd-228-duid/src/libsystemd-network/network-internal.h |
|
154 |
-+++ systemd-228-duid/src/libsystemd-network/network-internal.h 2016-03-30 19:59:27.312768295 +0000 |
|
155 |
-@@ -62,6 +62,10 @@ |
|
156 |
- const char *section, unsigned section_line, const char *lvalue, |
|
157 |
- int ltype, const char *rvalue, void *data, void *userdata); |
|
158 |
- |
|
159 |
-+int config_parse_iaid(const char *unit, const char *filename, unsigned line, |
|
160 |
-+ const char *section, unsigned section_line, const char *lvalue, |
|
161 |
-+ int ltype, const char *rvalue, void *data, void *userdata); |
|
162 |
-+ |
|
163 |
- int net_get_unique_predictable_data(struct udev_device *device, uint64_t *result); |
|
164 |
- const char *net_get_name(struct udev_device *device); |
|
165 |
- |
|
166 |
-diff -uNr systemd-228/src/libsystemd-network/sd-dhcp-client.c systemd-228-duid/src/libsystemd-network/sd-dhcp-client.c |
|
167 |
-+++ systemd-228-duid/src/libsystemd-network/sd-dhcp-client.c 2016-03-30 19:59:27.313768270 +0000 |
|
168 |
-@@ -77,7 +77,7 @@ |
|
169 |
- } _packed_ ll; |
|
170 |
- struct { |
|
171 |
- /* 255: Node-specific (RFC 4361) */ |
|
172 |
-- uint32_t iaid; |
|
173 |
-+ be32_t iaid; |
|
174 |
- struct duid duid; |
|
175 |
- } _packed_ ns; |
|
176 |
- struct { |
|
177 |
-@@ -291,6 +291,52 @@ |
|
178 |
- |
|
179 |
- return 0; |
|
180 |
- } |
|
181 |
-+ |
|
182 |
-+int sd_dhcp_client_set_iaid_duid(sd_dhcp_client *client, uint32_t iaid, |
|
183 |
-+ uint16_t duid_type, uint8_t *duid, size_t duid_len) { |
|
184 |
-+ DHCP_CLIENT_DONT_DESTROY(client); |
|
185 |
-+ int r; |
|
186 |
-+ assert_return(client, -EINVAL); |
|
187 |
-+ zero(client->client_id); |
|
188 |
-+ |
|
189 |
-+ client->client_id.type = 255; |
|
190 |
-+ |
|
191 |
-+ /* If IAID is not configured, generate it. */ |
|
192 |
-+ if (iaid == 0) { |
|
193 |
-+ r = dhcp_identifier_set_iaid(client->index, client->mac_addr, |
|
194 |
-+ client->mac_addr_len, |
|
195 |
-+ &client->client_id.ns.iaid); |
|
196 |
-+ if (r < 0) |
|
197 |
-+ return r; |
|
198 |
-+ } else |
|
199 |
-+ client->client_id.ns.iaid = htobe32(iaid); |
|
200 |
-+ |
|
201 |
-+ /* If DUID is not configured, generate DUID-EN. */ |
|
202 |
-+ if (duid_len == 0) { |
|
203 |
-+ r = dhcp_identifier_set_duid_en(&client->client_id.ns.duid, |
|
204 |
-+ &duid_len); |
|
205 |
-+ if (r < 0) |
|
206 |
-+ return r; |
|
207 |
-+ } else { |
|
208 |
-+ r = dhcp_validate_duid_len(client->client_id.type, duid_len); |
|
209 |
-+ if (r < 0) |
|
210 |
-+ return r; |
|
211 |
-+ client->client_id.ns.duid.type = htobe16(duid_type); |
|
212 |
-+ memcpy(&client->client_id.ns.duid.raw.data, duid, duid_len); |
|
213 |
-+ duid_len += sizeof(client->client_id.ns.duid.type); |
|
214 |
-+ } |
|
215 |
-+ |
|
216 |
-+ client->client_id_len = sizeof(client->client_id.type) + duid_len + |
|
217 |
-+ sizeof(client->client_id.ns.iaid); |
|
218 |
-+ |
|
219 |
-+ if (!IN_SET(client->state, DHCP_STATE_INIT, DHCP_STATE_STOPPED)) { |
|
220 |
-+ log_dhcp_client(client, "Configured IAID+DUID, restarting."); |
|
221 |
-+ client_stop(client, SD_DHCP_CLIENT_EVENT_STOP); |
|
222 |
-+ sd_dhcp_client_start(client); |
|
223 |
-+ } |
|
224 |
-+ |
|
225 |
-+ return 0; |
|
226 |
-+} |
|
227 |
- |
|
228 |
- int sd_dhcp_client_set_hostname(sd_dhcp_client *client, |
|
229 |
- const char *hostname) { |
|
230 |
-diff -uNr systemd-228/src/libsystemd-network/sd-dhcp6-client.c systemd-228-duid/src/libsystemd-network/sd-dhcp6-client.c |
|
231 |
-+++ systemd-228-duid/src/libsystemd-network/sd-dhcp6-client.c 2016-03-30 19:59:27.313768270 +0000 |
|
232 |
-@@ -184,41 +184,29 @@ |
|
233 |
- return dhcp_identifier_set_duid_en(&client->duid, &client->duid_len); |
|
234 |
- } |
|
235 |
- |
|
236 |
--int sd_dhcp6_client_set_duid( |
|
237 |
-- sd_dhcp6_client *client, |
|
238 |
-- uint16_t type, |
|
239 |
-- uint8_t *duid, size_t duid_len) { |
|
240 |
-+int sd_dhcp6_client_set_duid(sd_dhcp6_client *client, uint16_t duid_type, |
|
241 |
-+ uint8_t *duid, size_t duid_len) { |
|
242 |
-+ int r; |
|
243 |
- assert_return(client, -EINVAL); |
|
244 |
-- assert_return(duid, -EINVAL); |
|
245 |
-- assert_return(duid_len > 0 && duid_len <= MAX_DUID_LEN, -EINVAL); |
|
246 |
-- |
|
247 |
- assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY); |
|
248 |
- |
|
249 |
-- switch (type) { |
|
250 |
-- case DHCP6_DUID_LLT: |
|
251 |
-- if (duid_len <= sizeof(client->duid.llt)) |
|
252 |
-- return -EINVAL; |
|
253 |
-- break; |
|
254 |
-- case DHCP6_DUID_EN: |
|
255 |
-- if (duid_len != sizeof(client->duid.en)) |
|
256 |
-- return -EINVAL; |
|
257 |
-- break; |
|
258 |
-- case DHCP6_DUID_LL: |
|
259 |
-- if (duid_len <= sizeof(client->duid.ll)) |
|
260 |
-- return -EINVAL; |
|
261 |
-- break; |
|
262 |
-- case DHCP6_DUID_UUID: |
|
263 |
-- if (duid_len != sizeof(client->duid.uuid)) |
|
264 |
-- return -EINVAL; |
|
265 |
-- break; |
|
266 |
-- default: |
|
267 |
-- /* accept unknown type in order to be forward compatible */ |
|
268 |
-- break; |
|
269 |
-+ if (duid_len > 0) { |
|
270 |
-+ r = dhcp_validate_duid_len(duid_type, duid_len); |
|
271 |
-+ if (r < 0) |
|
272 |
-+ return r; |
|
273 |
-+ client->duid.type = htobe16(duid_type); |
|
274 |
-+ memcpy(&client->duid.raw.data, duid, duid_len); |
|
275 |
-+ client->duid_len = duid_len + sizeof(client->duid.type); |
|
276 |
- } |
|
277 |
- |
|
278 |
-- client->duid.type = htobe16(type); |
|
279 |
-- memcpy(&client->duid.raw.data, duid, duid_len); |
|
280 |
-- client->duid_len = duid_len + sizeof(client->duid.type); |
|
281 |
-+ return 0; |
|
282 |
-+} |
|
283 |
-+ |
|
284 |
-+int sd_dhcp6_client_set_iaid(sd_dhcp6_client *client, uint32_t iaid) { |
|
285 |
-+ assert_return(client, -EINVAL); |
|
286 |
-+ assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY); |
|
287 |
-+ |
|
288 |
-+ client->ia_na.id = htobe32(iaid); |
|
289 |
- |
|
290 |
- return 0; |
|
291 |
- } |
|
292 |
-diff -uNr systemd-228/src/network/networkd-conf.c systemd-228-duid/src/network/networkd-conf.c |
|
293 |
-+++ systemd-228-duid/src/network/networkd-conf.c 2016-03-30 19:59:27.314768245 +0000 |
|
294 |
-@@ -0,0 +1,155 @@ |
|
295 |
-+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ |
|
296 |
-+ |
|
297 |
-+/*** |
|
298 |
-+ This file is part of systemd. |
|
299 |
-+ |
|
300 |
-+ Copyright 2014 Vinay Kulkarni <kulkarniv@vmware.com> |
|
301 |
-+ |
|
302 |
-+ systemd is free software; you can redistribute it and/or modify it |
|
303 |
-+ under the terms of the GNU Lesser General Public License as published by |
|
304 |
-+ the Free Software Foundation; either version 2.1 of the License, or |
|
305 |
-+ (at your option) any later version. |
|
306 |
-+ |
|
307 |
-+ systemd is distributed in the hope that it will be useful, but |
|
308 |
-+ WITHOUT ANY WARRANTY; without even the implied warranty of |
|
309 |
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
310 |
-+ Lesser General Public License for more details. |
|
311 |
-+ |
|
312 |
-+ You should have received a copy of the GNU Lesser General Public License |
|
313 |
-+ along with systemd; If not, see <http://www.gnu.org/licenses/>. |
|
314 |
-+ ***/ |
|
315 |
-+ |
|
316 |
-+#include <ctype.h> |
|
317 |
-+ |
|
318 |
-+#include "conf-parser.h" |
|
319 |
-+#include "def.h" |
|
320 |
-+#include "dhcp-identifier.h" |
|
321 |
-+#include "networkd-conf.h" |
|
322 |
-+#include "string-table.h" |
|
323 |
-+ |
|
324 |
-+int manager_parse_config_file(Manager *m) { |
|
325 |
-+ assert(m); |
|
326 |
-+ |
|
327 |
-+ return config_parse_many(PKGSYSCONFDIR "/networkd.conf", |
|
328 |
-+ CONF_PATHS_NULSTR("systemd/networkd.conf.d"), |
|
329 |
-+ "DUID\0", |
|
330 |
-+ config_item_perf_lookup, networkd_gperf_lookup, |
|
331 |
-+ false, m); |
|
332 |
-+} |
|
333 |
-+ |
|
334 |
-+static const char* const duid_type_table[_DUID_TYPE_MAX] = { |
|
335 |
-+ [DUID_TYPE_RAW] = "raw", |
|
336 |
-+ [DUID_TYPE_LLT] = "link-layer-time", |
|
337 |
-+ [DUID_TYPE_EN] = "vendor", |
|
338 |
-+ [DUID_TYPE_LL] = "link-layer", |
|
339 |
-+ [DUID_TYPE_UUID] = "uuid" |
|
340 |
-+}; |
|
341 |
-+DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING(duid_type, DUIDType); |
|
342 |
-+DEFINE_CONFIG_PARSE_ENUM(config_parse_duid_type, duid_type, DUIDType, "Failed to parse DUID type"); |
|
343 |
-+ |
|
344 |
-+int config_parse_duid_rawdata( |
|
345 |
-+ const char *unit, |
|
346 |
-+ const char *filename, |
|
347 |
-+ unsigned line, |
|
348 |
-+ const char *section, |
|
349 |
-+ unsigned section_line, |
|
350 |
-+ const char *lvalue, |
|
351 |
-+ int ltype, |
|
352 |
-+ const char *rvalue, |
|
353 |
-+ void *data, |
|
354 |
-+ void *userdata) { |
|
355 |
-+ int r; |
|
356 |
-+ long byte; |
|
357 |
-+ char *cbyte, *pnext; |
|
358 |
-+ const char *pduid = rvalue; |
|
359 |
-+ size_t count = 0, duid_index = 0; |
|
360 |
-+ Manager *m; |
|
361 |
-+ Network *n; |
|
362 |
-+ DUIDType *duid_type; |
|
363 |
-+ uint16_t *dhcp_duid_type; |
|
364 |
-+ size_t *dhcp_duid_len; |
|
365 |
-+ uint8_t *dhcp_duid; |
|
366 |
-+ |
|
367 |
-+ assert(filename); |
|
368 |
-+ assert(lvalue); |
|
369 |
-+ assert(rvalue); |
|
370 |
-+ assert(userdata); |
|
371 |
-+ |
|
372 |
-+ if (ltype == DUID_CONFIG_SOURCE_GLOBAL) { |
|
373 |
-+ m = userdata; |
|
374 |
-+ duid_type = &m->duid_type; |
|
375 |
-+ dhcp_duid_type = &m->dhcp_duid_type; |
|
376 |
-+ dhcp_duid_len = &m->dhcp_duid_len; |
|
377 |
-+ dhcp_duid = m->dhcp_duid; |
|
378 |
-+ } else { |
|
379 |
-+ /* DUID_CONFIG_SOURCE_NETWORK */ |
|
380 |
-+ n = userdata; |
|
381 |
-+ duid_type = &n->duid_type; |
|
382 |
-+ dhcp_duid_type = &n->dhcp_duid_type; |
|
383 |
-+ dhcp_duid_len = &n->dhcp_duid_len; |
|
384 |
-+ dhcp_duid = n->dhcp_duid; |
|
385 |
-+ } |
|
386 |
-+ |
|
387 |
-+ if (*duid_type == _DUID_TYPE_INVALID) |
|
388 |
-+ *duid_type = DUID_TYPE_RAW; |
|
389 |
-+ |
|
390 |
-+ switch (*duid_type) { |
|
391 |
-+ case DUID_TYPE_LLT: |
|
392 |
-+ /* RawData contains DUID-LLT link-layer address (offset 6) */ |
|
393 |
-+ duid_index = 6; |
|
394 |
-+ break; |
|
395 |
-+ case DUID_TYPE_EN: |
|
396 |
-+ /* RawData contains DUID-EN identifier (offset 4) */ |
|
397 |
-+ duid_index = 4; |
|
398 |
-+ break; |
|
399 |
-+ case DUID_TYPE_LL: |
|
400 |
-+ /* RawData contains DUID-LL link-layer address (offset 2) */ |
|
401 |
-+ duid_index = 2; |
|
402 |
-+ break; |
|
403 |
-+ case DUID_TYPE_UUID: |
|
404 |
-+ /* RawData specifies UUID (offset 0) - fall thru */ |
|
405 |
-+ case DUID_TYPE_RAW: |
|
406 |
-+ /* First two bytes of RawData is DUID Type - fall thru */ |
|
407 |
-+ default: |
|
408 |
-+ break; |
|
409 |
-+ } |
|
410 |
-+ |
|
411 |
-+ if (*duid_type != DUID_TYPE_RAW) |
|
412 |
-+ *dhcp_duid_type = (uint16_t)(*duid_type); |
|
413 |
-+ |
|
414 |
-+ /* RawData contains DUID in format " NN:NN:NN... " */ |
|
415 |
-+ while (true) { |
|
416 |
-+ r = extract_first_word(&pduid, &cbyte, ":", 0); |
|
417 |
-+ if (r < 0) { |
|
418 |
-+ log_error("Failed to read DUID."); |
|
419 |
-+ return -EINVAL; |
|
420 |
-+ } |
|
421 |
-+ if (r == 0) |
|
422 |
-+ break; |
|
423 |
-+ if (duid_index >= MAX_DUID_LEN) { |
|
424 |
-+ log_error("DUID length exceeds maximum length."); |
|
425 |
-+ return -EINVAL; |
|
426 |
-+ } |
|
427 |
-+ |
|
428 |
-+ errno = 0; |
|
429 |
-+ byte = strtol(cbyte, &pnext, 16); |
|
430 |
-+ if ((errno == ERANGE && (byte == LONG_MAX || byte == LONG_MIN)) |
|
431 |
-+ || (errno != 0 && byte == 0) || (cbyte == pnext)) { |
|
432 |
-+ log_error("Invalid DUID byte: %s.", cbyte); |
|
433 |
-+ return -EINVAL; |
|
434 |
-+ } |
|
435 |
-+ |
|
436 |
-+ /* If DUID_TYPE_RAW, first two bytes hold DHCP DUID type code */ |
|
437 |
-+ if ((*duid_type == DUID_TYPE_RAW) && (count < 2)) { |
|
438 |
-+ *dhcp_duid_type |= (byte << (8 * (1 - count))); |
|
439 |
-+ count++; |
|
440 |
-+ continue; |
|
441 |
-+ } |
|
442 |
-+ |
|
443 |
-+ dhcp_duid[duid_index++] = byte; |
|
444 |
-+ } |
|
445 |
-+ |
|
446 |
-+ *dhcp_duid_len = duid_index; |
|
447 |
-+ |
|
448 |
-+ return 0; |
|
449 |
-+} |
|
450 |
-diff -uNr systemd-228/src/network/networkd-conf.h systemd-228-duid/src/network/networkd-conf.h |
|
451 |
-+++ systemd-228-duid/src/network/networkd-conf.h 2016-03-30 19:59:27.314768245 +0000 |
|
452 |
-@@ -0,0 +1,36 @@ |
|
453 |
-+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ |
|
454 |
-+ |
|
455 |
-+#pragma once |
|
456 |
-+ |
|
457 |
-+/*** |
|
458 |
-+ This file is part of systemd. |
|
459 |
-+ |
|
460 |
-+ Copyright 2014 Vinay Kulkarni <kulkarniv@vmware.com> |
|
461 |
-+ |
|
462 |
-+ systemd is free software; you can redistribute it and/or modify it |
|
463 |
-+ under the terms of the GNU Lesser General Public License as published by |
|
464 |
-+ the Free Software Foundation; either version 2.1 of the License, or |
|
465 |
-+ (at your option) any later version. |
|
466 |
-+ |
|
467 |
-+ systemd is distributed in the hope that it will be useful, but |
|
468 |
-+ WITHOUT ANY WARRANTY; without even the implied warranty of |
|
469 |
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
470 |
-+ Lesser General Public License for more details. |
|
471 |
-+ |
|
472 |
-+ You should have received a copy of the GNU Lesser General Public License |
|
473 |
-+ along with systemd; If not, see <http://www.gnu.org/licenses/>. |
|
474 |
-+***/ |
|
475 |
-+ |
|
476 |
-+#include "networkd.h" |
|
477 |
-+ |
|
478 |
-+typedef enum DuidConfigSource { |
|
479 |
-+ DUID_CONFIG_SOURCE_GLOBAL = 0, |
|
480 |
-+ DUID_CONFIG_SOURCE_NETWORK, |
|
481 |
-+} DuidConfigSource; |
|
482 |
-+ |
|
483 |
-+int manager_parse_config_file(Manager *m); |
|
484 |
-+ |
|
485 |
-+const struct ConfigPerfItem* networkd_gperf_lookup(const char *key, unsigned length); |
|
486 |
-+ |
|
487 |
-+int config_parse_duid_type(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); |
|
488 |
-+int config_parse_duid_rawdata(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); |
|
489 |
-diff -uNr systemd-228/src/network/networkd-dhcp4.c systemd-228-duid/src/network/networkd-dhcp4.c |
|
490 |
-+++ systemd-228-duid/src/network/networkd-dhcp4.c 2016-03-30 19:59:27.314768245 +0000 |
|
491 |
-@@ -624,7 +624,21 @@ |
|
492 |
- |
|
493 |
- switch (link->network->dhcp_client_identifier) { |
|
494 |
- case DHCP_CLIENT_ID_DUID: |
|
495 |
-- /* Library defaults to this. */ |
|
496 |
-+ /* If configured, apply user specified DUID and/or IAID */ |
|
497 |
-+ if (link->network->duid_type != _DUID_TYPE_INVALID) |
|
498 |
-+ r = sd_dhcp_client_set_iaid_duid(link->dhcp_client, |
|
499 |
-+ link->network->iaid, |
|
500 |
-+ link->network->dhcp_duid_type, |
|
501 |
-+ link->network->dhcp_duid, |
|
502 |
-+ link->network->dhcp_duid_len); |
|
503 |
-+ else |
|
504 |
-+ r = sd_dhcp_client_set_iaid_duid(link->dhcp_client, |
|
505 |
-+ link->network->iaid, |
|
506 |
-+ link->manager->dhcp_duid_type, |
|
507 |
-+ link->manager->dhcp_duid, |
|
508 |
-+ link->manager->dhcp_duid_len); |
|
509 |
-+ if (r < 0) |
|
510 |
-+ return r; |
|
511 |
- break; |
|
512 |
- case DHCP_CLIENT_ID_MAC: |
|
513 |
- r = sd_dhcp_client_set_client_id(link->dhcp_client, |
|
514 |
-diff -uNr systemd-228/src/network/networkd-dhcp6.c systemd-228-duid/src/network/networkd-dhcp6.c |
|
515 |
-+++ systemd-228-duid/src/network/networkd-dhcp6.c 2016-03-30 19:59:27.314768245 +0000 |
|
516 |
-@@ -232,6 +232,23 @@ |
|
517 |
- if (r < 0) |
|
518 |
- goto error; |
|
519 |
- |
|
520 |
-+ r = sd_dhcp6_client_set_iaid(client, link->network->iaid); |
|
521 |
-+ if (r < 0) |
|
522 |
-+ goto error; |
|
523 |
-+ |
|
524 |
-+ if (link->network->duid_type != _DUID_TYPE_INVALID) |
|
525 |
-+ r = sd_dhcp6_client_set_duid(client, |
|
526 |
-+ link->network->dhcp_duid_type, |
|
527 |
-+ link->network->dhcp_duid, |
|
528 |
-+ link->network->dhcp_duid_len); |
|
529 |
-+ else |
|
530 |
-+ r = sd_dhcp6_client_set_duid(client, |
|
531 |
-+ link->manager->dhcp_duid_type, |
|
532 |
-+ link->manager->dhcp_duid, |
|
533 |
-+ link->manager->dhcp_duid_len); |
|
534 |
-+ if (r < 0) |
|
535 |
-+ goto error; |
|
536 |
-+ |
|
537 |
- r = sd_dhcp6_client_set_index(client, link->ifindex); |
|
538 |
- if (r < 0) |
|
539 |
- goto error; |
|
540 |
-diff -uNr systemd-228/src/network/networkd-gperf.gperf systemd-228-duid/src/network/networkd-gperf.gperf |
|
541 |
-+++ systemd-228-duid/src/network/networkd-gperf.gperf 2016-03-30 19:59:27.314768245 +0000 |
|
542 |
-@@ -0,0 +1,18 @@ |
|
543 |
-+%{ |
|
544 |
-+#include <stddef.h> |
|
545 |
-+#include "conf-parser.h" |
|
546 |
-+#include "networkd-conf.h" |
|
547 |
-+%} |
|
548 |
-+struct ConfigPerfItem; |
|
549 |
-+%null_strings |
|
550 |
-+%language=ANSI-C |
|
551 |
-+%define slot-name section_and_lvalue |
|
552 |
-+%define hash-function-name networkd_gperf_hash |
|
553 |
-+%define lookup-function-name networkd_gperf_lookup |
|
554 |
-+%readonly-tables |
|
555 |
-+%omit-struct-type |
|
556 |
-+%struct-type |
|
557 |
-+%includes |
|
558 |
-+%% |
|
559 |
-+DUID.Type, config_parse_duid_type, 0, offsetof(Manager, duid_type) |
|
560 |
-+DUID.RawData, config_parse_duid_rawdata, DUID_CONFIG_SOURCE_GLOBAL, offsetof(Manager, dhcp_duid) |
|
561 |
-diff -uNr systemd-228/src/network/networkd-link.c systemd-228-duid/src/network/networkd-link.c |
|
562 |
-+++ systemd-228-duid/src/network/networkd-link.c 2016-03-30 19:59:27.315768220 +0000 |
|
563 |
-@@ -2650,6 +2650,21 @@ |
|
564 |
- ARPHRD_ETHER); |
|
565 |
- if (r < 0) |
|
566 |
- return log_link_warning_errno(link, r, "Could not update MAC address in DHCP client: %m"); |
|
567 |
-+ |
|
568 |
-+ if (link->network->duid_type != _DUID_TYPE_INVALID) |
|
569 |
-+ r = sd_dhcp_client_set_iaid_duid(link->dhcp_client, |
|
570 |
-+ link->network->iaid, |
|
571 |
-+ link->network->dhcp_duid_type, |
|
572 |
-+ link->network->dhcp_duid, |
|
573 |
-+ link->network->dhcp_duid_len); |
|
574 |
-+ else |
|
575 |
-+ r = sd_dhcp_client_set_iaid_duid(link->dhcp_client, |
|
576 |
-+ link->network->iaid, |
|
577 |
-+ link->manager->dhcp_duid_type, |
|
578 |
-+ link->manager->dhcp_duid, |
|
579 |
-+ link->manager->dhcp_duid_len); |
|
580 |
-+ if (r < 0) |
|
581 |
-+ return log_link_warning_errno(link, r, "Could not update DUID/IAID in DHCP client: %m"); |
|
582 |
- } |
|
583 |
- |
|
584 |
- if (link->dhcp6_client) { |
|
585 |
-@@ -2659,6 +2674,24 @@ |
|
586 |
- ARPHRD_ETHER); |
|
587 |
- if (r < 0) |
|
588 |
- return log_link_warning_errno(link, r, "Could not update MAC address in DHCPv6 client: %m"); |
|
589 |
-+ |
|
590 |
-+ r = sd_dhcp6_client_set_iaid(link->dhcp6_client, |
|
591 |
-+ link->network->iaid); |
|
592 |
-+ if (r < 0) |
|
593 |
-+ return log_link_warning_errno(link, r, "Could not update DHCPv6 IAID: %m"); |
|
594 |
-+ |
|
595 |
-+ if (link->network->duid_type != _DUID_TYPE_INVALID) |
|
596 |
-+ r = sd_dhcp6_client_set_duid(link->dhcp6_client, |
|
597 |
-+ link->network->dhcp_duid_type, |
|
598 |
-+ link->network->dhcp_duid, |
|
599 |
-+ link->network->dhcp_duid_len); |
|
600 |
-+ else |
|
601 |
-+ r = sd_dhcp6_client_set_duid(link->dhcp6_client, |
|
602 |
-+ link->manager->dhcp_duid_type, |
|
603 |
-+ link->manager->dhcp_duid, |
|
604 |
-+ link->manager->dhcp_duid_len); |
|
605 |
-+ if (r < 0) |
|
606 |
-+ return log_link_warning_errno(link, r, "Could not update DHCPv6 DUID: %m"); |
|
607 |
- } |
|
608 |
- } |
|
609 |
- } |
|
610 |
-diff -uNr systemd-228/src/network/networkd-manager.c systemd-228-duid/src/network/networkd-manager.c |
|
611 |
-+++ systemd-228-duid/src/network/networkd-manager.c 2016-03-30 19:59:27.315768220 +0000 |
|
612 |
-@@ -1025,6 +1025,8 @@ |
|
613 |
- if (r < 0) |
|
614 |
- return r; |
|
615 |
- |
|
616 |
-+ m->duid_type = _DUID_TYPE_INVALID; |
|
617 |
-+ |
|
618 |
- *ret = m; |
|
619 |
- m = NULL; |
|
620 |
- |
|
621 |
-diff -uNr systemd-228/src/network/networkd-network-gperf.gperf systemd-228-duid/src/network/networkd-network-gperf.gperf |
|
622 |
-+++ systemd-228-duid/src/network/networkd-network-gperf.gperf 2016-03-30 19:59:27.316768196 +0000 |
|
623 |
-@@ -2,6 +2,7 @@ |
|
624 |
- #include <stddef.h> |
|
625 |
- #include "conf-parser.h" |
|
626 |
- #include "networkd.h" |
|
627 |
-+#include "networkd-conf.h" |
|
628 |
- #include "network-internal.h" |
|
629 |
- %} |
|
630 |
- struct ConfigPerfItem; |
|
631 |
-@@ -26,6 +27,9 @@ |
|
632 |
- Match.Architecture, config_parse_net_condition, CONDITION_ARCHITECTURE, offsetof(Network, match_arch) |
|
633 |
- Link.MACAddress, config_parse_hwaddr, 0, offsetof(Network, mac) |
|
634 |
- Link.MTUBytes, config_parse_iec_size, 0, offsetof(Network, mtu) |
|
635 |
-+Link.IAID, config_parse_iaid, 0, offsetof(Network, iaid) |
|
636 |
-+DUID.Type, config_parse_duid_type, 0, offsetof(Network, duid_type) |
|
637 |
-+DUID.RawData, config_parse_duid_rawdata, DUID_CONFIG_SOURCE_NETWORK, offsetof(Network, dhcp_duid) |
|
638 |
- Network.Description, config_parse_string, 0, offsetof(Network, description) |
|
639 |
- Network.Bridge, config_parse_netdev, 0, offsetof(Network, bridge) |
|
640 |
- Network.Bond, config_parse_netdev, 0, offsetof(Network, bond) |
|
641 |
-diff -uNr systemd-228/src/network/networkd-network.c systemd-228-duid/src/network/networkd-network.c |
|
642 |
-+++ systemd-228-duid/src/network/networkd-network.c 2016-03-30 19:59:27.316768196 +0000 |
|
643 |
-@@ -128,10 +128,12 @@ |
|
644 |
- network->ipv6_accept_ra = -1; |
|
645 |
- network->ipv6_dad_transmits = -1; |
|
646 |
- network->ipv6_hop_limit = -1; |
|
647 |
-+ network->duid_type = _DUID_TYPE_INVALID; |
|
648 |
- |
|
649 |
- r = config_parse(NULL, filename, file, |
|
650 |
- "Match\0" |
|
651 |
- "Link\0" |
|
652 |
-+ "DUID\0" |
|
653 |
- "Network\0" |
|
654 |
- "Address\0" |
|
655 |
- "Route\0" |
|
656 |
-diff -uNr systemd-228/src/network/networkd-network.h systemd-228-duid/src/network/networkd-network.h |
|
657 |
-+++ systemd-228-duid/src/network/networkd-network.h 2016-03-30 20:01:19.379946446 +0000 |
|
658 |
-@@ -25,6 +25,7 @@ |
|
659 |
- |
|
660 |
- typedef struct Network Network; |
|
661 |
- |
|
662 |
-+#include "dhcp-identifier.h" |
|
663 |
- #include "networkd.h" |
|
664 |
- #include "networkd-netdev.h" |
|
665 |
- #include "networkd-address.h" |
|
666 |
-@@ -129,6 +130,13 @@ |
|
667 |
- |
|
668 |
- struct ether_addr *mac; |
|
669 |
- unsigned mtu; |
|
670 |
-+ uint32_t iaid; |
|
671 |
-+ /* Value of Type in [DUID] section */ |
|
672 |
-+ DUIDType duid_type; |
|
673 |
-+ /* DUID type code - RFC 3315 */ |
|
674 |
-+ uint16_t dhcp_duid_type; |
|
675 |
-+ size_t dhcp_duid_len; |
|
676 |
-+ uint8_t dhcp_duid[MAX_DUID_LEN]; |
|
677 |
- |
|
678 |
- bool lldp; |
|
679 |
- |
|
680 |
-diff -uNr systemd-228/src/network/networkd.c systemd-228-duid/src/network/networkd.c |
|
681 |
-+++ systemd-228-duid/src/network/networkd.c 2016-03-30 19:59:27.313768270 +0000 |
|
682 |
-@@ -23,6 +23,7 @@ |
|
683 |
- |
|
684 |
- #include "capability-util.h" |
|
685 |
- #include "networkd.h" |
|
686 |
-+#include "networkd-conf.h" |
|
687 |
- #include "signal-util.h" |
|
688 |
- #include "user-util.h" |
|
689 |
- |
|
690 |
-@@ -91,6 +92,10 @@ |
|
691 |
- goto out; |
|
692 |
- } |
|
693 |
- |
|
694 |
-+ r = manager_parse_config_file(m); |
|
695 |
-+ if (r < 0) |
|
696 |
-+ log_warning_errno(r, "Failed to parse configuration file: %m"); |
|
697 |
-+ |
|
698 |
- r = manager_load_config(m); |
|
699 |
- if (r < 0) { |
|
700 |
- log_error_errno(r, "Could not load configuration files: %m"); |
|
701 |
-diff -uNr systemd-228/src/network/networkd.h systemd-228-duid/src/network/networkd.h |
|
702 |
-+++ systemd-228-duid/src/network/networkd.h 2016-03-30 20:00:46.132789522 +0000 |
|
703 |
-@@ -33,6 +33,7 @@ |
|
704 |
- |
|
705 |
- typedef struct Manager Manager; |
|
706 |
- |
|
707 |
-+#include "dhcp-identifier.h" |
|
708 |
- #include "networkd-network.h" |
|
709 |
- #include "networkd-address-pool.h" |
|
710 |
- #include "networkd-link.h" |
|
711 |
-@@ -63,6 +64,13 @@ |
|
712 |
- LIST_HEAD(AddressPool, address_pools); |
|
713 |
- |
|
714 |
- usec_t network_dirs_ts_usec; |
|
715 |
-+ |
|
716 |
-+ /* Value of Type in [DUID] section */ |
|
717 |
-+ DUIDType duid_type; |
|
718 |
-+ /* DUID type code - RFC 3315 */ |
|
719 |
-+ uint16_t dhcp_duid_type; |
|
720 |
-+ size_t dhcp_duid_len; |
|
721 |
-+ uint8_t dhcp_duid[MAX_DUID_LEN]; |
|
722 |
- }; |
|
723 |
- |
|
724 |
- extern const char* const network_dirs[]; |
|
725 |
-diff -uNr systemd-228/src/systemd/sd-dhcp-client.h systemd-228-duid/src/systemd/sd-dhcp-client.h |
|
726 |
-+++ systemd-228-duid/src/systemd/sd-dhcp-client.h 2016-03-30 19:59:27.316768196 +0000 |
|
727 |
-@@ -59,6 +59,8 @@ |
|
728 |
- size_t addr_len, uint16_t arp_type); |
|
729 |
- int sd_dhcp_client_set_client_id(sd_dhcp_client *client, uint8_t type, |
|
730 |
- const uint8_t *data, size_t data_len); |
|
731 |
-+int sd_dhcp_client_set_iaid_duid(sd_dhcp_client *client, uint32_t iaid, |
|
732 |
-+ uint16_t duid_type, uint8_t *duid, size_t duid_len); |
|
733 |
- int sd_dhcp_client_get_client_id(sd_dhcp_client *client, uint8_t *type, |
|
734 |
- const uint8_t **data, size_t *data_len); |
|
735 |
- int sd_dhcp_client_set_mtu(sd_dhcp_client *client, uint32_t mtu); |
|
736 |
-diff -uNr systemd-228/src/systemd/sd-dhcp6-client.h systemd-228-duid/src/systemd/sd-dhcp6-client.h |
|
737 |
-+++ systemd-228-duid/src/systemd/sd-dhcp6-client.h 2016-03-30 19:59:27.316768196 +0000 |
|
738 |
-@@ -52,8 +52,9 @@ |
|
739 |
- int sd_dhcp6_client_set_local_address(sd_dhcp6_client *client, const struct in6_addr *local_address); |
|
740 |
- int sd_dhcp6_client_set_mac(sd_dhcp6_client *client, const uint8_t *addr, |
|
741 |
- size_t addr_len, uint16_t arp_type); |
|
742 |
--int sd_dhcp6_client_set_duid(sd_dhcp6_client *client, uint16_t type, uint8_t *duid, |
|
743 |
-- size_t duid_len); |
|
744 |
-+int sd_dhcp6_client_set_duid(sd_dhcp6_client *client, uint16_t duid_type, |
|
745 |
-+ uint8_t *duid, size_t duid_len); |
|
746 |
-+int sd_dhcp6_client_set_iaid(sd_dhcp6_client *client, uint32_t iaid); |
|
747 |
- int sd_dhcp6_client_set_information_request(sd_dhcp6_client *client, int enabled); |
|
748 |
- int sd_dhcp6_client_get_information_request(sd_dhcp6_client *client, int *enabled); |
|
749 |
- int sd_dhcp6_client_set_request_option(sd_dhcp6_client *client, |
750 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,29 +0,0 @@ |
1 |
-From 74544b4ead6dfc8645b3f0bce6787a494f254cc5 Mon Sep 17 00:00:00 2001 |
|
2 |
-From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
|
3 |
-Date: Sun, 22 Nov 2015 18:37:58 +0100 |
|
4 |
-Subject: [PATCH] networkd: link - fix reading routes |
|
5 |
- |
|
6 |
-This regressed during the port to extract_first_word in c598ac76 |
|
7 |
-(v228). |
|
8 |
- |
|
9 |
-CID #1338083 |
|
10 |
- src/network/networkd-link.c | 2 ++ |
|
11 |
- 1 file changed, 2 insertions(+) |
|
12 |
- |
|
13 |
-diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c |
|
14 |
-index 4af895a..64a4b74 100644 |
|
15 |
-+++ b/src/network/networkd-link.c |
|
16 |
-@@ -2327,6 +2327,8 @@ network_file_fail: |
|
17 |
- } |
|
18 |
- |
|
19 |
- if (routes) { |
|
20 |
-+ p = routes; |
|
21 |
-+ |
|
22 |
- for (;;) { |
|
23 |
- Route *route; |
|
24 |
- _cleanup_free_ char *route_str = NULL; |
|
25 |
-1.9.1 |
|
26 |
- |
27 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,39 +0,0 @@ |
1 |
-diff -aur systemd-228-1/src/network/networkd-link.c systemd-228-1a/src/network/networkd-link.c |
|
2 |
-+++ systemd-228-1a/src/network/networkd-link.c 2016-05-18 16:25:20.219453171 -0700 |
|
3 |
-@@ -134,6 +134,26 @@ |
|
4 |
- return link->network->ip_forward & ADDRESS_FAMILY_IPV6; |
|
5 |
- } |
|
6 |
- |
|
7 |
-+static bool link_ipv6_disabled(Link *link) { |
|
8 |
-+ const char *p = NULL; |
|
9 |
-+ int r; |
|
10 |
-+ if (link->flags & IFF_LOOPBACK) |
|
11 |
-+ return true; |
|
12 |
-+ /* Make this a NOP if IPv6 is not available */ |
|
13 |
-+ if (!socket_ipv6_is_supported()) |
|
14 |
-+ return true; |
|
15 |
-+ |
|
16 |
-+ p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/disable_ipv6"); |
|
17 |
-+ _cleanup_free_ char *val = NULL; |
|
18 |
-+ r = read_one_line_file(p, &val); |
|
19 |
-+ if (r < 0) |
|
20 |
-+ log_link_warning_errno(link, r, "Cannot read ipv6 state for interface: %m"); |
|
21 |
-+ if (streq(val, "0")) |
|
22 |
-+ return false; |
|
23 |
-+ |
|
24 |
-+ return true; |
|
25 |
-+} |
|
26 |
-+ |
|
27 |
- bool link_ipv6_accept_ra_enabled(Link *link) { |
|
28 |
- if (link->flags & IFF_LOOPBACK) |
|
29 |
- return false; |
|
30 |
-@@ -614,7 +634,7 @@ |
|
31 |
- !link->ipv4ll_route) |
|
32 |
- return; |
|
33 |
- |
|
34 |
-- if (link_ipv6ll_enabled(link)) |
|
35 |
-+ if (!link_ipv6_disabled(link) && link_ipv6ll_enabled(link)) |
|
36 |
- if (in_addr_is_null(AF_INET6, (const union in_addr_union*) &link->ipv6ll_address) > 0) |
|
37 |
- return; |
|
38 |
- |
39 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,103 +0,0 @@ |
1 |
-diff -aur systemd-228/src/network/networkd-link.c systemd-228-1/src/network/networkd-link.c |
|
2 |
-+++ systemd-228-1/src/network/networkd-link.c 2016-05-18 14:51:47.150381582 -0700 |
|
3 |
-@@ -626,9 +626,6 @@ |
|
4 |
- !link->dhcp4_configured && !link->dhcp6_configured)) |
|
5 |
- return; |
|
6 |
- |
|
7 |
-- if (link_ipv6_accept_ra_enabled(link) && !link->ndisc_configured) |
|
8 |
-- return; |
|
9 |
-- |
|
10 |
- SET_FOREACH(a, link->addresses, i) |
|
11 |
- if (!address_is_ready(a)) |
|
12 |
- return; |
|
13 |
-@@ -1926,6 +1923,7 @@ |
|
14 |
- |
|
15 |
- static int link_set_ipv6_accept_ra(Link *link) { |
|
16 |
- const char *p = NULL; |
|
17 |
-+ const char *v; |
|
18 |
- int r; |
|
19 |
- |
|
20 |
- /* Make this a NOP if IPv6 is not available */ |
|
21 |
-@@ -1938,12 +1936,16 @@ |
|
22 |
- if (!link->network) |
|
23 |
- return 0; |
|
24 |
- |
|
25 |
-+ if (link_ipv6_accept_ra_enabled(link)) |
|
26 |
-+ v = "1"; |
|
27 |
-+ else |
|
28 |
-+ v = "0"; |
|
29 |
-+ |
|
30 |
- p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/accept_ra"); |
|
31 |
- |
|
32 |
-- /* We handle router advertisments ourselves, tell the kernel to GTFO */ |
|
33 |
-- r = write_string_file(p, "0", WRITE_STRING_FILE_VERIFY_ON_FAILURE); |
|
34 |
-+ r = write_string_file(p, v, WRITE_STRING_FILE_VERIFY_ON_FAILURE); |
|
35 |
- if (r < 0) |
|
36 |
-- log_link_warning_errno(link, r, "Cannot disable kernel IPv6 accept_ra for interface: %m"); |
|
37 |
-+ log_link_warning_errno(link, r, "Cannot configure kernel IPv6 accept_ra for interface: %m"); |
|
38 |
- |
|
39 |
- return 0; |
|
40 |
- } |
|
41 |
-diff -aur systemd-228/src/network/networkd-ndisc.c systemd-228-1/src/network/networkd-ndisc.c |
|
42 |
-+++ systemd-228-1/src/network/networkd-ndisc.c 2016-05-18 14:52:08.990186324 -0700 |
|
43 |
-@@ -26,7 +26,7 @@ |
|
44 |
- #include "sd-ndisc.h" |
|
45 |
- |
|
46 |
- #include "networkd-link.h" |
|
47 |
-- |
|
48 |
-+/* |
|
49 |
- static int ndisc_netlink_handler(sd_netlink *rtnl, sd_netlink_message *m, void *userdata) { |
|
50 |
- _cleanup_link_unref_ Link *link = userdata; |
|
51 |
- int r; |
|
52 |
-@@ -77,7 +77,6 @@ |
|
53 |
- if (in_addr_is_null(AF_INET6, (const union in_addr_union *) &link->network->ipv6_token) == 0) |
|
54 |
- memcpy(((char *)&address->in_addr.in6) + 8, ((char *)&link->network->ipv6_token) + 8, 8); |
|
55 |
- else { |
|
56 |
-- /* see RFC4291 section 2.5.1 */ |
|
57 |
- address->in_addr.in6.__in6_u.__u6_addr8[8] = link->mac.ether_addr_octet[0]; |
|
58 |
- address->in_addr.in6.__in6_u.__u6_addr8[8] ^= 1 << 1; |
|
59 |
- address->in_addr.in6.__in6_u.__u6_addr8[9] = link->mac.ether_addr_octet[1]; |
|
60 |
-@@ -140,11 +139,12 @@ |
|
61 |
- |
|
62 |
- link->ndisc_messages ++; |
|
63 |
- } |
|
64 |
-+*/ |
|
65 |
- |
|
66 |
- static void ndisc_router_handler(sd_ndisc *nd, uint8_t flags, const struct in6_addr *gateway, unsigned lifetime, int pref, void *userdata) { |
|
67 |
- _cleanup_route_free_ Route *route = NULL; |
|
68 |
- Link *link = userdata; |
|
69 |
-- usec_t time_now; |
|
70 |
-+ /* usec_t time_now; */ |
|
71 |
- int r; |
|
72 |
- |
|
73 |
- assert(link); |
|
74 |
-@@ -163,6 +163,8 @@ |
|
75 |
- log_link_warning_errno(link, r, "Starting DHCPv6 client on NDisc request failed: %m"); |
|
76 |
- } |
|
77 |
- |
|
78 |
-+ return; |
|
79 |
-+/* |
|
80 |
- if (!gateway) |
|
81 |
- return; |
|
82 |
- |
|
83 |
-@@ -189,6 +191,7 @@ |
|
84 |
- } |
|
85 |
- |
|
86 |
- link->ndisc_messages ++; |
|
87 |
-+*/ |
|
88 |
- } |
|
89 |
- |
|
90 |
- static void ndisc_handler(sd_ndisc *nd, int event, void *userdata) { |
|
91 |
-@@ -242,8 +245,8 @@ |
|
92 |
- |
|
93 |
- r = sd_ndisc_set_callback(link->ndisc_router_discovery, |
|
94 |
- ndisc_router_handler, |
|
95 |
-- ndisc_prefix_onlink_handler, |
|
96 |
-- ndisc_prefix_autonomous_handler, |
|
97 |
-+ NULL, |
|
98 |
-+ NULL, |
|
99 |
- ndisc_handler, |
|
100 |
- link); |
|
101 |
- |
102 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,37 +0,0 @@ |
1 |
-From e5d44b34cca39a335b8976328a14f47e2d7ef3b9 Mon Sep 17 00:00:00 2001 |
|
2 |
-From: Christian Hesse <mail@eworm.de> |
|
3 |
-Date: Wed, 25 Nov 2015 08:46:43 +0100 |
|
4 |
-Subject: [PATCH] networkd: link - do not drop config for loopback device |
|
5 |
- |
|
6 |
-Commit 5e5b137a (networkd: link - drop foreign config when configuring |
|
7 |
-link) introduced a regression where addresses (including 127.0.0.1) are |
|
8 |
-removed from loopback device. |
|
9 |
-Do not handle loopback device when removing foreign configs. |
|
10 |
- |
|
11 |
-Signed-off-by: Christian Hesse <mail@eworm.de> |
|
12 |
- src/network/networkd-link.c | 10 +++++++--- |
|
13 |
- 1 file changed, 7 insertions(+), 3 deletions(-) |
|
14 |
- |
|
15 |
-diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c |
|
16 |
-index 64a4b74..a9d91b0 100644 |
|
17 |
-+++ b/src/network/networkd-link.c |
|
18 |
-@@ -2040,9 +2040,13 @@ static int link_configure(Link *link) { |
|
19 |
- assert(link->network); |
|
20 |
- assert(link->state == LINK_STATE_PENDING); |
|
21 |
- |
|
22 |
-- r = link_drop_foreign_config(link); |
|
23 |
-- if (r < 0) |
|
24 |
-- return r; |
|
25 |
-+ /* Drop foreign config, but ignore loopback device. |
|
26 |
-+ * We do not want to remove loopback address. */ |
|
27 |
-+ if (!(link->flags & IFF_LOOPBACK)) { |
|
28 |
-+ r = link_drop_foreign_config(link); |
|
29 |
-+ if (r < 0) |
|
30 |
-+ return r; |
|
31 |
-+ } |
|
32 |
- |
|
33 |
- r = link_set_bridge_fdb(link); |
|
34 |
- if (r < 0) |
|
35 |
- |
36 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,77 +0,0 @@ |
1 |
-diff --git a/src/core/mount.c b/src/core/mount.c |
|
2 |
-index 9b44357..2ad4ad4 100644 |
|
3 |
-+++ b/src/core/mount.c |
|
4 |
-@@ -335,7 +335,7 @@ static int mount_add_device_links(Mount *m) { |
|
5 |
- if (mount_is_auto(p) && UNIT(m)->manager->running_as == MANAGER_SYSTEM) |
|
6 |
- device_wants_mount = true; |
|
7 |
- |
|
8 |
-- r = unit_add_node_link(UNIT(m), p->what, device_wants_mount); |
|
9 |
-+ r = unit_add_node_link(UNIT(m), p->what, device_wants_mount, m->from_fragment ? UNIT_BINDS_TO : UNIT_REQUIRES); |
|
10 |
- if (r < 0) |
|
11 |
- return r; |
|
12 |
- |
|
13 |
-diff --git a/src/core/socket.c b/src/core/socket.c |
|
14 |
-index 687675b..860a1e3 100644 |
|
15 |
-+++ b/src/core/socket.c |
|
16 |
-@@ -289,7 +289,7 @@ static int socket_add_device_link(Socket *s) { |
|
17 |
- return 0; |
|
18 |
- |
|
19 |
- t = strjoina("/sys/subsystem/net/devices/", s->bind_to_device); |
|
20 |
-- return unit_add_node_link(UNIT(s), t, false); |
|
21 |
-+ return unit_add_node_link(UNIT(s), t, false, UNIT_BINDS_TO); |
|
22 |
- } |
|
23 |
- |
|
24 |
- static int socket_add_default_dependencies(Socket *s) { |
|
25 |
-diff --git a/src/core/swap.c b/src/core/swap.c |
|
26 |
-index b6e4372..5568898 100644 |
|
27 |
-+++ b/src/core/swap.c |
|
28 |
-@@ -202,7 +202,7 @@ static int swap_add_device_links(Swap *s) { |
|
29 |
- return 0; |
|
30 |
- |
|
31 |
- if (is_device_path(s->what)) |
|
32 |
-- return unit_add_node_link(UNIT(s), s->what, UNIT(s)->manager->running_as == MANAGER_SYSTEM); |
|
33 |
-+ return unit_add_node_link(UNIT(s), s->what, UNIT(s)->manager->running_as == MANAGER_SYSTEM, UNIT_BINDS_TO); |
|
34 |
- else |
|
35 |
- /* File based swap devices need to be ordered after |
|
36 |
- * systemd-remount-fs.service, since they might need a |
|
37 |
-diff --git a/src/core/unit.c b/src/core/unit.c |
|
38 |
-index 0a02e38..e6e67d2 100644 |
|
39 |
-+++ b/src/core/unit.c |
|
40 |
-@@ -2840,7 +2840,7 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) { |
|
41 |
- } |
|
42 |
- } |
|
43 |
- |
|
44 |
--int unit_add_node_link(Unit *u, const char *what, bool wants) { |
|
45 |
-+int unit_add_node_link(Unit *u, const char *what, bool wants, UnitDependency dep) { |
|
46 |
- Unit *device; |
|
47 |
- _cleanup_free_ char *e = NULL; |
|
48 |
- int r; |
|
49 |
-@@ -2867,7 +2867,9 @@ int unit_add_node_link(Unit *u, const char *what, bool wants) { |
|
50 |
- if (r < 0) |
|
51 |
- return r; |
|
52 |
- |
|
53 |
-- r = unit_add_two_dependencies(u, UNIT_AFTER, u->manager->running_as == MANAGER_SYSTEM ? UNIT_BINDS_TO : UNIT_WANTS, device, true); |
|
54 |
-+ r = unit_add_two_dependencies(u, UNIT_AFTER, |
|
55 |
-+ u->manager->running_as == MANAGER_SYSTEM ? dep : UNIT_WANTS, |
|
56 |
-+ device, true); |
|
57 |
- if (r < 0) |
|
58 |
- return r; |
|
59 |
- |
|
60 |
-diff --git a/src/core/unit.h b/src/core/unit.h |
|
61 |
-index 1681bbf..3eb3484 100644 |
|
62 |
-+++ b/src/core/unit.h |
|
63 |
-@@ -528,7 +528,7 @@ int unit_serialize_item_escaped(Unit *u, FILE *f, const char *key, const char *v |
|
64 |
- int unit_serialize_item_fd(Unit *u, FILE *f, FDSet *fds, const char *key, int fd); |
|
65 |
- void unit_serialize_item_format(Unit *u, FILE *f, const char *key, const char *value, ...) _printf_(4,5); |
|
66 |
- |
|
67 |
--int unit_add_node_link(Unit *u, const char *what, bool wants); |
|
68 |
-+int unit_add_node_link(Unit *u, const char *what, bool wants, UnitDependency d); |
|
69 |
- |
|
70 |
- int unit_coldplug(Unit *u); |
|
71 |
- |
|
72 |
- |
73 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,244 +0,0 @@ |
1 |
-This is a collection of the following fixes: |
|
2 |
-sd-ndisc: better validate RA packets - cddf4d8 |
|
3 |
-sd-ndisc: always send the link-layer address - 6d06ac1 |
|
4 |
-libsystemd-network: clean up recv functions - 0d43d2f |
|
5 |
-nd-ndisc: don't fail if src address is unset - d7fa438 |
|
6 |
-diff -ruN systemd-228/src/libsystemd-network/icmp6-util.c systemd-228-new/src/libsystemd-network/icmp6-util.c |
|
7 |
-+++ systemd-228-new/src/libsystemd-network/icmp6-util.c 2016-01-06 14:46:34.855095186 -0800 |
|
8 |
-@@ -47,17 +47,15 @@ |
|
9 |
- .ipv6mr_interface = index, |
|
10 |
- }; |
|
11 |
- _cleanup_close_ int s = -1; |
|
12 |
-- int r, zero = 0, hops = 255; |
|
13 |
-+ int r, zero = 0, one = 1, hops = 255; |
|
14 |
- |
|
15 |
-- s = socket(AF_INET6, SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK, |
|
16 |
-- IPPROTO_ICMPV6); |
|
17 |
-+ s = socket(AF_INET6, SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK, IPPROTO_ICMPV6); |
|
18 |
- if (s < 0) |
|
19 |
- return -errno; |
|
20 |
- |
|
21 |
- ICMP6_FILTER_SETBLOCKALL(&filter); |
|
22 |
- ICMP6_FILTER_SETPASS(ND_ROUTER_ADVERT, &filter); |
|
23 |
-- r = setsockopt(s, IPPROTO_ICMPV6, ICMP6_FILTER, &filter, |
|
24 |
-- sizeof(filter)); |
|
25 |
-+ r = setsockopt(s, IPPROTO_ICMPV6, ICMP6_FILTER, &filter, sizeof(filter)); |
|
26 |
- if (r < 0) |
|
27 |
- return -errno; |
|
28 |
- |
|
29 |
-@@ -65,23 +63,23 @@ |
|
30 |
- IPV6_PKTINFO socket option also applies for ICMPv6 multicast. |
|
31 |
- Empirical experiments indicates otherwise and therefore an |
|
32 |
- IPV6_MULTICAST_IF socket option is used here instead */ |
|
33 |
-- r = setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_IF, &index, |
|
34 |
-- sizeof(index)); |
|
35 |
-+ r = setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_IF, &index, sizeof(index)); |
|
36 |
- if (r < 0) |
|
37 |
- return -errno; |
|
38 |
- |
|
39 |
-- r = setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &zero, |
|
40 |
-- sizeof(zero)); |
|
41 |
-+ r = setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &zero, sizeof(zero)); |
|
42 |
- if (r < 0) |
|
43 |
- return -errno; |
|
44 |
- |
|
45 |
-- r = setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &hops, |
|
46 |
-- sizeof(hops)); |
|
47 |
-+ r = setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &hops, sizeof(hops)); |
|
48 |
- if (r < 0) |
|
49 |
- return -errno; |
|
50 |
- |
|
51 |
-- r = setsockopt(s, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq, |
|
52 |
-- sizeof(mreq)); |
|
53 |
-+ r = setsockopt(s, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); |
|
54 |
-+ if (r < 0) |
|
55 |
-+ return -errno; |
|
56 |
-+ |
|
57 |
-+ r = setsockopt(s, SOL_IPV6, IPV6_RECVHOPLIMIT, &one, sizeof(one)); |
|
58 |
- if (r < 0) |
|
59 |
- return -errno; |
|
60 |
- |
|
61 |
-@@ -101,25 +99,25 @@ |
|
62 |
- struct ether_addr rs_opt_mac; |
|
63 |
- } _packed_ rs = { |
|
64 |
- .rs.nd_rs_type = ND_ROUTER_SOLICIT, |
|
65 |
-+ .rs_opt.nd_opt_type = ND_OPT_SOURCE_LINKADDR, |
|
66 |
-+ .rs_opt.nd_opt_len = 1, |
|
67 |
- }; |
|
68 |
-- struct iovec iov[1] = { |
|
69 |
-- { &rs, }, |
|
70 |
-+ struct iovec iov = { |
|
71 |
-+ .iov_base = &rs, |
|
72 |
-+ .iov_len = sizeof(rs), |
|
73 |
- }; |
|
74 |
- struct msghdr msg = { |
|
75 |
- .msg_name = &dst, |
|
76 |
- .msg_namelen = sizeof(dst), |
|
77 |
-- .msg_iov = iov, |
|
78 |
-+ .msg_iov = &iov, |
|
79 |
- .msg_iovlen = 1, |
|
80 |
- }; |
|
81 |
- int r; |
|
82 |
- |
|
83 |
-- if (ether_addr) { |
|
84 |
-- memcpy(&rs.rs_opt_mac, ether_addr, ETH_ALEN); |
|
85 |
-- rs.rs_opt.nd_opt_type = ND_OPT_SOURCE_LINKADDR; |
|
86 |
-- rs.rs_opt.nd_opt_len = 1; |
|
87 |
-- iov[0].iov_len = sizeof(rs); |
|
88 |
-- } else |
|
89 |
-- iov[0].iov_len = sizeof(rs.rs); |
|
90 |
-+ assert(s >= 0); |
|
91 |
-+ assert(ether_addr); |
|
92 |
-+ |
|
93 |
-+ rs.rs_opt_mac = *ether_addr; |
|
94 |
- |
|
95 |
- r = sendmsg(s, &msg, 0); |
|
96 |
- if (r < 0) |
|
97 |
-diff -ruN systemd-228/src/libsystemd-network/sd-ndisc.c systemd-228-new/src/libsystemd-network/sd-ndisc.c |
|
98 |
-+++ systemd-228-new/src/libsystemd-network/sd-ndisc.c 2016-01-06 14:47:24.510383825 -0800 |
|
99 |
-@@ -32,6 +32,7 @@ |
|
100 |
- #include "in-addr-util.h" |
|
101 |
- #include "list.h" |
|
102 |
- #include "socket-util.h" |
|
103 |
-+#include "string-util.h" |
|
104 |
- |
|
105 |
- #define NDISC_ROUTER_SOLICITATION_INTERVAL 4 * USEC_PER_SEC |
|
106 |
- #define NDISC_MAX_ROUTER_SOLICITATIONS 3 |
|
107 |
-@@ -417,8 +418,7 @@ |
|
108 |
- return 0; |
|
109 |
- } |
|
110 |
- |
|
111 |
--static int ndisc_ra_parse(sd_ndisc *nd, struct nd_router_advert *ra, |
|
112 |
-- ssize_t len) { |
|
113 |
-+static int ndisc_ra_parse(sd_ndisc *nd, struct nd_router_advert *ra, ssize_t len) { |
|
114 |
- void *opt; |
|
115 |
- struct nd_opt_hdr *opt_hdr; |
|
116 |
- |
|
117 |
-@@ -481,30 +481,86 @@ |
|
118 |
- static int ndisc_router_advertisment_recv(sd_event_source *s, int fd, uint32_t revents, void *userdata) { |
|
119 |
- _cleanup_free_ struct nd_router_advert *ra = NULL; |
|
120 |
- sd_ndisc *nd = userdata; |
|
121 |
-- int r, buflen = 0, pref, stateful; |
|
122 |
-- union sockaddr_union router = {}; |
|
123 |
-- socklen_t router_len = sizeof(router); |
|
124 |
-+ union { |
|
125 |
-+ struct cmsghdr cmsghdr; |
|
126 |
-+ uint8_t buf[CMSG_LEN(sizeof(int))]; |
|
127 |
-+ } control = {}; |
|
128 |
-+ struct iovec iov = {}; |
|
129 |
-+ union sockaddr_union sa = {}; |
|
130 |
-+ struct msghdr msg = { |
|
131 |
-+ .msg_name = &sa.sa, |
|
132 |
-+ .msg_namelen = sizeof(sa), |
|
133 |
-+ .msg_iov = &iov, |
|
134 |
-+ .msg_iovlen = 1, |
|
135 |
-+ .msg_control = &control, |
|
136 |
-+ .msg_controllen = sizeof(control), |
|
137 |
-+ }; |
|
138 |
-+ struct cmsghdr *cmsg; |
|
139 |
-+ struct in6_addr *gw; |
|
140 |
- unsigned lifetime; |
|
141 |
- ssize_t len; |
|
142 |
-+ int r, pref, stateful, buflen = 0; |
|
143 |
- |
|
144 |
- assert(s); |
|
145 |
- assert(nd); |
|
146 |
- assert(nd->event); |
|
147 |
- |
|
148 |
- r = ioctl(fd, FIONREAD, &buflen); |
|
149 |
-- if (r < 0 || buflen <= 0) |
|
150 |
-- buflen = ICMP6_RECV_SIZE; |
|
151 |
-+ if (r < 0) |
|
152 |
-+ return -errno; |
|
153 |
-+ else if (buflen < 0) |
|
154 |
-+ /* This really should not happen */ |
|
155 |
-+ return -EIO; |
|
156 |
-+ |
|
157 |
-+ iov.iov_len = buflen; |
|
158 |
- |
|
159 |
-- ra = malloc(buflen); |
|
160 |
-+ ra = malloc(iov.iov_len); |
|
161 |
- if (!ra) |
|
162 |
- return -ENOMEM; |
|
163 |
- |
|
164 |
-- len = recvfrom(fd, ra, buflen, 0, &router.sa, &router_len); |
|
165 |
-+ iov.iov_base = ra; |
|
166 |
-+ |
|
167 |
-+ len = recvmsg(fd, &msg, 0); |
|
168 |
- if (len < 0) { |
|
169 |
-+ if (errno == EAGAIN || errno == EINTR) |
|
170 |
-+ return 0; |
|
171 |
-+ |
|
172 |
- log_ndisc(nd, "Could not receive message from ICMPv6 socket: %m"); |
|
173 |
-+ return -errno; |
|
174 |
-+ } else if ((size_t)len < sizeof(struct nd_router_advert)) { |
|
175 |
- return 0; |
|
176 |
-- } else if (router_len != sizeof(router.in6) && router_len != 0) { |
|
177 |
-- log_ndisc(nd, "Received invalid source address size from ICMPv6 socket: %zu bytes", (size_t)router_len); |
|
178 |
-+ } else if (msg.msg_namelen == 0) |
|
179 |
-+ gw = NULL; /* only happens when running the test-suite over a socketpair */ |
|
180 |
-+ else if (msg.msg_namelen != sizeof(sa.in6)) { |
|
181 |
-+ log_ndisc(nd, "Received invalid source address size from ICMPv6 socket: %zu bytes", (size_t)msg.msg_namelen); |
|
182 |
-+ return 0; |
|
183 |
-+ } else |
|
184 |
-+ gw = &sa.in6.sin6_addr; |
|
185 |
-+ |
|
186 |
-+ assert(!(msg.msg_flags & MSG_CTRUNC)); |
|
187 |
-+ assert(!(msg.msg_flags & MSG_TRUNC)); |
|
188 |
-+ |
|
189 |
-+ CMSG_FOREACH(cmsg, &msg) { |
|
190 |
-+ if (cmsg->cmsg_level == SOL_IPV6 && |
|
191 |
-+ cmsg->cmsg_type == IPV6_HOPLIMIT && |
|
192 |
-+ cmsg->cmsg_len == CMSG_LEN(sizeof(int))) { |
|
193 |
-+ int hops = *(int*)CMSG_DATA(cmsg); |
|
194 |
-+ |
|
195 |
-+ if (hops != 255) { |
|
196 |
-+ log_ndisc(nd, "Received RA with invalid hop limit %d. Ignoring.", hops); |
|
197 |
-+ return 0; |
|
198 |
-+ } |
|
199 |
-+ |
|
200 |
-+ break; |
|
201 |
-+ } |
|
202 |
-+ } |
|
203 |
-+ |
|
204 |
-+ if (gw && !in_addr_is_link_local(AF_INET6, (const union in_addr_union*) gw)) { |
|
205 |
-+ _cleanup_free_ char *addr = NULL; |
|
206 |
-+ |
|
207 |
-+ (void)in_addr_to_string(AF_INET6, (const union in_addr_union*) gw, &addr); |
|
208 |
-+ |
|
209 |
-+ log_ndisc(nd, "Received RA from non-link-local address %s. Ignoring.", strna(addr)); |
|
210 |
- return 0; |
|
211 |
- } |
|
212 |
- |
|
213 |
-@@ -544,7 +600,7 @@ |
|
214 |
- } |
|
215 |
- |
|
216 |
- if (nd->router_callback) |
|
217 |
-- nd->router_callback(nd, stateful, router_len != 0 ? &router.in6.sin6_addr : NULL, lifetime, pref, nd->userdata); |
|
218 |
-+ nd->router_callback(nd, stateful, gw, lifetime, pref, nd->userdata); |
|
219 |
- |
|
220 |
- return 0; |
|
221 |
- } |
|
222 |
-@@ -552,8 +608,6 @@ |
|
223 |
- static int ndisc_router_solicitation_timeout(sd_event_source *s, uint64_t usec, void *userdata) { |
|
224 |
- sd_ndisc *nd = userdata; |
|
225 |
- uint64_t time_now, next_timeout; |
|
226 |
-- struct ether_addr unset = { }; |
|
227 |
-- struct ether_addr *addr = NULL; |
|
228 |
- int r; |
|
229 |
- |
|
230 |
- assert(s); |
|
231 |
-@@ -567,10 +621,7 @@ |
|
232 |
- nd->callback(nd, SD_NDISC_EVENT_TIMEOUT, nd->userdata); |
|
233 |
- nd->state = NDISC_STATE_ADVERTISMENT_LISTEN; |
|
234 |
- } else { |
|
235 |
-- if (memcmp(&nd->mac_addr, &unset, sizeof(struct ether_addr))) |
|
236 |
-- addr = &nd->mac_addr; |
|
237 |
-- |
|
238 |
-- r = icmp6_send_router_solicitation(nd->fd, addr); |
|
239 |
-+ r = icmp6_send_router_solicitation(nd->fd, &nd->mac_addr); |
|
240 |
- if (r < 0) |
|
241 |
- log_ndisc(nd, "Error sending Router Solicitation"); |
|
242 |
- else { |
243 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,94 +0,0 @@ |
1 |
-From d830ebbdf67d8cb32d33d8fdd47cf467fd6d3815 Mon Sep 17 00:00:00 2001 |
|
2 |
-From: Lennart Poettering <lennart@poettering.net> |
|
3 |
-Date: Fri, 27 Nov 2015 00:41:32 +0100 |
|
4 |
-Subject: [PATCH] resolved: never cache RRs originating from localhost |
|
5 |
- |
|
6 |
-After all, this is likely a local DNS forwarder that caches anyway, |
|
7 |
-hence there's no point in caching twice. |
|
8 |
- |
|
9 |
-Fixes #2038. |
|
10 |
- src/basic/in-addr-util.c | 15 ++++++++++++++- |
|
11 |
- src/basic/in-addr-util.h | 1 + |
|
12 |
- src/resolve/resolved-dns-packet.h | 8 ++++++++ |
|
13 |
- src/resolve/resolved-dns-transaction.c | 3 ++- |
|
14 |
- 4 files changed, 25 insertions(+), 2 deletions(-) |
|
15 |
- |
|
16 |
-diff --git a/src/basic/in-addr-util.c b/src/basic/in-addr-util.c |
|
17 |
-index f4e2412..1f61b68 100644 |
|
18 |
-+++ b/src/basic/in-addr-util.c |
|
19 |
-@@ -44,7 +44,7 @@ int in_addr_is_link_local(int family, const union in_addr_union *u) { |
|
20 |
- assert(u); |
|
21 |
- |
|
22 |
- if (family == AF_INET) |
|
23 |
-- return (be32toh(u->in.s_addr) & 0xFFFF0000) == (169U << 24 | 254U << 16); |
|
24 |
-+ return (be32toh(u->in.s_addr) & UINT32_C(0xFFFF0000)) == (UINT32_C(169) << 24 | UINT32_C(254) << 16); |
|
25 |
- |
|
26 |
- if (family == AF_INET6) |
|
27 |
- return IN6_IS_ADDR_LINKLOCAL(&u->in6); |
|
28 |
-@@ -52,6 +52,19 @@ int in_addr_is_link_local(int family, const union in_addr_union *u) { |
|
29 |
- return -EAFNOSUPPORT; |
|
30 |
- } |
|
31 |
- |
|
32 |
-+int in_addr_is_localhost(int family, const union in_addr_union *u) { |
|
33 |
-+ assert(u); |
|
34 |
-+ |
|
35 |
-+ if (family == AF_INET) |
|
36 |
-+ /* All of 127.x.x.x is localhost. */ |
|
37 |
-+ return (be32toh(u->in.s_addr) & UINT32_C(0xFF000000)) == UINT32_C(127) << 24; |
|
38 |
-+ |
|
39 |
-+ if (family == AF_INET6) |
|
40 |
-+ return IN6_IS_ADDR_LOOPBACK(&u->in6); |
|
41 |
-+ |
|
42 |
-+ return -EAFNOSUPPORT; |
|
43 |
-+} |
|
44 |
-+ |
|
45 |
- int in_addr_equal(int family, const union in_addr_union *a, const union in_addr_union *b) { |
|
46 |
- assert(a); |
|
47 |
- assert(b); |
|
48 |
-diff --git a/src/basic/in-addr-util.h b/src/basic/in-addr-util.h |
|
49 |
-index 51af088..58f55b3 100644 |
|
50 |
-+++ b/src/basic/in-addr-util.h |
|
51 |
-@@ -33,6 +33,7 @@ union in_addr_union { |
|
52 |
- |
|
53 |
- int in_addr_is_null(int family, const union in_addr_union *u); |
|
54 |
- int in_addr_is_link_local(int family, const union in_addr_union *u); |
|
55 |
-+int in_addr_is_localhost(int family, const union in_addr_union *u); |
|
56 |
- int in_addr_equal(int family, const union in_addr_union *a, const union in_addr_union *b); |
|
57 |
- int in_addr_prefix_intersect(int family, const union in_addr_union *a, unsigned aprefixlen, const union in_addr_union *b, unsigned bprefixlen); |
|
58 |
- int in_addr_prefix_next(int family, union in_addr_union *u, unsigned prefixlen); |
|
59 |
-diff --git a/src/resolve/resolved-dns-packet.h b/src/resolve/resolved-dns-packet.h |
|
60 |
-index 48df5df..90b5a7c 100644 |
|
61 |
-+++ b/src/resolve/resolved-dns-packet.h |
|
62 |
-@@ -177,6 +177,14 @@ void dns_packet_rewind(DnsPacket *p, size_t idx); |
|
63 |
- int dns_packet_skip_question(DnsPacket *p); |
|
64 |
- int dns_packet_extract(DnsPacket *p); |
|
65 |
- |
|
66 |
-+static inline bool DNS_PACKET_SHALL_CACHE(DnsPacket *p) { |
|
67 |
-+ /* Never cache data originating from localhost, under the |
|
68 |
-+ * assumption, that it's coming from a locally DNS forwarder |
|
69 |
-+ * or server, that is caching on its own. */ |
|
70 |
-+ |
|
71 |
-+ return in_addr_is_localhost(p->family, &p->sender) == 0; |
|
72 |
-+} |
|
73 |
-+ |
|
74 |
- enum { |
|
75 |
- DNS_RCODE_SUCCESS = 0, |
|
76 |
- DNS_RCODE_FORMERR = 1, |
|
77 |
-diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c |
|
78 |
-index c65c9c9..8c4f23a 100644 |
|
79 |
-+++ b/src/resolve/resolved-dns-transaction.c |
|
80 |
-@@ -478,7 +478,8 @@ void dns_transaction_process_reply(DnsTransaction *t, DnsPacket *p) { |
|
81 |
- } |
|
82 |
- |
|
83 |
- /* According to RFC 4795, section 2.9. only the RRs from the answer section shall be cached */ |
|
84 |
-- dns_cache_put(&t->scope->cache, t->key, DNS_PACKET_RCODE(p), p->answer, DNS_PACKET_ANCOUNT(p), 0, p->family, &p->sender); |
|
85 |
-+ if (DNS_PACKET_SHALL_CACHE(p)) |
|
86 |
-+ dns_cache_put(&t->scope->cache, t->key, DNS_PACKET_RCODE(p), p->answer, DNS_PACKET_ANCOUNT(p), 0, p->family, &p->sender); |
|
87 |
- |
|
88 |
- if (DNS_PACKET_RCODE(p) == DNS_RCODE_SUCCESS) |
|
89 |
- dns_transaction_complete(t, DNS_TRANSACTION_SUCCESS); |
90 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,15 +0,0 @@ |
1 |
-+++ b/src/login/systemd-user.m4 2016-05-17 13:42:15.575836209 -0700 |
|
2 |
-@@ -2,10 +2,10 @@ |
|
3 |
- # |
|
4 |
- # Used by systemd --user instances. |
|
5 |
- |
|
6 |
--account include system-auth |
|
7 |
-+account include system-account |
|
8 |
- |
|
9 |
- m4_ifdef(`HAVE_SELINUX', |
|
10 |
- session required pam_selinux.so close |
|
11 |
- session required pam_selinux.so nottys open |
|
12 |
- )m4_dnl |
|
13 |
--session include system-auth |
|
14 |
-+session include system-session |
15 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,396 +0,0 @@ |
1 |
-From f693e9b38f13575b988335e3324a50dcc8772d48 Mon Sep 17 00:00:00 2001 |
|
2 |
-From: Tom Gundersen <teg@jklm.no> |
|
3 |
-Date: Wed, 25 Nov 2015 17:29:30 +0100 |
|
4 |
-Subject: [PATCH] sd-dhcp: parse error message in DECLINE or NAK |
|
5 |
- |
|
6 |
-If a client sends a DECLINE or a server sends a NAK, they can include |
|
7 |
-a string with a message to explain the error. Parse this and print it |
|
8 |
-at debug level. |
|
9 |
- src/libsystemd-network/dhcp-internal.h | 3 +- |
|
10 |
- src/libsystemd-network/dhcp-option.c | 109 +++++++++++++++++------------- |
|
11 |
- src/libsystemd-network/dhcp-protocol.h | 1 + |
|
12 |
- src/libsystemd-network/sd-dhcp-client.c | 9 +-- |
|
13 |
- src/libsystemd-network/sd-dhcp-lease.c | 2 +- |
|
14 |
- src/libsystemd-network/sd-dhcp-server.c | 6 +- |
|
15 |
- src/libsystemd-network/test-dhcp-client.c | 6 +- |
|
16 |
- src/libsystemd-network/test-dhcp-option.c | 22 ++---- |
|
17 |
- 8 files changed, 84 insertions(+), 74 deletions(-) |
|
18 |
- |
|
19 |
-diff --git a/src/libsystemd-network/dhcp-internal.h b/src/libsystemd-network/dhcp-internal.h |
|
20 |
-index a5daaa5..7038212 100644 |
|
21 |
-+++ b/src/libsystemd-network/dhcp-internal.h |
|
22 |
-@@ -47,8 +47,7 @@ int dhcp_option_append(DHCPMessage *message, size_t size, size_t *offset, uint8_ |
|
23 |
- typedef int (*dhcp_option_cb_t)(uint8_t code, uint8_t len, |
|
24 |
- const void *option, void *userdata); |
|
25 |
- |
|
26 |
--int dhcp_option_parse(DHCPMessage *message, size_t len, |
|
27 |
-- dhcp_option_cb_t cb, void *userdata); |
|
28 |
-+int dhcp_option_parse(DHCPMessage *message, size_t len, dhcp_option_cb_t cb, void *userdata, char **error_message); |
|
29 |
- |
|
30 |
- int dhcp_message_init(DHCPMessage *message, uint8_t op, uint32_t xid, |
|
31 |
- uint8_t type, uint16_t arp_type, size_t optlen, |
|
32 |
-diff --git a/src/libsystemd-network/dhcp-option.c b/src/libsystemd-network/dhcp-option.c |
|
33 |
-index a6c410b..1de7f36 100644 |
|
34 |
-+++ b/src/libsystemd-network/dhcp-option.c |
|
35 |
-@@ -24,6 +24,9 @@ |
|
36 |
- #include <stdio.h> |
|
37 |
- #include <string.h> |
|
38 |
- |
|
39 |
-+#include "alloc-util.h" |
|
40 |
-+#include "utf8.h" |
|
41 |
-+ |
|
42 |
- #include "dhcp-internal.h" |
|
43 |
- |
|
44 |
- static int option_append(uint8_t options[], size_t size, size_t *offset, |
|
45 |
-@@ -139,72 +142,84 @@ int dhcp_option_append(DHCPMessage *message, size_t size, size_t *offset, |
|
46 |
- } |
|
47 |
- |
|
48 |
- static int parse_options(const uint8_t options[], size_t buflen, uint8_t *overload, |
|
49 |
-- uint8_t *message_type, dhcp_option_cb_t cb, |
|
50 |
-+ uint8_t *message_type, char **error_message, dhcp_option_cb_t cb, |
|
51 |
- void *userdata) { |
|
52 |
- uint8_t code, len; |
|
53 |
-+ const uint8_t *option; |
|
54 |
- size_t offset = 0; |
|
55 |
- |
|
56 |
- while (offset < buflen) { |
|
57 |
-- switch (options[offset]) { |
|
58 |
-- case DHCP_OPTION_PAD: |
|
59 |
-- offset++; |
|
60 |
-+ code = options[offset ++]; |
|
61 |
- |
|
62 |
-- break; |
|
63 |
-+ switch (code) { |
|
64 |
-+ case DHCP_OPTION_PAD: |
|
65 |
-+ continue; |
|
66 |
- |
|
67 |
- case DHCP_OPTION_END: |
|
68 |
- return 0; |
|
69 |
-+ } |
|
70 |
- |
|
71 |
-- case DHCP_OPTION_MESSAGE_TYPE: |
|
72 |
-- if (buflen < offset + 3) |
|
73 |
-- return -ENOBUFS; |
|
74 |
-+ if (buflen < offset + 1) |
|
75 |
-+ return -ENOBUFS; |
|
76 |
-+ |
|
77 |
-+ len = options[offset ++]; |
|
78 |
- |
|
79 |
-- len = options[++offset]; |
|
80 |
-+ if (buflen < offset + len) |
|
81 |
-+ return -EINVAL; |
|
82 |
-+ |
|
83 |
-+ option = &options[offset]; |
|
84 |
-+ |
|
85 |
-+ switch (code) { |
|
86 |
-+ case DHCP_OPTION_MESSAGE_TYPE: |
|
87 |
- if (len != 1) |
|
88 |
- return -EINVAL; |
|
89 |
- |
|
90 |
- if (message_type) |
|
91 |
-- *message_type = options[++offset]; |
|
92 |
-- else |
|
93 |
-- offset++; |
|
94 |
-- |
|
95 |
-- offset++; |
|
96 |
-+ *message_type = *option; |
|
97 |
- |
|
98 |
- break; |
|
99 |
- |
|
100 |
-- case DHCP_OPTION_OVERLOAD: |
|
101 |
-- if (buflen < offset + 3) |
|
102 |
-- return -ENOBUFS; |
|
103 |
-- |
|
104 |
-- len = options[++offset]; |
|
105 |
-- if (len != 1) |
|
106 |
-+ case DHCP_OPTION_ERROR_MESSAGE: |
|
107 |
-+ if (len == 0) |
|
108 |
- return -EINVAL; |
|
109 |
- |
|
110 |
-- if (overload) |
|
111 |
-- *overload = options[++offset]; |
|
112 |
-- else |
|
113 |
-- offset++; |
|
114 |
-+ if (error_message) { |
|
115 |
-+ _cleanup_free_ char *string = NULL; |
|
116 |
- |
|
117 |
-- offset++; |
|
118 |
-+ /* Accept a trailing NUL byte */ |
|
119 |
-+ if (memchr(option, 0, len - 1)) |
|
120 |
-+ return -EINVAL; |
|
121 |
- |
|
122 |
-- break; |
|
123 |
-+ string = strndup((const char *) option, len); |
|
124 |
-+ if (!string) |
|
125 |
-+ return -ENOMEM; |
|
126 |
- |
|
127 |
-- default: |
|
128 |
-- if (buflen < offset + 3) |
|
129 |
-- return -ENOBUFS; |
|
130 |
-+ if (!ascii_is_valid(string)) |
|
131 |
-+ return -EINVAL; |
|
132 |
- |
|
133 |
-- code = options[offset]; |
|
134 |
-- len = options[++offset]; |
|
135 |
-+ free(*error_message); |
|
136 |
-+ *error_message = string; |
|
137 |
-+ string = NULL; |
|
138 |
-+ } |
|
139 |
- |
|
140 |
-- if (buflen < ++offset + len) |
|
141 |
-+ break; |
|
142 |
-+ case DHCP_OPTION_OVERLOAD: |
|
143 |
-+ if (len != 1) |
|
144 |
- return -EINVAL; |
|
145 |
- |
|
146 |
-- if (cb) |
|
147 |
-- cb(code, len, &options[offset], userdata); |
|
148 |
-+ if (overload) |
|
149 |
-+ *overload = *option; |
|
150 |
- |
|
151 |
-- offset += len; |
|
152 |
-+ break; |
|
153 |
-+ |
|
154 |
-+ default: |
|
155 |
-+ if (cb) |
|
156 |
-+ cb(code, len, option, userdata); |
|
157 |
- |
|
158 |
- break; |
|
159 |
- } |
|
160 |
-+ |
|
161 |
-+ offset += len; |
|
162 |
- } |
|
163 |
- |
|
164 |
- if (offset < buflen) |
|
165 |
-@@ -213,8 +228,8 @@ static int parse_options(const uint8_t options[], size_t buflen, uint8_t *overlo |
|
166 |
- return 0; |
|
167 |
- } |
|
168 |
- |
|
169 |
--int dhcp_option_parse(DHCPMessage *message, size_t len, |
|
170 |
-- dhcp_option_cb_t cb, void *userdata) { |
|
171 |
-+int dhcp_option_parse(DHCPMessage *message, size_t len, dhcp_option_cb_t cb, void *userdata, char **_error_message) { |
|
172 |
-+ _cleanup_free_ char *error_message = NULL; |
|
173 |
- uint8_t overload = 0; |
|
174 |
- uint8_t message_type = 0; |
|
175 |
- int r; |
|
176 |
-@@ -227,27 +242,29 @@ int dhcp_option_parse(DHCPMessage *message, size_t len, |
|
177 |
- |
|
178 |
- len -= sizeof(DHCPMessage); |
|
179 |
- |
|
180 |
-- r = parse_options(message->options, len, &overload, &message_type, |
|
181 |
-- cb, userdata); |
|
182 |
-+ r = parse_options(message->options, len, &overload, &message_type, &error_message, cb, userdata); |
|
183 |
- if (r < 0) |
|
184 |
- return r; |
|
185 |
- |
|
186 |
- if (overload & DHCP_OVERLOAD_FILE) { |
|
187 |
-- r = parse_options(message->file, sizeof(message->file), |
|
188 |
-- NULL, &message_type, cb, userdata); |
|
189 |
-+ r = parse_options(message->file, sizeof(message->file), NULL, &message_type, &error_message, cb, userdata); |
|
190 |
- if (r < 0) |
|
191 |
- return r; |
|
192 |
- } |
|
193 |
- |
|
194 |
- if (overload & DHCP_OVERLOAD_SNAME) { |
|
195 |
-- r = parse_options(message->sname, sizeof(message->sname), |
|
196 |
-- NULL, &message_type, cb, userdata); |
|
197 |
-+ r = parse_options(message->sname, sizeof(message->sname), NULL, &message_type, &error_message, cb, userdata); |
|
198 |
- if (r < 0) |
|
199 |
- return r; |
|
200 |
- } |
|
201 |
- |
|
202 |
-- if (message_type) |
|
203 |
-- return message_type; |
|
204 |
-+ if (message_type == 0) |
|
205 |
-+ return -ENOMSG; |
|
206 |
-+ |
|
207 |
-+ if (_error_message && IN_SET(message_type, DHCP_NAK, DHCP_DECLINE)) { |
|
208 |
-+ *_error_message = error_message; |
|
209 |
-+ error_message = NULL; |
|
210 |
-+ } |
|
211 |
- |
|
212 |
-- return -ENOMSG; |
|
213 |
-+ return message_type; |
|
214 |
- } |
|
215 |
-diff --git a/src/libsystemd-network/dhcp-protocol.h b/src/libsystemd-network/dhcp-protocol.h |
|
216 |
-index 05bb5ae..f65529a 100644 |
|
217 |
-+++ b/src/libsystemd-network/dhcp-protocol.h |
|
218 |
-@@ -132,6 +132,7 @@ enum { |
|
219 |
- DHCP_OPTION_MESSAGE_TYPE = 53, |
|
220 |
- DHCP_OPTION_SERVER_IDENTIFIER = 54, |
|
221 |
- DHCP_OPTION_PARAMETER_REQUEST_LIST = 55, |
|
222 |
-+ DHCP_OPTION_ERROR_MESSAGE = 56, |
|
223 |
- DHCP_OPTION_MAXIMUM_MESSAGE_SIZE = 57, |
|
224 |
- DHCP_OPTION_RENEWAL_T1_TIME = 58, |
|
225 |
- DHCP_OPTION_REBINDING_T2_TIME = 59, |
|
226 |
-diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c |
|
227 |
-index 66b8f10..d116180 100644 |
|
228 |
-+++ b/src/libsystemd-network/sd-dhcp-client.c |
|
229 |
-@@ -1082,7 +1082,7 @@ static int client_handle_offer(sd_dhcp_client *client, DHCPMessage *offer, |
|
230 |
- return r; |
|
231 |
- } |
|
232 |
- |
|
233 |
-- r = dhcp_option_parse(offer, len, dhcp_lease_parse_options, lease); |
|
234 |
-+ r = dhcp_option_parse(offer, len, dhcp_lease_parse_options, lease, NULL); |
|
235 |
- if (r != DHCP_OFFER) { |
|
236 |
- log_dhcp_client(client, "received message was not an OFFER, ignoring"); |
|
237 |
- return -ENOMSG; |
|
238 |
-@@ -1121,7 +1121,7 @@ static int client_handle_forcerenew(sd_dhcp_client *client, DHCPMessage *force, |
|
239 |
- size_t len) { |
|
240 |
- int r; |
|
241 |
- |
|
242 |
-- r = dhcp_option_parse(force, len, NULL, NULL); |
|
243 |
-+ r = dhcp_option_parse(force, len, NULL, NULL, NULL); |
|
244 |
- if (r != DHCP_FORCERENEW) |
|
245 |
- return -ENOMSG; |
|
246 |
- |
|
247 |
-@@ -1133,6 +1133,7 @@ static int client_handle_forcerenew(sd_dhcp_client *client, DHCPMessage *force, |
|
248 |
- static int client_handle_ack(sd_dhcp_client *client, DHCPMessage *ack, |
|
249 |
- size_t len) { |
|
250 |
- _cleanup_dhcp_lease_unref_ sd_dhcp_lease *lease = NULL; |
|
251 |
-+ _cleanup_free_ char *error_message = NULL; |
|
252 |
- int r; |
|
253 |
- |
|
254 |
- r = dhcp_lease_new(&lease); |
|
255 |
-@@ -1147,9 +1148,9 @@ static int client_handle_ack(sd_dhcp_client *client, DHCPMessage *ack, |
|
256 |
- return r; |
|
257 |
- } |
|
258 |
- |
|
259 |
-- r = dhcp_option_parse(ack, len, dhcp_lease_parse_options, lease); |
|
260 |
-+ r = dhcp_option_parse(ack, len, dhcp_lease_parse_options, lease, &error_message); |
|
261 |
- if (r == DHCP_NAK) { |
|
262 |
-- log_dhcp_client(client, "NAK"); |
|
263 |
-+ log_dhcp_client(client, "NAK: %s", strna(error_message)); |
|
264 |
- return -EADDRNOTAVAIL; |
|
265 |
- } |
|
266 |
- |
|
267 |
-diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c |
|
268 |
-index 8befedc..fccdc01 100644 |
|
269 |
-+++ b/src/libsystemd-network/sd-dhcp-lease.c |
|
270 |
-@@ -661,7 +661,7 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const void *option, void |
|
271 |
- break; |
|
272 |
- |
|
273 |
- default: |
|
274 |
-- log_debug("Ignoring option DHCP option %i while parsing.", code); |
|
275 |
-+ log_debug("Ignoring option DHCP option %"PRIu8" while parsing.", code); |
|
276 |
- break; |
|
277 |
- } |
|
278 |
- |
|
279 |
-diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c |
|
280 |
-index 3e2ecda..587ff93 100644 |
|
281 |
-+++ b/src/libsystemd-network/sd-dhcp-server.c |
|
282 |
-@@ -699,6 +699,7 @@ static int get_pool_offset(sd_dhcp_server *server, be32_t requested_ip) { |
|
283 |
- int dhcp_server_handle_message(sd_dhcp_server *server, DHCPMessage *message, |
|
284 |
- size_t length) { |
|
285 |
- _cleanup_dhcp_request_free_ DHCPRequest *req = NULL; |
|
286 |
-+ _cleanup_free_ char *error_message = NULL; |
|
287 |
- DHCPLease *existing_lease; |
|
288 |
- int type, r; |
|
289 |
- |
|
290 |
-@@ -714,7 +715,7 @@ int dhcp_server_handle_message(sd_dhcp_server *server, DHCPMessage *message, |
|
291 |
- if (!req) |
|
292 |
- return -ENOMEM; |
|
293 |
- |
|
294 |
-- type = dhcp_option_parse(message, length, parse_request, req); |
|
295 |
-+ type = dhcp_option_parse(message, length, parse_request, req, &error_message); |
|
296 |
- if (type < 0) |
|
297 |
- return 0; |
|
298 |
- |
|
299 |
-@@ -784,8 +785,7 @@ int dhcp_server_handle_message(sd_dhcp_server *server, DHCPMessage *message, |
|
300 |
- break; |
|
301 |
- } |
|
302 |
- case DHCP_DECLINE: |
|
303 |
-- log_dhcp_server(server, "DECLINE (0x%x)", |
|
304 |
-- be32toh(req->message->xid)); |
|
305 |
-+ log_dhcp_server(server, "DECLINE (0x%x): %s", be32toh(req->message->xid), strna(error_message)); |
|
306 |
- |
|
307 |
- /* TODO: make sure we don't offer this address again */ |
|
308 |
- |
|
309 |
-diff --git a/src/libsystemd-network/test-dhcp-client.c b/src/libsystemd-network/test-dhcp-client.c |
|
310 |
-index 1200a7c..4478147 100644 |
|
311 |
-+++ b/src/libsystemd-network/test-dhcp-client.c |
|
312 |
-@@ -223,7 +223,7 @@ int dhcp_network_send_udp_socket(int s, be32_t address, uint16_t port, const voi |
|
313 |
- static int test_discover_message_verify(size_t size, struct DHCPMessage *dhcp) { |
|
314 |
- int res; |
|
315 |
- |
|
316 |
-- res = dhcp_option_parse(dhcp, size, check_options, NULL); |
|
317 |
-+ res = dhcp_option_parse(dhcp, size, check_options, NULL, NULL); |
|
318 |
- assert_se(res == DHCP_DISCOVER); |
|
319 |
- |
|
320 |
- if (verbose) |
|
321 |
-@@ -390,7 +390,7 @@ static int test_addr_acq_recv_request(size_t size, DHCPMessage *request) { |
|
322 |
- uint8_t *msg_bytes = (uint8_t *)request; |
|
323 |
- int res; |
|
324 |
- |
|
325 |
-- res = dhcp_option_parse(request, size, check_options, NULL); |
|
326 |
-+ res = dhcp_option_parse(request, size, check_options, NULL, NULL); |
|
327 |
- assert_se(res == DHCP_REQUEST); |
|
328 |
- assert_se(xid == request->xid); |
|
329 |
- |
|
330 |
-@@ -420,7 +420,7 @@ static int test_addr_acq_recv_discover(size_t size, DHCPMessage *discover) { |
|
331 |
- uint8_t *msg_bytes = (uint8_t *)discover; |
|
332 |
- int res; |
|
333 |
- |
|
334 |
-- res = dhcp_option_parse(discover, size, check_options, NULL); |
|
335 |
-+ res = dhcp_option_parse(discover, size, check_options, NULL, NULL); |
|
336 |
- assert_se(res == DHCP_DISCOVER); |
|
337 |
- |
|
338 |
- assert_se(msg_bytes[size - 1] == DHCP_OPTION_END); |
|
339 |
-diff --git a/src/libsystemd-network/test-dhcp-option.c b/src/libsystemd-network/test-dhcp-option.c |
|
340 |
-index 3607df6..75d22c4 100644 |
|
341 |
-+++ b/src/libsystemd-network/test-dhcp-option.c |
|
342 |
-@@ -75,9 +75,8 @@ static const char *dhcp_type(int type) { |
|
343 |
- static void test_invalid_buffer_length(void) { |
|
344 |
- DHCPMessage message; |
|
345 |
- |
|
346 |
-- assert_se(dhcp_option_parse(&message, 0, NULL, NULL) == -EINVAL); |
|
347 |
-- assert_se(dhcp_option_parse(&message, sizeof(DHCPMessage) - 1, NULL, NULL) |
|
348 |
-- == -EINVAL); |
|
349 |
-+ assert_se(dhcp_option_parse(&message, 0, NULL, NULL, NULL) == -EINVAL); |
|
350 |
-+ assert_se(dhcp_option_parse(&message, sizeof(DHCPMessage) - 1, NULL, NULL, NULL) == -EINVAL); |
|
351 |
- } |
|
352 |
- |
|
353 |
- static void test_message_init(void) { |
|
354 |
-@@ -101,7 +100,7 @@ static void test_message_init(void) { |
|
355 |
- assert_se(magic[2] == 83); |
|
356 |
- assert_se(magic[3] == 99); |
|
357 |
- |
|
358 |
-- assert_se(dhcp_option_parse(message, len, NULL, NULL) >= 0); |
|
359 |
-+ assert_se(dhcp_option_parse(message, len, NULL, NULL, NULL) >= 0); |
|
360 |
- } |
|
361 |
- |
|
362 |
- static DHCPMessage *create_message(uint8_t *options, uint16_t optlen, |
|
363 |
-@@ -264,19 +263,12 @@ static void test_options(struct option_desc *desc) { |
|
364 |
- buflen = sizeof(DHCPMessage) + optlen; |
|
365 |
- |
|
366 |
- if (!desc) { |
|
367 |
-- assert_se((res = dhcp_option_parse(message, buflen, |
|
368 |
-- test_options_cb, |
|
369 |
-- NULL)) == -ENOMSG); |
|
370 |
-+ assert_se((res = dhcp_option_parse(message, buflen, test_options_cb, NULL, NULL)) == -ENOMSG); |
|
371 |
- } else if (desc->success) { |
|
372 |
-- assert_se((res = dhcp_option_parse(message, buflen, |
|
373 |
-- test_options_cb, |
|
374 |
-- desc)) >= 0); |
|
375 |
-- assert_se(desc->pos == -1 && desc->filepos == -1 && |
|
376 |
-- desc->snamepos == -1); |
|
377 |
-+ assert_se((res = dhcp_option_parse(message, buflen, test_options_cb, desc, NULL)) >= 0); |
|
378 |
-+ assert_se(desc->pos == -1 && desc->filepos == -1 && desc->snamepos == -1); |
|
379 |
- } else |
|
380 |
-- assert_se((res = dhcp_option_parse(message, buflen, |
|
381 |
-- test_options_cb, |
|
382 |
-- desc)) < 0); |
|
383 |
-+ assert_se((res = dhcp_option_parse(message, buflen, test_options_cb, desc, NULL)) < 0); |
|
384 |
- |
|
385 |
- if (verbose) |
|
386 |
- printf("DHCP type %s\n", dhcp_type(res)); |
|
387 |
- |
388 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,460 +0,0 @@ |
1 |
-diff -uNr systemd-228/src/libsystemd/sd-network/sd-network.c systemd-228-query-duid/src/libsystemd/sd-network/sd-network.c |
|
2 |
-+++ systemd-228-query-duid/src/libsystemd/sd-network/sd-network.c 2016-04-01 00:28:06.272671837 +0000 |
|
3 |
-@@ -297,6 +297,51 @@ |
|
4 |
- return network_get_link_strv("CARRIER_BOUND_BY", ifindex, ret); |
|
5 |
- } |
|
6 |
- |
|
7 |
-+static int network_get_file_str(const char *key, const char *fpath, int ifindex, char **ret) { |
|
8 |
-+ _cleanup_free_ char *p = NULL, *s = NULL; |
|
9 |
-+ int r; |
|
10 |
-+ |
|
11 |
-+ assert_return(ifindex > 0, -EINVAL); |
|
12 |
-+ assert_return(fpath, -EINVAL); |
|
13 |
-+ assert_return(ret, -EINVAL); |
|
14 |
-+ |
|
15 |
-+ if (asprintf(&p, "%s/%d", fpath, ifindex) < 0) |
|
16 |
-+ return -ENOMEM; |
|
17 |
-+ |
|
18 |
-+ r = parse_env_file(p, NEWLINE, key, &s, NULL); |
|
19 |
-+ if (r == -ENOENT) |
|
20 |
-+ return -ENODATA; |
|
21 |
-+ if (r < 0) |
|
22 |
-+ return r; |
|
23 |
-+ if (isempty(s)) |
|
24 |
-+ return -ENODATA; |
|
25 |
-+ |
|
26 |
-+ *ret = s; |
|
27 |
-+ s = NULL; |
|
28 |
-+ return 0; |
|
29 |
-+} |
|
30 |
-+ |
|
31 |
-+_public_ int sd_network_link_get_clientid(int ifindex, char **clientid) { |
|
32 |
-+ return network_get_file_str("CLIENTID", |
|
33 |
-+ "/run/systemd/netif/leases", |
|
34 |
-+ ifindex, |
|
35 |
-+ clientid); |
|
36 |
-+} |
|
37 |
-+ |
|
38 |
-+_public_ int sd_network_link_get_iaid(int ifindex, char **iaid) { |
|
39 |
-+ return network_get_file_str("IAID", |
|
40 |
-+ "/run/systemd/netif/leases6", |
|
41 |
-+ ifindex, |
|
42 |
-+ iaid); |
|
43 |
-+} |
|
44 |
-+ |
|
45 |
-+_public_ int sd_network_link_get_duid(int ifindex, char **duid) { |
|
46 |
-+ return network_get_file_str("DUID", |
|
47 |
-+ "/run/systemd/netif/leases6", |
|
48 |
-+ ifindex, |
|
49 |
-+ duid); |
|
50 |
-+} |
|
51 |
-+ |
|
52 |
- _public_ int sd_network_link_get_wildcard_domain(int ifindex) { |
|
53 |
- int r; |
|
54 |
- _cleanup_free_ char *p = NULL, *s = NULL; |
|
55 |
-diff -uNr systemd-228/src/libsystemd-network/dhcp6-lease-internal.h systemd-228-query-duid/src/libsystemd-network/dhcp6-lease-internal.h |
|
56 |
-+++ systemd-228-query-duid/src/libsystemd-network/dhcp6-lease-internal.h 2016-04-01 00:33:09.083805301 +0000 |
|
57 |
-@@ -25,6 +25,7 @@ |
|
58 |
- #include <stdint.h> |
|
59 |
- |
|
60 |
- #include "sd-dhcp6-lease.h" |
|
61 |
-+#include "dhcp-identifier.h" |
|
62 |
- #include "dhcp6-internal.h" |
|
63 |
- |
|
64 |
- struct sd_dhcp6_lease { |
|
65 |
-@@ -36,6 +37,8 @@ |
|
66 |
- bool rapid_commit; |
|
67 |
- |
|
68 |
- DHCP6IA ia; |
|
69 |
-+ struct duid *duid; |
|
70 |
-+ size_t duid_len; |
|
71 |
- |
|
72 |
- DHCP6Address *addr_iter; |
|
73 |
- |
|
74 |
-@@ -64,6 +67,7 @@ |
|
75 |
- int dhcp6_lease_get_rapid_commit(sd_dhcp6_lease *lease, bool *rapid_commit); |
|
76 |
- |
|
77 |
- int dhcp6_lease_get_iaid(sd_dhcp6_lease *lease, be32_t *iaid); |
|
78 |
-+int dhcp6_lease_set_duid(sd_dhcp6_lease *lease, struct duid *duid, size_t duid_len); |
|
79 |
- |
|
80 |
- int dhcp6_lease_set_dns(sd_dhcp6_lease *lease, uint8_t *optval, size_t optlen); |
|
81 |
- int dhcp6_lease_set_domains(sd_dhcp6_lease *lease, uint8_t *optval, |
|
82 |
-@@ -74,5 +78,7 @@ |
|
83 |
- |
|
84 |
- int dhcp6_lease_new(sd_dhcp6_lease **ret); |
|
85 |
- |
|
86 |
-+int dhcp6_lease_save(sd_dhcp6_lease *lease, const char *lease_file); |
|
87 |
-+ |
|
88 |
- DEFINE_TRIVIAL_CLEANUP_FUNC(sd_dhcp6_lease*, sd_dhcp6_lease_unref); |
|
89 |
- #define _cleanup_dhcp6_lease_free_ _cleanup_(sd_dhcp6_lease_unrefp) |
|
90 |
-diff -uNr systemd-228/src/libsystemd-network/sd-dhcp6-client.c systemd-228-query-duid/src/libsystemd-network/sd-dhcp6-client.c |
|
91 |
-+++ systemd-228-query-duid/src/libsystemd-network/sd-dhcp6-client.c 2016-04-01 07:27:44.868086900 +0000 |
|
92 |
-@@ -202,6 +202,23 @@ |
|
93 |
- return 0; |
|
94 |
- } |
|
95 |
- |
|
96 |
-+int sd_dhcp6_client_get_duid(sd_dhcp6_client *client, uint16_t *duid_type, |
|
97 |
-+ const uint8_t **duid, size_t *duid_len) { |
|
98 |
-+ assert_return(client, -EINVAL); |
|
99 |
-+ assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY); |
|
100 |
-+ |
|
101 |
-+ *duid_type = 0; |
|
102 |
-+ *duid_len = 0; |
|
103 |
-+ *duid = NULL; |
|
104 |
-+ if (client->duid_len > 0) { |
|
105 |
-+ *duid_type = be16toh(client->duid.type); |
|
106 |
-+ *duid_len = client->duid_len - sizeof(client->duid.type); |
|
107 |
-+ *duid = client->duid.raw.data; |
|
108 |
-+ } |
|
109 |
-+ |
|
110 |
-+ return 0; |
|
111 |
-+} |
|
112 |
-+ |
|
113 |
- int sd_dhcp6_client_set_iaid(sd_dhcp6_client *client, uint32_t iaid) { |
|
114 |
- assert_return(client, -EINVAL); |
|
115 |
- assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY); |
|
116 |
-@@ -211,6 +228,14 @@ |
|
117 |
- return 0; |
|
118 |
- } |
|
119 |
- |
|
120 |
-+int sd_dhcp6_client_get_iaid(sd_dhcp6_client *client, uint32_t *iaid) { |
|
121 |
-+ assert_return(client, -EINVAL); |
|
122 |
-+ |
|
123 |
-+ *iaid = be32toh(client->ia_na.id); |
|
124 |
-+ |
|
125 |
-+ return 0; |
|
126 |
-+} |
|
127 |
-+ |
|
128 |
- int sd_dhcp6_client_set_information_request(sd_dhcp6_client *client, int enabled) { |
|
129 |
- assert_return(client, -EINVAL); |
|
130 |
- assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY); |
|
131 |
-@@ -746,6 +771,10 @@ |
|
132 |
- if (r < 0 && r != -ENOMSG) |
|
133 |
- return r; |
|
134 |
- |
|
135 |
-+ r = dhcp6_lease_set_duid(lease, &client->duid, client->duid_len); |
|
136 |
-+ if (r < 0) |
|
137 |
-+ return r; |
|
138 |
-+ |
|
139 |
- r = dhcp6_lease_get_iaid(lease, &iaid_lease); |
|
140 |
- if (r < 0) |
|
141 |
- return r; |
|
142 |
-diff -uNr systemd-228/src/libsystemd-network/sd-dhcp6-lease.c systemd-228-query-duid/src/libsystemd-network/sd-dhcp6-lease.c |
|
143 |
-+++ systemd-228-query-duid/src/libsystemd-network/sd-dhcp6-lease.c 2016-04-01 07:27:03.013301683 +0000 |
|
144 |
-@@ -20,14 +20,19 @@ |
|
145 |
- along with systemd; If not, see <http://www.gnu.org/licenses/>. |
|
146 |
- ***/ |
|
147 |
- |
|
148 |
-+#include <arpa/inet.h> |
|
149 |
- #include <errno.h> |
|
150 |
- |
|
151 |
- #include "alloc-util.h" |
|
152 |
- #include "dhcp6-lease-internal.h" |
|
153 |
- #include "dhcp6-protocol.h" |
|
154 |
-+#include "fd-util.h" |
|
155 |
-+#include "fileio.h" |
|
156 |
-+#include "hexdecoct.h" |
|
157 |
- #include "strv.h" |
|
158 |
- #include "util.h" |
|
159 |
- |
|
160 |
-+ |
|
161 |
- int dhcp6_lease_clear_timers(DHCP6IA *ia) { |
|
162 |
- assert_return(ia, -EINVAL); |
|
163 |
- |
|
164 |
-@@ -150,6 +155,15 @@ |
|
165 |
- return 0; |
|
166 |
- } |
|
167 |
- |
|
168 |
-+int dhcp6_lease_set_duid(sd_dhcp6_lease *lease, struct duid *duid, size_t duid_len) { |
|
169 |
-+ assert_return(lease, -EINVAL); |
|
170 |
-+ assert_return(duid, -EINVAL); |
|
171 |
-+ |
|
172 |
-+ lease->duid = duid; |
|
173 |
-+ lease->duid_len = duid_len; |
|
174 |
-+ return 0; |
|
175 |
-+} |
|
176 |
-+ |
|
177 |
- int sd_dhcp6_lease_get_address(sd_dhcp6_lease *lease, struct in6_addr *addr, |
|
178 |
- uint32_t *lifetime_preferred, |
|
179 |
- uint32_t *lifetime_valid) { |
|
180 |
-@@ -410,3 +424,74 @@ |
|
181 |
- *ret = lease; |
|
182 |
- return 0; |
|
183 |
- } |
|
184 |
-+ |
|
185 |
-+int dhcp6_lease_save(sd_dhcp6_lease *lease, const char *lease_file) { |
|
186 |
-+ _cleanup_free_ char *temp_path = NULL; |
|
187 |
-+ _cleanup_fclose_ FILE *f = NULL; |
|
188 |
-+ char addr6[INET6_ADDRSTRLEN]; |
|
189 |
-+ const char *paddr6; |
|
190 |
-+ struct in6_addr ip6_addr; |
|
191 |
-+ uint32_t lifetime_preferred, lifetime_valid; |
|
192 |
-+ be32_t iaid_lease; |
|
193 |
-+ const struct in6_addr *addresses; |
|
194 |
-+ int r; |
|
195 |
-+ |
|
196 |
-+ assert(lease); |
|
197 |
-+ assert(lease_file); |
|
198 |
-+ |
|
199 |
-+ r = fopen_temporary(lease_file, &f, &temp_path); |
|
200 |
-+ if (r < 0) |
|
201 |
-+ goto fail; |
|
202 |
-+ |
|
203 |
-+ fchmod(fileno(f), 0644); |
|
204 |
-+ |
|
205 |
-+ fprintf(f, "# This is private data. Do not parse.\n"); |
|
206 |
-+ |
|
207 |
-+ sd_dhcp6_lease_reset_address_iter(lease); |
|
208 |
-+ do { |
|
209 |
-+ r = sd_dhcp6_lease_get_address(lease, &ip6_addr, |
|
210 |
-+ &lifetime_preferred, |
|
211 |
-+ &lifetime_valid); |
|
212 |
-+ if (r >= 0) { |
|
213 |
-+ paddr6 = inet_ntop(AF_INET6, &ip6_addr, addr6, |
|
214 |
-+ INET6_ADDRSTRLEN); |
|
215 |
-+ if (paddr6 != NULL) { |
|
216 |
-+ fprintf(f, "ADDRESS=%s\n", paddr6); |
|
217 |
-+ fprintf(f, "LIFETIME_PREFERRED=%u\n", lifetime_preferred); |
|
218 |
-+ fprintf(f, "LIFETIME_VALID=%u\n", lifetime_valid); |
|
219 |
-+ } |
|
220 |
-+ } |
|
221 |
-+ } while (r >=0); |
|
222 |
-+ |
|
223 |
-+ r = dhcp6_lease_get_iaid(lease, &iaid_lease); |
|
224 |
-+ if (r == 0) |
|
225 |
-+ fprintf(f, "IAID=%u\n", be32toh(iaid_lease)); |
|
226 |
-+ |
|
227 |
-+ if (lease->duid_len > 0) { |
|
228 |
-+ _cleanup_free_ char *duid_hex; |
|
229 |
-+ |
|
230 |
-+ duid_hex = hexmem(lease->duid, lease->duid_len); |
|
231 |
-+ if (duid_hex == NULL) { |
|
232 |
-+ r = -ENOMEM; |
|
233 |
-+ goto fail; |
|
234 |
-+ } |
|
235 |
-+ fprintf(f, "DUID=%s\n", duid_hex); |
|
236 |
-+ } |
|
237 |
-+ |
|
238 |
-+ r = fflush_and_check(f); |
|
239 |
-+ if (r < 0) |
|
240 |
-+ goto fail; |
|
241 |
-+ |
|
242 |
-+ if (rename(temp_path, lease_file) < 0) { |
|
243 |
-+ r = -errno; |
|
244 |
-+ goto fail; |
|
245 |
-+ } |
|
246 |
-+ |
|
247 |
-+ return 0; |
|
248 |
-+ |
|
249 |
-+fail: |
|
250 |
-+ if (temp_path) |
|
251 |
-+ (void) unlink(temp_path); |
|
252 |
-+ |
|
253 |
-+ return log_error_errno(r, "Failed to save lease data %s: %m", lease_file); |
|
254 |
-+} |
|
255 |
-diff -uNr systemd-228/src/network/networkctl.c systemd-228-query-duid/src/network/networkctl.c |
|
256 |
-+++ systemd-228-query-duid/src/network/networkctl.c 2016-04-01 00:34:03.926201756 +0000 |
|
257 |
-@@ -502,6 +502,7 @@ |
|
258 |
- const char *name) { |
|
259 |
- _cleanup_strv_free_ char **dns = NULL, **ntp = NULL, **domains = NULL; |
|
260 |
- _cleanup_free_ char *setup_state = NULL, *operational_state = NULL, *tz = NULL; |
|
261 |
-+ _cleanup_free_ char *clientid = NULL, *duid = NULL, *iaid = NULL; |
|
262 |
- _cleanup_netlink_message_unref_ sd_netlink_message *req = NULL, *reply = NULL; |
|
263 |
- _cleanup_device_unref_ sd_device *d = NULL; |
|
264 |
- char devid[2 + DECIMAL_STR_MAX(int)]; |
|
265 |
-@@ -668,7 +669,19 @@ |
|
266 |
- |
|
267 |
- (void) sd_network_link_get_timezone(ifindex, &tz); |
|
268 |
- if (tz) |
|
269 |
-- printf(" Time Zone: %s", tz); |
|
270 |
-+ printf(" Time Zone: %s\n", tz); |
|
271 |
-+ |
|
272 |
-+ (void) sd_network_link_get_clientid(ifindex, &clientid); |
|
273 |
-+ if (clientid) |
|
274 |
-+ printf(" CLIENTID: %s\n", clientid); |
|
275 |
-+ |
|
276 |
-+ (void) sd_network_link_get_iaid(ifindex, &iaid); |
|
277 |
-+ if (iaid) |
|
278 |
-+ printf(" IAID: %s\n", iaid); |
|
279 |
-+ |
|
280 |
-+ (void) sd_network_link_get_duid(ifindex, &duid); |
|
281 |
-+ if (duid) |
|
282 |
-+ printf(" DUID: %s", duid); |
|
283 |
- |
|
284 |
- return 0; |
|
285 |
- } |
|
286 |
-diff -uNr systemd-228/src/network/networkd-dhcp6.c systemd-228-query-duid/src/network/networkd-dhcp6.c |
|
287 |
-+++ systemd-228-query-duid/src/network/networkd-dhcp6.c 2016-04-01 07:18:35.972253096 +0000 |
|
288 |
-@@ -113,6 +113,8 @@ |
|
289 |
- return r; |
|
290 |
- } |
|
291 |
- |
|
292 |
-+ link->dhcp6_lease = sd_dhcp6_lease_ref(lease); |
|
293 |
-+ |
|
294 |
- return 0; |
|
295 |
- } |
|
296 |
- |
|
297 |
-@@ -134,7 +136,9 @@ |
|
298 |
- if (sd_dhcp6_client_get_lease(client, NULL) >= 0) |
|
299 |
- log_link_warning(link, "DHCPv6 lease lost"); |
|
300 |
- |
|
301 |
-+ link->dhcp6_lease = sd_dhcp6_lease_unref(link->dhcp6_lease); |
|
302 |
- link->dhcp6_configured = false; |
|
303 |
-+ link_dirty(link); |
|
304 |
- break; |
|
305 |
- |
|
306 |
- case SD_DHCP6_CLIENT_EVENT_IP_ACQUIRE: |
|
307 |
-@@ -153,6 +157,7 @@ |
|
308 |
- } |
|
309 |
- |
|
310 |
- link->dhcp6_configured = true; |
|
311 |
-+ link_dirty(link); |
|
312 |
- break; |
|
313 |
- |
|
314 |
- default: |
|
315 |
-diff -uNr systemd-228/src/network/networkd-link.c systemd-228-query-duid/src/network/networkd-link.c |
|
316 |
-+++ systemd-228-query-duid/src/network/networkd-link.c 2016-04-01 07:17:01.523047845 +0000 |
|
317 |
-@@ -26,6 +26,7 @@ |
|
318 |
- #include "alloc-util.h" |
|
319 |
- #include "bus-util.h" |
|
320 |
- #include "dhcp-lease-internal.h" |
|
321 |
-+#include "dhcp6-lease-internal.h" |
|
322 |
- #include "event-util.h" |
|
323 |
- #include "fd-util.h" |
|
324 |
- #include "fileio.h" |
|
325 |
-@@ -371,6 +372,11 @@ |
|
326 |
- if (r < 0) |
|
327 |
- return -ENOMEM; |
|
328 |
- |
|
329 |
-+ r = asprintf(&link->lease6_file, "/run/systemd/netif/leases6/%d", |
|
330 |
-+ link->ifindex); |
|
331 |
-+ if (r < 0) |
|
332 |
-+ return -ENOMEM; |
|
333 |
-+ |
|
334 |
- r = asprintf(&link->lldp_file, "/run/systemd/netif/lldp/%d", |
|
335 |
- link->ifindex); |
|
336 |
- if (r < 0) |
|
337 |
-@@ -421,8 +427,10 @@ |
|
338 |
- sd_dhcp_server_unref(link->dhcp_server); |
|
339 |
- sd_dhcp_client_unref(link->dhcp_client); |
|
340 |
- sd_dhcp_lease_unref(link->dhcp_lease); |
|
341 |
-+ sd_dhcp_lease_unref(link->dhcp6_lease); |
|
342 |
- |
|
343 |
- free(link->lease_file); |
|
344 |
-+ free(link->lease6_file); |
|
345 |
- |
|
346 |
- sd_lldp_free(link->lldp); |
|
347 |
- |
|
348 |
-@@ -2749,6 +2757,7 @@ |
|
349 |
- assert(link); |
|
350 |
- assert(link->state_file); |
|
351 |
- assert(link->lease_file); |
|
352 |
-+ assert(link->lease6_file); |
|
353 |
- assert(link->manager); |
|
354 |
- |
|
355 |
- if (link->state == LINK_STATE_LINGER) { |
|
356 |
-@@ -3004,6 +3013,31 @@ |
|
357 |
- } else |
|
358 |
- unlink(link->lease_file); |
|
359 |
- |
|
360 |
-+ if (link->dhcp6_lease) { |
|
361 |
-+ struct in6_addr addr6; |
|
362 |
-+ uint32_t lp, lv; |
|
363 |
-+ assert(link->network); |
|
364 |
-+ |
|
365 |
-+ fputs("DHCP6_ADDRESS=", f); |
|
366 |
-+ |
|
367 |
-+ sd_dhcp6_lease_reset_address_iter(link->dhcp6_lease); |
|
368 |
-+ while (sd_dhcp6_lease_get_address(link->dhcp6_lease, |
|
369 |
-+ &addr6, &lp, &lv) >= 0) { |
|
370 |
-+ serialize_in6_addrs(f, &addr6, 1); |
|
371 |
-+ fputc(' ', f); |
|
372 |
-+ } |
|
373 |
-+ fputc('\n', f); |
|
374 |
-+ |
|
375 |
-+ r = dhcp6_lease_save(link->dhcp6_lease, link->lease6_file); |
|
376 |
-+ if (r < 0) |
|
377 |
-+ goto fail; |
|
378 |
-+ |
|
379 |
-+ fprintf(f, |
|
380 |
-+ "DHCP6_LEASE=%s\n", |
|
381 |
-+ link->lease6_file); |
|
382 |
-+ } else |
|
383 |
-+ unlink(link->lease6_file); |
|
384 |
-+ |
|
385 |
- if (link->ipv4ll) { |
|
386 |
- struct in_addr address; |
|
387 |
- |
|
388 |
-diff -uNr systemd-228/src/network/networkd-link.h systemd-228-query-duid/src/network/networkd-link.h |
|
389 |
-+++ systemd-228-query-duid/src/network/networkd-link.h 2016-04-01 00:36:41.985533245 +0000 |
|
390 |
-@@ -92,6 +92,7 @@ |
|
391 |
- sd_dhcp_client *dhcp_client; |
|
392 |
- sd_dhcp_lease *dhcp_lease; |
|
393 |
- char *lease_file; |
|
394 |
-+ char *lease6_file; |
|
395 |
- uint16_t original_mtu; |
|
396 |
- unsigned dhcp4_messages; |
|
397 |
- bool dhcp4_configured; |
|
398 |
-@@ -111,6 +112,7 @@ |
|
399 |
- |
|
400 |
- sd_ndisc *ndisc_router_discovery; |
|
401 |
- sd_dhcp6_client *dhcp6_client; |
|
402 |
-+ sd_dhcp6_lease *dhcp6_lease; |
|
403 |
- bool rtnl_extended_attrs; |
|
404 |
- |
|
405 |
- sd_lldp *lldp; |
|
406 |
-diff -uNr systemd-228/src/network/networkd.c systemd-228-query-duid/src/network/networkd.c |
|
407 |
-+++ systemd-228-query-duid/src/network/networkd.c 2016-04-01 00:34:47.084920360 +0000 |
|
408 |
-@@ -66,6 +66,10 @@ |
|
409 |
- if (r < 0) |
|
410 |
- log_warning_errno(r, "Could not create runtime directory 'leases': %m"); |
|
411 |
- |
|
412 |
-+ r = mkdir_safe_label("/run/systemd/netif/leases6", 0755, uid, gid); |
|
413 |
-+ if (r < 0) |
|
414 |
-+ log_warning_errno(r, "Could not create runtime directory 'leases6': %m"); |
|
415 |
-+ |
|
416 |
- r = mkdir_safe_label("/run/systemd/netif/lldp", 0755, uid, gid); |
|
417 |
- if (r < 0) |
|
418 |
- log_warning_errno(r, "Could not create runtime directory 'lldp': %m"); |
|
419 |
-diff -uNr systemd-228/src/systemd/sd-dhcp6-client.h systemd-228-query-duid/src/systemd/sd-dhcp6-client.h |
|
420 |
-+++ systemd-228-query-duid/src/systemd/sd-dhcp6-client.h 2016-04-01 00:27:00.250621617 +0000 |
|
421 |
-@@ -54,7 +54,10 @@ |
|
422 |
- size_t addr_len, uint16_t arp_type); |
|
423 |
- int sd_dhcp6_client_set_duid(sd_dhcp6_client *client, uint16_t duid_type, |
|
424 |
- uint8_t *duid, size_t duid_len); |
|
425 |
-+int sd_dhcp6_client_get_duid(sd_dhcp6_client *client, uint16_t *duid_type, |
|
426 |
-+ const uint8_t **duid, size_t *duid_len); |
|
427 |
- int sd_dhcp6_client_set_iaid(sd_dhcp6_client *client, uint32_t iaid); |
|
428 |
-+int sd_dhcp6_client_get_iaid(sd_dhcp6_client *client, uint32_t *iaid); |
|
429 |
- int sd_dhcp6_client_set_information_request(sd_dhcp6_client *client, int enabled); |
|
430 |
- int sd_dhcp6_client_get_information_request(sd_dhcp6_client *client, int *enabled); |
|
431 |
- int sd_dhcp6_client_set_request_option(sd_dhcp6_client *client, |
|
432 |
-diff -uNr systemd-228/src/systemd/sd-network.h systemd-228-query-duid/src/systemd/sd-network.h |
|
433 |
-+++ systemd-228-query-duid/src/systemd/sd-network.h 2016-04-01 00:27:00.250621617 +0000 |
|
434 |
-@@ -122,6 +122,15 @@ |
|
435 |
- /* Get the CARRIERS that are bound to current link. */ |
|
436 |
- int sd_network_link_get_carrier_bound_by(int ifindex, char ***carriers); |
|
437 |
- |
|
438 |
-+/* Get the CLIENTID if the link has a IPv4 DHCP address. */ |
|
439 |
-+int sd_network_link_get_clientid(int ifindex, char **clientid); |
|
440 |
-+ |
|
441 |
-+/* Get the IAID if the link has a IPv6 DHCP address. */ |
|
442 |
-+int sd_network_link_get_iaid(int ifindex, char **iaid); |
|
443 |
-+ |
|
444 |
-+/* Get the DUID if the link has a IPv6 DHCP address. */ |
|
445 |
-+int sd_network_link_get_duid(int ifindex, char **duid); |
|
446 |
-+ |
|
447 |
- /* Get the timezone that was learnt on a specific link. */ |
|
448 |
- int sd_network_link_get_timezone(int ifindex, char **timezone); |
|
449 |
- |
450 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,54 +0,0 @@ |
1 |
-From 8bf23dc757dacaaf5a8d2c21aabf71aee08d1a04 Mon Sep 17 00:00:00 2001 |
|
2 |
-From: Franck Bui <fbui@suse.com> |
|
3 |
-Date: Mon, 23 Nov 2015 11:14:10 +0100 |
|
4 |
-Subject: [PATCH] make sure all swap units are ordered before the swap target |
|
5 |
- |
|
6 |
-When shutting down the system, the swap devices can be disabled long |
|
7 |
-time before the swap target is stopped. They're actually the first |
|
8 |
-units systemd turns off on my system. |
|
9 |
- |
|
10 |
-This is incorrect and due to swap devices having multiple associated |
|
11 |
-swap unit files. The main one is usually created by the fstab |
|
12 |
-generator and is used to start the swap device. |
|
13 |
- |
|
14 |
-Once done, systemd creates some 'alias' units for the same swap |
|
15 |
-device, one for each swap dev link. But those units are missing an |
|
16 |
-ordering dependencies which was created by the fstab generator for the |
|
17 |
-main swap unit. |
|
18 |
- |
|
19 |
-Therefore during shutdown those 'alias' units can be stopped at |
|
20 |
-anytime before unmount.target target. |
|
21 |
- |
|
22 |
-This patch makes sure that all swap units are stopped after the |
|
23 |
-swap.target target. |
|
24 |
- src/core/swap.c | 8 ++++++++ |
|
25 |
- 1 file changed, 8 insertions(+) |
|
26 |
- |
|
27 |
-diff --git a/src/core/swap.c b/src/core/swap.c |
|
28 |
-index ee0838e..b6e4372 100644 |
|
29 |
-+++ b/src/core/swap.c |
|
30 |
-@@ -211,6 +211,8 @@ static int swap_add_device_links(Swap *s) { |
|
31 |
- } |
|
32 |
- |
|
33 |
- static int swap_add_default_dependencies(Swap *s) { |
|
34 |
-+ int r; |
|
35 |
-+ |
|
36 |
- assert(s); |
|
37 |
- |
|
38 |
- if (!UNIT(s)->default_dependencies) |
|
39 |
-@@ -222,6 +224,12 @@ static int swap_add_default_dependencies(Swap *s) { |
|
40 |
- if (detect_container() > 0) |
|
41 |
- return 0; |
|
42 |
- |
|
43 |
-+ /* swap units generated for the swap dev links are missing the |
|
44 |
-+ * ordering dep against the swap target. */ |
|
45 |
-+ r = unit_add_dependency_by_name(UNIT(s), UNIT_BEFORE, SPECIAL_SWAP_TARGET, NULL, true); |
|
46 |
-+ if (r < 0) |
|
47 |
-+ return r; |
|
48 |
-+ |
|
49 |
- return unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_UMOUNT_TARGET, NULL, true); |
|
50 |
- } |
|
51 |
- |
|
52 |
- |
53 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,308 +0,0 @@ |
1 |
-diff --git a/.gitignore b/.gitignore |
|
2 |
-index eab660e..56a60ba 100644 |
|
3 |
-+++ b/.gitignore |
|
4 |
-@@ -158,6 +158,7 @@ |
|
5 |
- /test-cgroup |
|
6 |
- /test-cgroup-mask |
|
7 |
- /test-cgroup-util |
|
8 |
-+/test-clock |
|
9 |
- /test-compress |
|
10 |
- /test-compress-benchmark |
|
11 |
- /test-condition |
|
12 |
-diff --git a/Makefile.am b/Makefile.am |
|
13 |
-index 7bd98dd..4f9072c 100644 |
|
14 |
-+++ b/Makefile.am |
|
15 |
-@@ -1448,6 +1448,7 @@ tests += \ |
|
16 |
- test-prioq \ |
|
17 |
- test-fileio \ |
|
18 |
- test-time \ |
|
19 |
-+ test-clock \ |
|
20 |
- test-hashmap \ |
|
21 |
- test-set \ |
|
22 |
- test-bitmap \ |
|
23 |
-@@ -1961,6 +1962,12 @@ test_time_SOURCES = \ |
|
24 |
- test_time_LDADD = \ |
|
25 |
- libshared.la |
|
26 |
- |
|
27 |
-+test_clock_SOURCES = \ |
|
28 |
-+ src/test/test-clock.c |
|
29 |
-+ |
|
30 |
-+test_clock_LDADD = \ |
|
31 |
-+ libshared.la |
|
32 |
-+ |
|
33 |
- test_architecture_SOURCES = \ |
|
34 |
- src/test/test-architecture.c |
|
35 |
- |
|
36 |
-diff --git a/src/basic/clock-util.c b/src/basic/clock-util.c |
|
37 |
-index 507e757..7fe8d35 100644 |
|
38 |
-+++ b/src/basic/clock-util.c |
|
39 |
-@@ -69,9 +69,12 @@ int clock_set_hwclock(const struct tm *tm) { |
|
40 |
- return 0; |
|
41 |
- } |
|
42 |
- |
|
43 |
--int clock_is_localtime(void) { |
|
44 |
-+int clock_is_localtime(const char* adjtime_path) { |
|
45 |
- _cleanup_fclose_ FILE *f; |
|
46 |
- |
|
47 |
-+ if (adjtime_path == NULL) |
|
48 |
-+ adjtime_path = "/etc/adjtime"; |
|
49 |
-+ |
|
50 |
- /* |
|
51 |
- * The third line of adjtime is "UTC" or "LOCAL" or nothing. |
|
52 |
- * # /etc/adjtime |
|
53 |
-@@ -79,7 +82,7 @@ int clock_is_localtime(void) { |
|
54 |
- * 0 |
|
55 |
- * UTC |
|
56 |
- */ |
|
57 |
-- f = fopen("/etc/adjtime", "re"); |
|
58 |
-+ f = fopen(adjtime_path, "re"); |
|
59 |
- if (f) { |
|
60 |
- char line[LINE_MAX]; |
|
61 |
- bool b; |
|
62 |
-@@ -88,7 +91,8 @@ int clock_is_localtime(void) { |
|
63 |
- fgets(line, sizeof(line), f) && |
|
64 |
- fgets(line, sizeof(line), f); |
|
65 |
- if (!b) |
|
66 |
-- return -EIO; |
|
67 |
-+ /* less than three lines -> default to UTC */ |
|
68 |
-+ return 0; |
|
69 |
- |
|
70 |
- truncate_nl(line); |
|
71 |
- return streq(line, "LOCAL"); |
|
72 |
-@@ -96,6 +100,7 @@ int clock_is_localtime(void) { |
|
73 |
- } else if (errno != ENOENT) |
|
74 |
- return -errno; |
|
75 |
- |
|
76 |
-+ /* adjtime not present -> default to UTC */ |
|
77 |
- return 0; |
|
78 |
- } |
|
79 |
- |
|
80 |
-diff --git a/src/basic/clock-util.h b/src/basic/clock-util.h |
|
81 |
-index f471f2a..8830cd2 100644 |
|
82 |
-+++ b/src/basic/clock-util.h |
|
83 |
-@@ -21,7 +21,7 @@ |
|
84 |
- |
|
85 |
- #include <time.h> |
|
86 |
- |
|
87 |
--int clock_is_localtime(void); |
|
88 |
-+int clock_is_localtime(const char* adjtime_path); |
|
89 |
- int clock_set_timezone(int *min); |
|
90 |
- int clock_reset_timewarp(void); |
|
91 |
- int clock_get_hwclock(struct tm *tm); |
|
92 |
-diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c |
|
93 |
-index f939196..00372b9 100644 |
|
94 |
-+++ b/src/core/dbus-manager.c |
|
95 |
-@@ -139,7 +139,7 @@ static int property_get_tainted( |
|
96 |
- if (access("/proc/cgroups", F_OK) < 0) |
|
97 |
- e = stpcpy(e, "cgroups-missing:"); |
|
98 |
- |
|
99 |
-- if (clock_is_localtime() > 0) |
|
100 |
-+ if (clock_is_localtime(NULL) > 0) |
|
101 |
- e = stpcpy(e, "local-hwclock:"); |
|
102 |
- |
|
103 |
- /* remove the last ':' */ |
|
104 |
-diff --git a/src/core/main.c b/src/core/main.c |
|
105 |
-index b4e96fd..2c31593 100644 |
|
106 |
-+++ b/src/core/main.c |
|
107 |
-@@ -1375,7 +1375,7 @@ int main(int argc, char *argv[]) { |
|
108 |
- } |
|
109 |
- |
|
110 |
- if (!skip_setup) { |
|
111 |
-- if (clock_is_localtime() > 0) { |
|
112 |
-+ if (clock_is_localtime(NULL) > 0) { |
|
113 |
- int min; |
|
114 |
- |
|
115 |
- /* |
|
116 |
-diff --git a/src/test/test-clock.c b/src/test/test-clock.c |
|
117 |
-new file mode 100644 |
|
118 |
-index 0000000..92c4f79 |
|
119 |
-+++ b/src/test/test-clock.c |
|
120 |
-@@ -0,0 +1,95 @@ |
|
121 |
-+/*** |
|
122 |
-+ This file is part of systemd. |
|
123 |
-+ |
|
124 |
-+ Copyright (C) 2016 Canonical Ltd. |
|
125 |
-+ |
|
126 |
-+ systemd is free software; you can redistribute it and/or modify it |
|
127 |
-+ under the terms of the GNU Lesser General Public License as published by |
|
128 |
-+ the Free Software Foundation; either version 2.1 of the License, or |
|
129 |
-+ (at your option) any later version. |
|
130 |
-+ |
|
131 |
-+ systemd is distributed in the hope that it will be useful, but |
|
132 |
-+ WITHOUT ANY WARRANTY; without even the implied warranty of |
|
133 |
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
134 |
-+ Lesser General Public License for more details. |
|
135 |
-+ |
|
136 |
-+ You should have received a copy of the GNU Lesser General Public License |
|
137 |
-+ along with systemd; If not, see <http://www.gnu.org/licenses/>. |
|
138 |
-+***/ |
|
139 |
-+ |
|
140 |
-+#include <unistd.h> |
|
141 |
-+#include <fcntl.h> |
|
142 |
-+ |
|
143 |
-+#include "macro.h" |
|
144 |
-+#include "fileio.h" |
|
145 |
-+#include "log.h" |
|
146 |
-+#include "clock-util.h" |
|
147 |
-+ |
|
148 |
-+static void test_clock_is_localtime(void) { |
|
149 |
-+ char adjtime[] = "/tmp/test-adjtime.XXXXXX"; |
|
150 |
-+ int fd; |
|
151 |
-+ FILE* f; |
|
152 |
-+ |
|
153 |
-+ const struct scenario { |
|
154 |
-+ const char* contents; |
|
155 |
-+ int expected_result; |
|
156 |
-+ } scenarios[] = { |
|
157 |
-+ /* adjtime configures UTC */ |
|
158 |
-+ {"0.0 0 0\n0\nUTC\n", 0}, |
|
159 |
-+ /* adjtime configures local time */ |
|
160 |
-+ {"0.0 0 0\n0\nLOCAL\n", 1}, |
|
161 |
-+ /* no final EOL */ |
|
162 |
-+ {"0.0 0 0\n0\nUTC", 0}, |
|
163 |
-+ {"0.0 0 0\n0\nLOCAL", 1}, |
|
164 |
-+ /* empty value -> defaults to UTC */ |
|
165 |
-+ {"0.0 0 0\n0\n", 0}, |
|
166 |
-+ /* unknown value -> defaults to UTC */ |
|
167 |
-+ {"0.0 0 0\n0\nFOO\n", 0}, |
|
168 |
-+ /* no third line */ |
|
169 |
-+ {"0.0 0 0", 0}, |
|
170 |
-+ {"0.0 0 0\n", 0}, |
|
171 |
-+ {"0.0 0 0\n0", 0}, |
|
172 |
-+ }; |
|
173 |
-+ |
|
174 |
-+ /* without an adjtime file we default to UTC */ |
|
175 |
-+ assert_se(clock_is_localtime("/nonexisting/adjtime") == 0); |
|
176 |
-+ |
|
177 |
-+ fd = mkostemp_safe(adjtime, O_WRONLY|O_CLOEXEC); |
|
178 |
-+ assert(fd > 0); |
|
179 |
-+ log_info("adjtime test file: %s", adjtime); |
|
180 |
-+ f = fdopen(fd, "w"); |
|
181 |
-+ assert(f); |
|
182 |
-+ |
|
183 |
-+ for (size_t i = 0; i < ELEMENTSOF(scenarios); ++i) { |
|
184 |
-+ log_info("scenario #%zu:, expected result %i", i, scenarios[i].expected_result); |
|
185 |
-+ log_info("%s", scenarios[i].contents); |
|
186 |
-+ rewind(f); |
|
187 |
-+ ftruncate(fd, 0); |
|
188 |
-+ assert_se(write_string_stream(f, scenarios[i].contents, false) == 0); |
|
189 |
-+ assert_se(clock_is_localtime(adjtime) == scenarios[i].expected_result); |
|
190 |
-+ } |
|
191 |
-+ |
|
192 |
-+ unlink(adjtime); |
|
193 |
-+} |
|
194 |
-+ |
|
195 |
-+/* Test with the real /etc/adjtime */ |
|
196 |
-+static void test_clock_is_localtime_system(void) { |
|
197 |
-+ int r; |
|
198 |
-+ r = clock_is_localtime(NULL); |
|
199 |
-+ |
|
200 |
-+ if (access("/etc/adjtime", F_OK) == 0) { |
|
201 |
-+ log_info("/etc/adjtime exists, clock_is_localtime() == %i", r); |
|
202 |
-+ /* if /etc/adjtime exists we expect some answer, no error or |
|
203 |
-+ * crash */ |
|
204 |
-+ assert(r == 0 || r == 1); |
|
205 |
-+ } else |
|
206 |
-+ /* default is UTC if there is no /etc/adjtime */ |
|
207 |
-+ assert(r == 0); |
|
208 |
-+} |
|
209 |
-+ |
|
210 |
-+int main(int argc, char *argv[]) { |
|
211 |
-+ test_clock_is_localtime(); |
|
212 |
-+ test_clock_is_localtime_system(); |
|
213 |
-+ |
|
214 |
-+ return 0; |
|
215 |
-+} |
|
216 |
-diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c |
|
217 |
-index 2a10135..4e12056 100644 |
|
218 |
-+++ b/src/timedate/timedated.c |
|
219 |
-@@ -78,7 +78,7 @@ static int context_read_data(Context *c) { |
|
220 |
- c->zone = t; |
|
221 |
- t = NULL; |
|
222 |
- |
|
223 |
-- c->local_rtc = clock_is_localtime() > 0; |
|
224 |
-+ c->local_rtc = clock_is_localtime(NULL) > 0; |
|
225 |
- |
|
226 |
- return 0; |
|
227 |
- } |
|
228 |
-@@ -125,30 +125,44 @@ static int context_write_data_local_rtc(Context *c) { |
|
229 |
- if (!w) |
|
230 |
- return -ENOMEM; |
|
231 |
- } else { |
|
232 |
-- char *p, *e; |
|
233 |
-+ char *p; |
|
234 |
-+ char *e = (char*) "\n"; /* default if there are not 3 lines with \n terminator */ |
|
235 |
-+ const char *prepend = ""; |
|
236 |
- size_t a, b; |
|
237 |
- |
|
238 |
-- p = strchr(s, '\n'); |
|
239 |
-- if (!p) |
|
240 |
-- return -EIO; |
|
241 |
-- |
|
242 |
-- p = strchr(p+1, '\n'); |
|
243 |
-- if (!p) |
|
244 |
-- return -EIO; |
|
245 |
-- |
|
246 |
-- p++; |
|
247 |
-- e = strchr(p, '\n'); |
|
248 |
-- if (!e) |
|
249 |
-- return -EIO; |
|
250 |
-+ p = strchrnul(s, '\n'); |
|
251 |
-+ if (*p == '\0') { |
|
252 |
-+ /* only one line, no \n terminator */ |
|
253 |
-+ prepend = "\n0\n"; |
|
254 |
-+ } else if (p[1] == '\0') { |
|
255 |
-+ /* only one line, with \n terminator */ |
|
256 |
-+ ++p; |
|
257 |
-+ prepend = "0\n"; |
|
258 |
-+ } else { |
|
259 |
-+ p = strchr(p+1, '\n'); |
|
260 |
-+ if (!p) { |
|
261 |
-+ /* only two lines, no \n terminator */ |
|
262 |
-+ prepend = "\n"; |
|
263 |
-+ p = s + strlen(s); |
|
264 |
-+ } else { |
|
265 |
-+ char *end; |
|
266 |
-+ /* third line might have a \n terminator or not */ |
|
267 |
-+ p++; |
|
268 |
-+ end = strchr(p, '\n'); |
|
269 |
-+ /* if we actually have a fourth line, use that as suffix "e", otherwise the default \n */ |
|
270 |
-+ if (end) |
|
271 |
-+ e = end; |
|
272 |
-+ } |
|
273 |
-+ } |
|
274 |
- |
|
275 |
- a = p - s; |
|
276 |
- b = strlen(e); |
|
277 |
- |
|
278 |
-- w = new(char, a + (c->local_rtc ? 5 : 3) + b + 1); |
|
279 |
-+ w = new(char, a + (c->local_rtc ? 5 : 3) + strlen(prepend) + b + 1); |
|
280 |
- if (!w) |
|
281 |
- return -ENOMEM; |
|
282 |
- |
|
283 |
-- *(char*) mempcpy(stpcpy(mempcpy(w, s, a), c->local_rtc ? "LOCAL" : "UTC"), e, b) = 0; |
|
284 |
-+ *(char*) mempcpy(stpcpy(stpcpy(mempcpy(w, s, a), prepend), c->local_rtc ? "LOCAL" : "UTC"), e, b) = 0; |
|
285 |
- |
|
286 |
- if (streq(w, NULL_ADJTIME_UTC)) { |
|
287 |
- if (unlink("/etc/adjtime") < 0) |
|
288 |
-diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c |
|
289 |
-index 23e1915..b67d672 100644 |
|
290 |
-+++ b/src/timesync/timesyncd.c |
|
291 |
-@@ -122,7 +122,7 @@ int main(int argc, char *argv[]) { |
|
292 |
- goto finish; |
|
293 |
- } |
|
294 |
- |
|
295 |
-- if (clock_is_localtime() > 0) { |
|
296 |
-+ if (clock_is_localtime(NULL) > 0) { |
|
297 |
- log_info("The system is configured to read the RTC time in the local time zone. " |
|
298 |
- "This mode can not be fully supported. All system time to RTC updates are disabled."); |
|
299 |
- m->rtc_local_time = true; |
300 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,32 @@ |
0 |
+diff -rup systemd-232/src/resolve/resolved-manager.c systemd-232-new/src/resolve/resolved-manager.c |
|
1 |
+--- systemd-232/src/resolve/resolved-manager.c 2016-11-03 10:16:42.000000000 -0700 |
|
2 |
+@@ -484,6 +484,7 @@ static int manager_sigusr2(sd_event_sour |
|
3 |
+ int manager_new(Manager **ret) { |
|
4 |
+ _cleanup_(manager_freep) Manager *m = NULL; |
|
5 |
+ int r; |
|
6 |
++ char *default_dns_servers; |
|
7 |
+ |
|
8 |
+ assert(ret); |
|
9 |
+ |
|
10 |
+@@ -510,9 +511,17 @@ int manager_new(Manager **ret) { |
|
11 |
+ if (r < 0) |
|
12 |
+ return r; |
|
13 |
+ |
|
14 |
+- r = manager_parse_config_file(m); |
|
15 |
+- if (r < 0) |
|
16 |
+- return r; |
|
17 |
++ default_dns_servers = secure_getenv("DEFAULT_DNS_SERVERS"); |
|
18 |
++ if (default_dns_servers != NULL) { |
|
19 |
++ r = manager_parse_dns_server_string_and_warn(m, DNS_SERVER_FALLBACK, default_dns_servers); |
|
20 |
++ if (r < 0) |
|
21 |
++ return r; |
|
22 |
++ } |
|
23 |
++ else { |
|
24 |
++ r = manager_parse_config_file(m); |
|
25 |
++ if (r < 0) |
|
26 |
++ return r; |
|
27 |
++ } |
|
28 |
+ |
|
29 |
+ r = sd_event_default(&m->event); |
|
30 |
+ if (r < 0) |
0 | 31 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,39 @@ |
0 |
+diff -rup systemd-232/src/network/networkd-link.c systemd-232-new/src/network/networkd-link.c |
|
1 |
+--- systemd-232/src/network/networkd-link.c 2016-11-03 10:16:42.000000000 -0700 |
|
2 |
+@@ -199,6 +199,26 @@ static bool link_proxy_arp_enabled(Link |
|
3 |
+ return true; |
|
4 |
+ } |
|
5 |
+ |
|
6 |
++static bool link_ipv6_disabled(Link *link) { |
|
7 |
++ const char *p = NULL; |
|
8 |
++ int r; |
|
9 |
++ if (link->flags & IFF_LOOPBACK) |
|
10 |
++ return true; |
|
11 |
++ /* Make this a NOP if IPv6 is not available */ |
|
12 |
++ if (!socket_ipv6_is_supported()) |
|
13 |
++ return true; |
|
14 |
++ |
|
15 |
++ p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/disable_ipv6"); |
|
16 |
++ _cleanup_free_ char *val = NULL; |
|
17 |
++ r = read_one_line_file(p, &val); |
|
18 |
++ if (r < 0) |
|
19 |
++ log_link_warning_errno(link, r, "Cannot read ipv6 state for interface: %m"); |
|
20 |
++ if (streq(val, "0")) |
|
21 |
++ return false; |
|
22 |
++ |
|
23 |
++ return true; |
|
24 |
++} |
|
25 |
++ |
|
26 |
+ static bool link_ipv6_accept_ra_enabled(Link *link) { |
|
27 |
+ assert(link); |
|
28 |
+ |
|
29 |
+@@ -720,7 +740,7 @@ void link_check_ready(Link *link) { |
|
30 |
+ !link->ipv4ll_route) |
|
31 |
+ return; |
|
32 |
+ |
|
33 |
+- if (link_ipv6ll_enabled(link)) |
|
34 |
++ if (!link_ipv6_disabled(link) && link_ipv6ll_enabled(link)) |
|
35 |
+ if (in_addr_is_null(AF_INET6, (const union in_addr_union*) &link->ipv6ll_address) > 0) |
|
36 |
+ return; |
|
37 |
+ |
0 | 38 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,458 @@ |
0 |
+diff -rup systemd-232/src/libsystemd/sd-network/sd-network.c systemd-232-new/src/libsystemd/sd-network/sd-network.c |
|
1 |
+--- systemd-232/src/libsystemd/sd-network/sd-network.c 2016-11-03 10:16:42.000000000 -0700 |
|
2 |
+@@ -267,6 +267,51 @@ _public_ int sd_network_link_get_carrier |
|
3 |
+ return network_link_get_ifindexes(ifindex, "CARRIER_BOUND_BY", ret); |
|
4 |
+ } |
|
5 |
+ |
|
6 |
++static int network_get_file_str(const char *key, const char *fpath, int ifindex, char **ret) { |
|
7 |
++ _cleanup_free_ char *p = NULL, *s = NULL; |
|
8 |
++ int r; |
|
9 |
++ |
|
10 |
++ assert_return(ifindex > 0, -EINVAL); |
|
11 |
++ assert_return(fpath, -EINVAL); |
|
12 |
++ assert_return(ret, -EINVAL); |
|
13 |
++ |
|
14 |
++ if (asprintf(&p, "%s/%d", fpath, ifindex) < 0) |
|
15 |
++ return -ENOMEM; |
|
16 |
++ |
|
17 |
++ r = parse_env_file(p, NEWLINE, key, &s, NULL); |
|
18 |
++ if (r == -ENOENT) |
|
19 |
++ return -ENODATA; |
|
20 |
++ if (r < 0) |
|
21 |
++ return r; |
|
22 |
++ if (isempty(s)) |
|
23 |
++ return -ENODATA; |
|
24 |
++ |
|
25 |
++ *ret = s; |
|
26 |
++ s = NULL; |
|
27 |
++ return 0; |
|
28 |
++} |
|
29 |
++ |
|
30 |
++_public_ int sd_network_link_get_clientid(int ifindex, char **clientid) { |
|
31 |
++ return network_get_file_str("CLIENTID", |
|
32 |
++ "/run/systemd/netif/leases", |
|
33 |
++ ifindex, |
|
34 |
++ clientid); |
|
35 |
++} |
|
36 |
++ |
|
37 |
++_public_ int sd_network_link_get_iaid(int ifindex, char **iaid) { |
|
38 |
++ return network_get_file_str("IAID", |
|
39 |
++ "/run/systemd/netif/leases6", |
|
40 |
++ ifindex, |
|
41 |
++ iaid); |
|
42 |
++} |
|
43 |
++ |
|
44 |
++_public_ int sd_network_link_get_duid(int ifindex, char **duid) { |
|
45 |
++ return network_get_file_str("DUID", |
|
46 |
++ "/run/systemd/netif/leases6", |
|
47 |
++ ifindex, |
|
48 |
++ duid); |
|
49 |
++} |
|
50 |
++ |
|
51 |
+ static inline int MONITOR_TO_FD(sd_network_monitor *m) { |
|
52 |
+ return (int) (unsigned long) m - 1; |
|
53 |
+ } |
|
54 |
+diff -rup systemd-232/src/libsystemd-network/dhcp6-lease-internal.h systemd-232-new/src/libsystemd-network/dhcp6-lease-internal.h |
|
55 |
+--- systemd-232/src/libsystemd-network/dhcp6-lease-internal.h 2016-11-03 10:16:42.000000000 -0700 |
|
56 |
+@@ -23,7 +23,7 @@ |
|
57 |
+ #include <stdint.h> |
|
58 |
+ |
|
59 |
+ #include "sd-dhcp6-lease.h" |
|
60 |
+- |
|
61 |
++#include "dhcp-identifier.h" |
|
62 |
+ #include "dhcp6-internal.h" |
|
63 |
+ |
|
64 |
+ struct sd_dhcp6_lease { |
|
65 |
+@@ -35,6 +35,8 @@ struct sd_dhcp6_lease { |
|
66 |
+ bool rapid_commit; |
|
67 |
+ |
|
68 |
+ DHCP6IA ia; |
|
69 |
++ struct duid *duid; |
|
70 |
++ size_t duid_len; |
|
71 |
+ |
|
72 |
+ DHCP6Address *addr_iter; |
|
73 |
+ |
|
74 |
+@@ -63,6 +65,7 @@ int dhcp6_lease_set_rapid_commit(sd_dhcp |
|
75 |
+ int dhcp6_lease_get_rapid_commit(sd_dhcp6_lease *lease, bool *rapid_commit); |
|
76 |
+ |
|
77 |
+ int dhcp6_lease_get_iaid(sd_dhcp6_lease *lease, be32_t *iaid); |
|
78 |
++int dhcp6_lease_set_duid(sd_dhcp6_lease *lease, struct duid *duid, size_t duid_len); |
|
79 |
+ |
|
80 |
+ int dhcp6_lease_set_dns(sd_dhcp6_lease *lease, uint8_t *optval, size_t optlen); |
|
81 |
+ int dhcp6_lease_set_domains(sd_dhcp6_lease *lease, uint8_t *optval, |
|
82 |
+@@ -72,3 +75,4 @@ int dhcp6_lease_set_sntp(sd_dhcp6_lease |
|
83 |
+ size_t optlen) ; |
|
84 |
+ |
|
85 |
+ int dhcp6_lease_new(sd_dhcp6_lease **ret); |
|
86 |
++int dhcp6_lease_save(sd_dhcp6_lease *lease, const char *lease_file); |
|
87 |
+diff -rup systemd-232/src/libsystemd-network/sd-dhcp6-client.c systemd-232-new/src/libsystemd-network/sd-dhcp6-client.c |
|
88 |
+--- systemd-232/src/libsystemd-network/sd-dhcp6-client.c 2016-11-03 10:16:42.000000000 -0700 |
|
89 |
+@@ -222,6 +222,23 @@ int sd_dhcp6_client_set_duid( |
|
90 |
+ return 0; |
|
91 |
+ } |
|
92 |
+ |
|
93 |
++int sd_dhcp6_client_get_duid(sd_dhcp6_client *client, uint16_t *duid_type, |
|
94 |
++ const uint8_t **duid, size_t *duid_len) { |
|
95 |
++ assert_return(client, -EINVAL); |
|
96 |
++ assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY); |
|
97 |
++ |
|
98 |
++ *duid_type = 0; |
|
99 |
++ *duid_len = 0; |
|
100 |
++ *duid = NULL; |
|
101 |
++ if (client->duid_len > 0) { |
|
102 |
++ *duid_type = be16toh(client->duid.type); |
|
103 |
++ *duid_len = client->duid_len - sizeof(client->duid.type); |
|
104 |
++ *duid = client->duid.raw.data; |
|
105 |
++ } |
|
106 |
++ |
|
107 |
++ return 0; |
|
108 |
++} |
|
109 |
++ |
|
110 |
+ int sd_dhcp6_client_set_iaid(sd_dhcp6_client *client, uint32_t iaid) { |
|
111 |
+ assert_return(client, -EINVAL); |
|
112 |
+ assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY); |
|
113 |
+@@ -231,6 +248,14 @@ int sd_dhcp6_client_set_iaid(sd_dhcp6_cl |
|
114 |
+ return 0; |
|
115 |
+ } |
|
116 |
+ |
|
117 |
++int sd_dhcp6_client_get_iaid(sd_dhcp6_client *client, uint32_t *iaid) { |
|
118 |
++ assert_return(client, -EINVAL); |
|
119 |
++ |
|
120 |
++ *iaid = be32toh(client->ia_na.id); |
|
121 |
++ |
|
122 |
++ return 0; |
|
123 |
++} |
|
124 |
++ |
|
125 |
+ int sd_dhcp6_client_set_information_request(sd_dhcp6_client *client, int enabled) { |
|
126 |
+ assert_return(client, -EINVAL); |
|
127 |
+ assert_return(IN_SET(client->state, DHCP6_STATE_STOPPED), -EBUSY); |
|
128 |
+@@ -777,6 +802,10 @@ static int client_parse_message( |
|
129 |
+ if (r < 0 && r != -ENOMSG) |
|
130 |
+ return r; |
|
131 |
+ |
|
132 |
++ r = dhcp6_lease_set_duid(lease, &client->duid, client->duid_len); |
|
133 |
++ if (r < 0) |
|
134 |
++ return r; |
|
135 |
++ |
|
136 |
+ r = dhcp6_lease_get_iaid(lease, &iaid_lease); |
|
137 |
+ if (r < 0) |
|
138 |
+ return r; |
|
139 |
+diff -rup systemd-232/src/libsystemd-network/sd-dhcp6-lease.c systemd-232-new/src/libsystemd-network/sd-dhcp6-lease.c |
|
140 |
+--- systemd-232/src/libsystemd-network/sd-dhcp6-lease.c 2016-11-03 10:16:42.000000000 -0700 |
|
141 |
+@@ -18,11 +18,15 @@ |
|
142 |
+ along with systemd; If not, see <http://www.gnu.org/licenses/>. |
|
143 |
+ ***/ |
|
144 |
+ |
|
145 |
++#include <arpa/inet.h> |
|
146 |
+ #include <errno.h> |
|
147 |
+ |
|
148 |
+ #include "alloc-util.h" |
|
149 |
+ #include "dhcp6-lease-internal.h" |
|
150 |
+ #include "dhcp6-protocol.h" |
|
151 |
++#include "fd-util.h" |
|
152 |
++#include "fileio.h" |
|
153 |
++#include "hexdecoct.h" |
|
154 |
+ #include "strv.h" |
|
155 |
+ #include "util.h" |
|
156 |
+ |
|
157 |
+@@ -148,6 +152,15 @@ int dhcp6_lease_get_iaid(sd_dhcp6_lease |
|
158 |
+ return 0; |
|
159 |
+ } |
|
160 |
+ |
|
161 |
++int dhcp6_lease_set_duid(sd_dhcp6_lease *lease, struct duid *duid, size_t duid_len) { |
|
162 |
++ assert_return(lease, -EINVAL); |
|
163 |
++ assert_return(duid, -EINVAL); |
|
164 |
++ |
|
165 |
++ lease->duid = duid; |
|
166 |
++ lease->duid_len = duid_len; |
|
167 |
++ return 0; |
|
168 |
++} |
|
169 |
++ |
|
170 |
+ int sd_dhcp6_lease_get_address(sd_dhcp6_lease *lease, struct in6_addr *addr, |
|
171 |
+ uint32_t *lifetime_preferred, |
|
172 |
+ uint32_t *lifetime_valid) { |
|
173 |
+@@ -406,3 +419,74 @@ int dhcp6_lease_new(sd_dhcp6_lease **ret |
|
174 |
+ *ret = lease; |
|
175 |
+ return 0; |
|
176 |
+ } |
|
177 |
++ |
|
178 |
++int dhcp6_lease_save(sd_dhcp6_lease *lease, const char *lease_file) { |
|
179 |
++ _cleanup_free_ char *temp_path = NULL; |
|
180 |
++ _cleanup_fclose_ FILE *f = NULL; |
|
181 |
++ char addr6[INET6_ADDRSTRLEN]; |
|
182 |
++ const char *paddr6; |
|
183 |
++ struct in6_addr ip6_addr; |
|
184 |
++ uint32_t lifetime_preferred, lifetime_valid; |
|
185 |
++ be32_t iaid_lease; |
|
186 |
++ const struct in6_addr *addresses; |
|
187 |
++ int r; |
|
188 |
++ |
|
189 |
++ assert(lease); |
|
190 |
++ assert(lease_file); |
|
191 |
++ |
|
192 |
++ r = fopen_temporary(lease_file, &f, &temp_path); |
|
193 |
++ if (r < 0) |
|
194 |
++ goto fail; |
|
195 |
++ |
|
196 |
++ fchmod(fileno(f), 0644); |
|
197 |
++ |
|
198 |
++ fprintf(f, "# This is private data. Do not parse.\n"); |
|
199 |
++ |
|
200 |
++ sd_dhcp6_lease_reset_address_iter(lease); |
|
201 |
++ do { |
|
202 |
++ r = sd_dhcp6_lease_get_address(lease, &ip6_addr, |
|
203 |
++ &lifetime_preferred, |
|
204 |
++ &lifetime_valid); |
|
205 |
++ if (r >= 0) { |
|
206 |
++ paddr6 = inet_ntop(AF_INET6, &ip6_addr, addr6, |
|
207 |
++ INET6_ADDRSTRLEN); |
|
208 |
++ if (paddr6 != NULL) { |
|
209 |
++ fprintf(f, "ADDRESS=%s\n", paddr6); |
|
210 |
++ fprintf(f, "LIFETIME_PREFERRED=%u\n", lifetime_preferred); |
|
211 |
++ fprintf(f, "LIFETIME_VALID=%u\n", lifetime_valid); |
|
212 |
++ } |
|
213 |
++ } |
|
214 |
++ } while (r >=0); |
|
215 |
++ |
|
216 |
++ r = dhcp6_lease_get_iaid(lease, &iaid_lease); |
|
217 |
++ if (r == 0) |
|
218 |
++ fprintf(f, "IAID=%u\n", be32toh(iaid_lease)); |
|
219 |
++ |
|
220 |
++ if (lease->duid_len > 0) { |
|
221 |
++ _cleanup_free_ char *duid_hex; |
|
222 |
++ |
|
223 |
++ duid_hex = hexmem(lease->duid, lease->duid_len); |
|
224 |
++ if (duid_hex == NULL) { |
|
225 |
++ r = -ENOMEM; |
|
226 |
++ goto fail; |
|
227 |
++ } |
|
228 |
++ fprintf(f, "DUID=%s\n", duid_hex); |
|
229 |
++ } |
|
230 |
++ |
|
231 |
++ r = fflush_and_check(f); |
|
232 |
++ if (r < 0) |
|
233 |
++ goto fail; |
|
234 |
++ |
|
235 |
++ if (rename(temp_path, lease_file) < 0) { |
|
236 |
++ r = -errno; |
|
237 |
++ goto fail; |
|
238 |
++ } |
|
239 |
++ |
|
240 |
++ return 0; |
|
241 |
++ |
|
242 |
++fail: |
|
243 |
++ if (temp_path) |
|
244 |
++ (void) unlink(temp_path); |
|
245 |
++ |
|
246 |
++ return log_error_errno(r, "Failed to save lease data %s: %m", lease_file); |
|
247 |
++} |
|
248 |
+diff -rup systemd-232/src/network/networkctl.c systemd-232-new/src/network/networkctl.c |
|
249 |
+--- systemd-232/src/network/networkctl.c 2016-11-03 10:16:42.000000000 -0700 |
|
250 |
+@@ -700,6 +700,7 @@ static int link_status_one( |
|
251 |
+ |
|
252 |
+ _cleanup_strv_free_ char **dns = NULL, **ntp = NULL, **search_domains = NULL, **route_domains = NULL; |
|
253 |
+ _cleanup_free_ char *setup_state = NULL, *operational_state = NULL, *tz = NULL; |
|
254 |
++ _cleanup_free_ char *clientid = NULL, *duid = NULL, *iaid = NULL; |
|
255 |
+ _cleanup_(sd_device_unrefp) sd_device *d = NULL; |
|
256 |
+ char devid[2 + DECIMAL_STR_MAX(int)]; |
|
257 |
+ _cleanup_free_ char *t = NULL, *network = NULL; |
|
258 |
+@@ -802,6 +803,18 @@ static int link_status_one( |
|
259 |
+ if (tz) |
|
260 |
+ printf(" Time Zone: %s\n", tz); |
|
261 |
+ |
|
262 |
++ (void) sd_network_link_get_clientid(info->ifindex, &clientid); |
|
263 |
++ if (clientid) |
|
264 |
++ printf(" CLIENTID: %s\n", clientid); |
|
265 |
++ |
|
266 |
++ (void) sd_network_link_get_iaid(info->ifindex, &iaid); |
|
267 |
++ if (iaid) |
|
268 |
++ printf(" IAID: %s\n", iaid); |
|
269 |
++ |
|
270 |
++ (void) sd_network_link_get_duid(info->ifindex, &duid); |
|
271 |
++ if (duid) |
|
272 |
++ printf(" DUID: %s\n", duid); |
|
273 |
++ |
|
274 |
+ (void) dump_lldp_neighbors(" Connected To: ", info->ifindex); |
|
275 |
+ |
|
276 |
+ return 0; |
|
277 |
+diff -rup systemd-232/src/network/networkd.c systemd-232-new/src/network/networkd.c |
|
278 |
+--- systemd-232/src/network/networkd.c 2016-11-03 10:16:42.000000000 -0700 |
|
279 |
+@@ -64,6 +64,10 @@ int main(int argc, char *argv[]) { |
|
280 |
+ if (r < 0) |
|
281 |
+ log_warning_errno(r, "Could not create runtime directory 'leases': %m"); |
|
282 |
+ |
|
283 |
++ r = mkdir_safe_label("/run/systemd/netif/leases6", 0755, uid, gid); |
|
284 |
++ if (r < 0) |
|
285 |
++ log_warning_errno(r, "Could not create runtime directory 'leases6': %m"); |
|
286 |
++ |
|
287 |
+ r = mkdir_safe_label("/run/systemd/netif/lldp", 0755, uid, gid); |
|
288 |
+ if (r < 0) |
|
289 |
+ log_warning_errno(r, "Could not create runtime directory 'lldp': %m"); |
|
290 |
+diff -rup systemd-232/src/network/networkd-dhcp6.c systemd-232-new/src/network/networkd-dhcp6.c |
|
291 |
+--- systemd-232/src/network/networkd-dhcp6.c 2016-11-03 10:16:42.000000000 -0700 |
|
292 |
+@@ -115,6 +115,7 @@ static int dhcp6_lease_address_acquired( |
|
293 |
+ if (r < 0) |
|
294 |
+ return r; |
|
295 |
+ } |
|
296 |
++ link->dhcp6_lease = sd_dhcp6_lease_ref(lease); |
|
297 |
+ |
|
298 |
+ return 0; |
|
299 |
+ } |
|
300 |
+@@ -137,7 +138,9 @@ static void dhcp6_handler(sd_dhcp6_clien |
|
301 |
+ if (sd_dhcp6_client_get_lease(client, NULL) >= 0) |
|
302 |
+ log_link_warning(link, "DHCPv6 lease lost"); |
|
303 |
+ |
|
304 |
++ link->dhcp6_lease = sd_dhcp6_lease_unref(link->dhcp6_lease); |
|
305 |
+ link->dhcp6_configured = false; |
|
306 |
++ link_dirty(link); |
|
307 |
+ break; |
|
308 |
+ |
|
309 |
+ case SD_DHCP6_CLIENT_EVENT_IP_ACQUIRE: |
|
310 |
+@@ -156,6 +159,7 @@ static void dhcp6_handler(sd_dhcp6_clien |
|
311 |
+ } |
|
312 |
+ |
|
313 |
+ link->dhcp6_configured = true; |
|
314 |
++ link_dirty(link); |
|
315 |
+ break; |
|
316 |
+ |
|
317 |
+ default: |
|
318 |
+diff -rup systemd-232/src/network/networkd-link.c systemd-232-new/src/network/networkd-link.c |
|
319 |
+--- systemd-232/src/network/networkd-link.c 2016-11-03 10:16:42.000000000 -0700 |
|
320 |
+@@ -24,6 +24,7 @@ |
|
321 |
+ #include "alloc-util.h" |
|
322 |
+ #include "bus-util.h" |
|
323 |
+ #include "dhcp-lease-internal.h" |
|
324 |
++#include "dhcp6-lease-internal.h" |
|
325 |
+ #include "fd-util.h" |
|
326 |
+ #include "fileio.h" |
|
327 |
+ #include "netlink-util.h" |
|
328 |
+@@ -459,6 +460,9 @@ static int link_new(Manager *manager, sd |
|
329 |
+ if (asprintf(&link->lease_file, "/run/systemd/netif/leases/%d", link->ifindex) < 0) |
|
330 |
+ return -ENOMEM; |
|
331 |
+ |
|
332 |
++ if (asprintf(&link->lease6_file, "/run/systemd/netif/leases6/%d", link->ifindex) < 0) |
|
333 |
++ return -ENOMEM; |
|
334 |
++ |
|
335 |
+ if (asprintf(&link->lldp_file, "/run/systemd/netif/lldp/%d", link->ifindex) < 0) |
|
336 |
+ return -ENOMEM; |
|
337 |
+ |
|
338 |
+@@ -506,10 +510,12 @@ static void link_free(Link *link) { |
|
339 |
+ sd_dhcp_server_unref(link->dhcp_server); |
|
340 |
+ sd_dhcp_client_unref(link->dhcp_client); |
|
341 |
+ sd_dhcp_lease_unref(link->dhcp_lease); |
|
342 |
++ sd_dhcp_lease_unref(link->dhcp6_lease); |
|
343 |
+ |
|
344 |
+ link_lldp_emit_stop(link); |
|
345 |
+ |
|
346 |
+ free(link->lease_file); |
|
347 |
++ free(link->lease6_file); |
|
348 |
+ |
|
349 |
+ sd_lldp_unref(link->lldp); |
|
350 |
+ free(link->lldp_file); |
|
351 |
+@@ -3216,6 +3222,7 @@ int link_save(Link *link) { |
|
352 |
+ assert(link); |
|
353 |
+ assert(link->state_file); |
|
354 |
+ assert(link->lease_file); |
|
355 |
++ assert(link->lease6_file); |
|
356 |
+ assert(link->manager); |
|
357 |
+ |
|
358 |
+ if (link->state == LINK_STATE_LINGER) { |
|
359 |
+@@ -3461,6 +3468,31 @@ int link_save(Link *link) { |
|
360 |
+ } else |
|
361 |
+ unlink(link->lease_file); |
|
362 |
+ |
|
363 |
++ if (link->dhcp6_lease) { |
|
364 |
++ struct in6_addr addr6; |
|
365 |
++ uint32_t lp, lv; |
|
366 |
++ assert(link->network); |
|
367 |
++ |
|
368 |
++ fputs("DHCP6_ADDRESS=", f); |
|
369 |
++ |
|
370 |
++ sd_dhcp6_lease_reset_address_iter(link->dhcp6_lease); |
|
371 |
++ while (sd_dhcp6_lease_get_address(link->dhcp6_lease, |
|
372 |
++ &addr6, &lp, &lv) >= 0) { |
|
373 |
++ serialize_in6_addrs(f, &addr6, 1); |
|
374 |
++ fputc(' ', f); |
|
375 |
++ } |
|
376 |
++ fputc('\n', f); |
|
377 |
++ |
|
378 |
++ r = dhcp6_lease_save(link->dhcp6_lease, link->lease6_file); |
|
379 |
++ if (r < 0) |
|
380 |
++ goto fail; |
|
381 |
++ |
|
382 |
++ fprintf(f, |
|
383 |
++ "DHCP6_LEASE=%s\n", |
|
384 |
++ link->lease6_file); |
|
385 |
++ } else |
|
386 |
++ unlink(link->lease6_file); |
|
387 |
++ |
|
388 |
+ if (link->ipv4ll) { |
|
389 |
+ struct in_addr address; |
|
390 |
+ |
|
391 |
+diff -rup systemd-232/src/network/networkd-link.h systemd-232-new/src/network/networkd-link.h |
|
392 |
+--- systemd-232/src/network/networkd-link.h 2016-11-03 10:16:42.000000000 -0700 |
|
393 |
+@@ -95,6 +95,7 @@ typedef struct Link { |
|
394 |
+ sd_dhcp_client *dhcp_client; |
|
395 |
+ sd_dhcp_lease *dhcp_lease; |
|
396 |
+ char *lease_file; |
|
397 |
++ char *lease6_file; |
|
398 |
+ uint16_t original_mtu; |
|
399 |
+ unsigned dhcp4_messages; |
|
400 |
+ bool dhcp4_configured; |
|
401 |
+@@ -118,6 +119,7 @@ typedef struct Link { |
|
402 |
+ Set *ndisc_dnssl; |
|
403 |
+ |
|
404 |
+ sd_dhcp6_client *dhcp6_client; |
|
405 |
++ sd_dhcp6_lease *dhcp6_lease; |
|
406 |
+ bool rtnl_extended_attrs; |
|
407 |
+ |
|
408 |
+ /* This is about LLDP reception */ |
|
409 |
+diff -rup systemd-232/src/systemd/sd-dhcp6-client.h systemd-232-new/src/systemd/sd-dhcp6-client.h |
|
410 |
+--- systemd-232/src/systemd/sd-dhcp6-client.h 2016-11-03 10:16:42.000000000 -0700 |
|
411 |
+@@ -98,9 +98,17 @@ int sd_dhcp6_client_set_duid( |
|
412 |
+ uint16_t duid_type, |
|
413 |
+ const void *duid, |
|
414 |
+ size_t duid_len); |
|
415 |
++int sd_dhcp6_client_get_duid( |
|
416 |
++ sd_dhcp6_client *client, |
|
417 |
++ uint16_t *duid_type, |
|
418 |
++ const uint8_t **duid, |
|
419 |
++ size_t *duid_len); |
|
420 |
+ int sd_dhcp6_client_set_iaid( |
|
421 |
+ sd_dhcp6_client *client, |
|
422 |
+ uint32_t iaid); |
|
423 |
++int sd_dhcp6_client_get_iaid( |
|
424 |
++ sd_dhcp6_client *client, |
|
425 |
++ uint32_t *iaid); |
|
426 |
+ int sd_dhcp6_client_set_information_request( |
|
427 |
+ sd_dhcp6_client *client, |
|
428 |
+ int enabled); |
|
429 |
+diff -rup systemd-232/src/systemd/sd-network.h systemd-232-new/src/systemd/sd-network.h |
|
430 |
+--- systemd-232/src/systemd/sd-network.h 2016-11-03 10:16:42.000000000 -0700 |
|
431 |
+@@ -145,6 +145,15 @@ int sd_network_link_get_carrier_bound_to |
|
432 |
+ /* Get the CARRIERS that are bound to current link. */ |
|
433 |
+ int sd_network_link_get_carrier_bound_by(int ifindex, int **ifindexes); |
|
434 |
+ |
|
435 |
++/* Get the CLIENTID if the link has a IPv4 DHCP address. */ |
|
436 |
++int sd_network_link_get_clientid(int ifindex, char **clientid); |
|
437 |
++ |
|
438 |
++/* Get the IAID if the link has a IPv6 DHCP address. */ |
|
439 |
++int sd_network_link_get_iaid(int ifindex, char **iaid); |
|
440 |
++ |
|
441 |
++/* Get the DUID if the link has a IPv6 DHCP address. */ |
|
442 |
++int sd_network_link_get_duid(int ifindex, char **duid); |
|
443 |
++ |
|
444 |
+ /* Get the timezone that was learnt on a specific link. */ |
|
445 |
+ int sd_network_link_get_timezone(int ifindex, char **timezone); |
|
446 |
+ |
0 | 447 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,12 @@ |
0 |
+diff -rup systemd-232/tmpfiles.d/etc.conf.m4 systemd-232-new/tmpfiles.d/etc.conf.m4 |
|
1 |
+--- systemd-232/tmpfiles.d/etc.conf.m4 2016-11-03 10:16:42.000000000 -0700 |
|
2 |
+@@ -14,7 +14,7 @@ m4_ifdef(`HAVE_SMACK_RUN_LABEL', |
|
3 |
+ t /etc/mtab - - - - security.SMACK64=_ |
|
4 |
+ )m4_dnl |
|
5 |
+ m4_ifdef(`ENABLE_RESOLVED', |
|
6 |
+-L! /etc/resolv.conf - - - - ../usr/lib/systemd/resolv.conf |
|
7 |
++L! /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf |
|
8 |
+ )m4_dnl |
|
9 |
+ C /etc/nsswitch.conf - - - - |
|
10 |
+ m4_ifdef(`HAVE_PAM', |
... | ... |
@@ -1,6 +1,7 @@ |
1 |
-+++ b/src/core/macros.systemd.in 2016-11-03 14:02:53.122672819 -0700 |
|
2 |
-@@ -39,7 +39,9 @@ |
|
1 |
+diff -rup systemd-232/src/core/macros.systemd.in systemd-232-new/src/core/macros.systemd.in |
|
2 |
+--- systemd-232/src/core/macros.systemd.in 2016-11-03 10:16:42.000000000 -0700 |
|
3 |
+@@ -47,7 +47,9 @@ OrderWithRequires(postun): systemd \ |
|
3 | 4 |
%systemd_post() \ |
4 | 5 |
if [ $1 -eq 1 ] ; then \ |
5 | 6 |
# Initial installation \ |
... | ... |
@@ -11,7 +12,7 @@ |
11 | 11 |
fi \ |
12 | 12 |
%{nil} |
13 | 13 |
|
14 |
-@@ -48,7 +50,8 @@ |
|
14 |
+@@ -56,7 +58,8 @@ fi \ |
|
15 | 15 |
%systemd_preun() \ |
16 | 16 |
if [ $1 -eq 0 ] ; then \ |
17 | 17 |
# Package removal, not upgrade \ |
... | ... |
@@ -21,7 +22,7 @@ |
21 | 21 |
fi \ |
22 | 22 |
%{nil} |
23 | 23 |
|
24 |
-@@ -59,11 +62,14 @@ |
|
24 |
+@@ -67,11 +70,14 @@ if [ $1 -eq 0 ] ; then \ |
|
25 | 25 |
fi \ |
26 | 26 |
%{nil} |
27 | 27 |
|
... | ... |
@@ -1,39 +1,25 @@ |
1 |
-Summary: Systemd-228 |
|
1 |
+Summary: Systemd-232 |
|
2 | 2 |
Name: systemd |
3 |
-Version: 228 |
|
4 |
-Release: 32%{?dist} |
|
3 |
+Version: 232 |
|
4 |
+Release: 1%{?dist} |
|
5 | 5 |
License: LGPLv2+ and GPLv2+ and MIT |
6 | 6 |
URL: http://www.freedesktop.org/wiki/Software/systemd/ |
7 | 7 |
Group: System Environment/Security |
8 | 8 |
Vendor: VMware, Inc. |
9 | 9 |
Distribution: Photon |
10 | 10 |
Source0: %{name}-%{version}.tar.gz |
11 |
-%define sha1 systemd=15475d874dc38f8d759f334bbcf7d8aff4b412da |
|
11 |
+%define sha1 systemd=74178b96d631058236cf79f5b0cc3953382f12b5 |
|
12 | 12 |
Source1: 99-vmware-hotplug.rules |
13 | 13 |
Source2: 50-security-hardening.conf |
14 |
-#patch for ostree |
|
15 |
-Patch0: systemd-228-mount.patch |
|
16 |
-Patch1: 01-enoX-uses-instance-number-for-vmware-hv.patch |
|
17 |
-Patch2: systemd-228-loopback-address.patch |
|
18 |
-Patch3: systemd-228-never-cache-localhost-rr.patch |
|
19 |
-Patch4: systemd-228-parse-error-message.patch |
|
20 |
-Patch5: systemd-228-networking-fixes.patch |
|
21 |
-Patch6: systemd-228-cleanup-recv.patch |
|
22 |
-Patch7: systemd-228-fix-reading-routes.patch |
|
23 |
-Patch8: systemd-228-kernel-ndisc.patch |
|
24 |
-Patch9: systemd-228-swap-disconnect-order-fix.patch |
|
25 |
-Patch10: systemd-228-duid-iaid-dhcp-preserve.patch |
|
26 |
-Patch11: systemd-228-timedatectl-PR2749.patch |
|
27 |
-Patch12: systemd-228-query-duid.patch |
|
28 |
-Patch13: systemd-228-pam-systemd-user.patch |
|
29 |
-Patch14: systemd-228-ipv6-disabled-fix.patch |
|
30 |
-Patch15: systemd-228-default-dns-from-env.patch |
|
31 |
-Patch16: systemd-228-dhcp-duid-api-update.patch |
|
32 |
-Patch17: systemd-228-domains-search-fix.patch |
|
33 |
-Patch18: systemd-228-dns-transaction-pending-fix.patch |
|
34 |
-Patch19: 02-install-general-aliases.patch |
|
35 |
-Patch20: systemd-228-CVE-notify-socket-DOS-fix.patch |
|
36 |
-Patch21: systemd-macros.patch |
|
14 |
+ |
|
15 |
+Patch0: 01-enoX-uses-instance-number-for-vmware-hv.patch |
|
16 |
+Patch1: 02-install-general-aliases.patch |
|
17 |
+Patch2: systemd-232-query-duid.patch |
|
18 |
+Patch3: systemd-232-ipv6-disabled-fix.patch |
|
19 |
+Patch4: systemd-232-default-dns-from-env.patch |
|
20 |
+Patch5: systemd-macros.patch |
|
21 |
+Patch6: systemd-232-resolv-conf-symlink.patch |
|
22 |
+ |
|
37 | 23 |
Requires: Linux-PAM |
38 | 24 |
Requires: libcap |
39 | 25 |
Requires: xz |
... | ... |
@@ -56,6 +42,20 @@ BuildRequires: glib-devel |
56 | 56 |
%description |
57 | 57 |
Systemd is an init replacement with better process control and security |
58 | 58 |
|
59 |
+%package devel |
|
60 |
+Summary: Development headers for systemd |
|
61 |
+Requires: %{name} = %{version}-%{release} |
|
62 |
+ |
|
63 |
+%description devel |
|
64 |
+Development headers for developing applications linking to libsystemd |
|
65 |
+ |
|
66 |
+%package lang |
|
67 |
+Summary: Language pack for systemd |
|
68 |
+Requires: %{name} = %{version}-%{release} |
|
69 |
+ |
|
70 |
+%description lang |
|
71 |
+Language pack for systemd |
|
72 |
+ |
|
59 | 73 |
%prep |
60 | 74 |
%setup -q |
61 | 75 |
cat > config.cache << "EOF" |
... | ... |
@@ -66,6 +66,7 @@ BLKID_CFLAGS="-I/usr/include/blkid" |
66 | 66 |
cc_cv_CFLAGS__flto=no |
67 | 67 |
EOF |
68 | 68 |
sed -i "s:blkid/::" $(grep -rl "blkid/blkid.h") |
69 |
+ |
|
69 | 70 |
%patch0 -p1 |
70 | 71 |
%patch1 -p1 |
71 | 72 |
%patch2 -p1 |
... | ... |
@@ -73,21 +74,7 @@ sed -i "s:blkid/::" $(grep -rl "blkid/blkid.h") |
73 | 73 |
%patch4 -p1 |
74 | 74 |
%patch5 -p1 |
75 | 75 |
%patch6 -p1 |
76 |
-%patch7 -p1 |
|
77 |
-%patch8 -p1 |
|
78 |
-%patch9 -p1 |
|
79 |
-%patch10 -p1 |
|
80 |
-%patch11 -p1 |
|
81 |
-%patch12 -p1 |
|
82 |
-%patch13 -p1 |
|
83 |
-%patch14 -p1 |
|
84 |
-%patch15 -p1 |
|
85 |
-%patch16 -p1 |
|
86 |
-%patch17 -p1 |
|
87 |
-%patch18 -p1 |
|
88 |
-%patch19 -p1 |
|
89 |
-%patch20 -p1 |
|
90 |
-%patch21 -p1 |
|
76 |
+ |
|
91 | 77 |
sed -i "s#\#DefaultTasksMax=512#DefaultTasksMax=infinity#g" src/core/system.conf |
92 | 78 |
|
93 | 79 |
%build |
... | ... |
@@ -131,11 +118,12 @@ mkdir -p %{buildroot}%{_localstatedir}/log/journal |
131 | 131 |
|
132 | 132 |
#cp %{buildroot}/usr/share/factory/etc/pam.d/system-auth %{buildroot}%{_sysconfdir}/pam.d/system-auth |
133 | 133 |
#cp %{buildroot}/usr/share/factory/etc/pam.d/other %{buildroot}%{_sysconfdir}/pam.d/other |
134 |
-find %{buildroot}%{_libdir} -name '*.la' -delete |
|
134 |
+find %{buildroot} -name '*.la' -delete |
|
135 | 135 |
install -Dm 0644 %{SOURCE1} %{buildroot}/%{_sysconfdir}/udev/rules.d |
136 | 136 |
install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysctl.d |
137 | 137 |
rm %{buildroot}/lib/systemd/system/default.target |
138 | 138 |
ln -sfv multi-user.target %{buildroot}/lib/systemd/system/default.target |
139 |
+%find_lang %{name} |
|
139 | 140 |
|
140 | 141 |
%post |
141 | 142 |
/sbin/ldconfig |
... | ... |
@@ -172,7 +160,6 @@ rm -rf %{buildroot}/* |
172 | 172 |
%config(noreplace) %{_sysconfdir}/systemd/resolved.conf |
173 | 173 |
%config(noreplace) %{_sysconfdir}/systemd/coredump.conf |
174 | 174 |
%config(noreplace) %{_sysconfdir}/systemd/timesyncd.conf |
175 |
-%config(noreplace) %{_sysconfdir}/systemd/bootchart.conf |
|
176 | 175 |
%config(noreplace) %{_sysconfdir}/pam.d/systemd-user |
177 | 176 |
|
178 | 177 |
%dir %{_sysconfdir}/udev |
... | ... |
@@ -186,17 +173,49 @@ rm -rf %{buildroot}/* |
186 | 186 |
/lib/systemd/system-* |
187 | 187 |
/lib/systemd/system/* |
188 | 188 |
/lib/systemd/network/80-container* |
189 |
+/lib/systemd/*.so |
|
190 |
+/lib/systemd/resolv.conf |
|
189 | 191 |
%config(noreplace) /lib/systemd/network/99-default.link |
190 |
-%exclude %{_libdir}/debug/* |
|
191 |
-%{_libdir}/* |
|
192 |
+%exclude %{_libdir}/debug |
|
193 |
+%exclude %{_datadir}/locale |
|
194 |
+%{_libdir}/binfmt.d |
|
195 |
+%{_libdir}/kernel |
|
196 |
+%{_libdir}/modules-load.d |
|
197 |
+%{_libdir}/rpm |
|
198 |
+%{_libdir}/security |
|
199 |
+%{_libdir}/sysctl.d |
|
200 |
+%{_libdir}/systemd |
|
201 |
+%{_libdir}/tmpfiles.d |
|
202 |
+%{_libdir}/*.so* |
|
192 | 203 |
%{_bindir}/* |
193 | 204 |
/bin/* |
194 | 205 |
/sbin/* |
195 |
-%{_includedir}/* |
|
196 |
-%{_datadir}/* |
|
206 |
+%{_datadir}/bash-completion/* |
|
207 |
+%{_datadir}/factory/* |
|
208 |
+%{_datadir}/dbus-1 |
|
209 |
+%{_datadir}/doc/* |
|
210 |
+%{_mandir}/* |
|
211 |
+%{_datadir}/polkit-1 |
|
212 |
+%{_datadir}/systemd |
|
213 |
+%{_datadir}/zsh/* |
|
197 | 214 |
%dir %{_localstatedir}/log/journal |
198 | 215 |
|
216 |
+%files devel |
|
217 |
+%dir %{_includedir}/systemd |
|
218 |
+%{_libdir}/libudev.so |
|
219 |
+%{_libdir}/libsystemd.so |
|
220 |
+%{_includedir}/systemd/*.h |
|
221 |
+%{_includedir}/libudev.h |
|
222 |
+%{_libdir}/pkgconfig/libudev.pc |
|
223 |
+%{_libdir}/pkgconfig/libsystemd.pc |
|
224 |
+%{_datadir}/pkgconfig/systemd.pc |
|
225 |
+%{_datadir}/pkgconfig/udev.pc |
|
226 |
+ |
|
227 |
+%files lang -f %{name}.lang |
|
228 |
+ |
|
199 | 229 |
%changelog |
230 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 232-1 |
|
231 |
+- Update systemd to 232 |
|
200 | 232 |
* Thu Nov 3 2016 Divya Thaluru <dthaluru@vmware.com> 228-32 |
201 | 233 |
- Added logic to reload services incase of rpm upgrade |
202 | 234 |
* Thu Sep 29 2016 Vinay Kulkarni <kulkarniv@vmware.com> 228-31 |
... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
Summary: USB Utils |
2 | 2 |
Name: usbutils |
3 | 3 |
Version: 008 |
4 |
-Release: 3%{?dist} |
|
4 |
+Release: 4%{?dist} |
|
5 | 5 |
License: GPLv2+ |
6 | 6 |
URL: http://linux-usb.sourceforge.net |
7 | 7 |
Group: Applications/System |
... | ... |
@@ -14,7 +14,7 @@ BuildRequires: libusb-devel |
14 | 14 |
BuildRequires: pkg-config |
15 | 15 |
BuildRequires: systemd |
16 | 16 |
Requires: libusb |
17 |
-BuildRequires: systemd |
|
17 |
+BuildRequires: systemd-devel |
|
18 | 18 |
|
19 | 19 |
%description |
20 | 20 |
The USB Utils package contains an utility used to display information |
... | ... |
@@ -45,9 +45,11 @@ install -p -m 0644 %{SOURCE1} %{buildroot}%{_datadir}/misc/ |
45 | 45 |
%{_datadir}/misc/usb.ids |
46 | 46 |
|
47 | 47 |
%changelog |
48 |
-* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 008-3 |
|
49 |
-- GA - Bump release of all rpms |
|
50 |
-* Tue May 10 2016 Nick Shi <nshi@vmware.com> - 008-2 |
|
51 |
-- Update Source0 to the correct link |
|
52 |
-* Fri May 06 2016 Nick Shi <nshi@vmware.com> - 008-1 |
|
53 |
-- Initial version |
|
48 |
+* Fri Nov 18 2016 Anish Swaminathan <anishs@vmware.com> 008-4 |
|
49 |
+- Change systemd dependency |
|
50 |
+* Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 008-3 |
|
51 |
+- GA - Bump release of all rpms |
|
52 |
+* Tue May 10 2016 Nick Shi <nshi@vmware.com> - 008-2 |
|
53 |
+- Update Source0 to the correct link |
|
54 |
+* Fri May 06 2016 Nick Shi <nshi@vmware.com> - 008-1 |
|
55 |
+- Initial version |