Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 690918
Collapse All | Expand All

(-)a/net-misc/cfengine/Manifest (+2 lines)
Lines 1-6 Link Here
1
DIST cfengine-3.10.5.tar.gz 2392398 SHA256 46ec1bf39a3ee27f8a9e10195b37daaa19b25e87ed3d45ebfb895dad0801a7b6 SHA512 89cd45b5c2ab5a5fbb32577751e80596c69edb7613674fe690a30b66a795e516a17e49934827aaff13a9b9e5e4532dbd39238f6d94acc2fc2f4f59b4f505d33f WHIRLPOOL 0e068d9837be0115d269c8cf96a093445e42503ad5e578a11e3d4b09cf894025cf26164e072e9d2ccafbcf41cbad2aefa022db0a1c1b8216a0ba5528961e326c
1
DIST cfengine-3.10.5.tar.gz 2392398 SHA256 46ec1bf39a3ee27f8a9e10195b37daaa19b25e87ed3d45ebfb895dad0801a7b6 SHA512 89cd45b5c2ab5a5fbb32577751e80596c69edb7613674fe690a30b66a795e516a17e49934827aaff13a9b9e5e4532dbd39238f6d94acc2fc2f4f59b4f505d33f WHIRLPOOL 0e068d9837be0115d269c8cf96a093445e42503ad5e578a11e3d4b09cf894025cf26164e072e9d2ccafbcf41cbad2aefa022db0a1c1b8216a0ba5528961e326c
2
DIST cfengine-3.12.2.tar.gz 2529342 SHA256 0285e039f576b4cf2c8a2f795fdb1687b7637e932bb1d963093546f2abee11b0 SHA512 fd2eeb95f5e70ed0ede1ba4607eccc1a798fd9ade4db57dde552ee4bce398e75d6745d10a06cf8aae6e5d43d2d4ed30b4528ef4c4ab3e6792045010a54101d0f WHIRLPOOL 07b157d643b233cf0bdf4903bb8d11478a64f9f4274ff58264f80cf33d7655aa558f005b5514a16b09b3b379f823f9782ac0881bd52de71604add1108ae290f7
2
DIST cfengine-3.12.2.tar.gz 2529342 SHA256 0285e039f576b4cf2c8a2f795fdb1687b7637e932bb1d963093546f2abee11b0 SHA512 fd2eeb95f5e70ed0ede1ba4607eccc1a798fd9ade4db57dde552ee4bce398e75d6745d10a06cf8aae6e5d43d2d4ed30b4528ef4c4ab3e6792045010a54101d0f WHIRLPOOL 07b157d643b233cf0bdf4903bb8d11478a64f9f4274ff58264f80cf33d7655aa558f005b5514a16b09b3b379f823f9782ac0881bd52de71604add1108ae290f7
3
DIST cfengine-3.15.1.tar.gz 3103100 SHA256 ab597456f9d44d907bb5a2e82b8ce2af01e9c59641dc828457cd768ef05a831d SHA512 5a40386f71c40d3f12a0eb0015bcd3cd581bc8604841f5976efac980f400acf0bfcbf4e1e871cf2937f8639dd5905ac4161c53df22a412ec3b478e585a0f26e6 WHIRLPOOL bafeaf0c80ce6b913ebfcd2bf5b02733b37833bc8ea5d3ca21f6f73dd9109875391535c84bb41183fba31773fd6934aa2f580398638fbe319c4987e706622237
3
DIST cfengine-3.6.7.tar.gz 1991420 SHA256 d86da03ed0806b67ae4834a958bf2848c861adeb1ae138d7bfc70526a1c31328 SHA512 15a47419fbccda649fa73e2de6a21f6db903642a7e7ff83a4c6fcd941aa6772fd38ef6793e1d300b3b726ddd72e903c1398a70b924a2648c06685830922a06b6 WHIRLPOOL 2cf0aff0a49cdeb4db9082793ba5ed3d3e2623dfe0ec4dda6076dd7500812ce3f1ae07f36dc90f5beefd2ef6637859a80b5cc759fbe02b7474c3dad0106fa595
4
DIST cfengine-3.6.7.tar.gz 1991420 SHA256 d86da03ed0806b67ae4834a958bf2848c861adeb1ae138d7bfc70526a1c31328 SHA512 15a47419fbccda649fa73e2de6a21f6db903642a7e7ff83a4c6fcd941aa6772fd38ef6793e1d300b3b726ddd72e903c1398a70b924a2648c06685830922a06b6 WHIRLPOOL 2cf0aff0a49cdeb4db9082793ba5ed3d3e2623dfe0ec4dda6076dd7500812ce3f1ae07f36dc90f5beefd2ef6637859a80b5cc759fbe02b7474c3dad0106fa595
4
DIST cfengine-masterfiles-3.10.5.tar.gz 478962 SHA256 7482f106fa66e6b6d7a43a6ad64f062fb8f702e66ff1d0a5f47cb83b59268e57 SHA512 8223503d931557803d4a9af15e91805ae0cad7c79852014462323e9ef93b6d88c0ea72477990937ad8542d2de1728b21807d12a60b831d014d82e7f907ffb569 WHIRLPOOL 668897b728e90f3dc6936872b390b3356de1d1dc99a81d62599414cdb49bc153a9a271d88dbc6e54bb5ab3f79e77db5a5127c94cfef2f132324b61cf102ef641
5
DIST cfengine-masterfiles-3.10.5.tar.gz 478962 SHA256 7482f106fa66e6b6d7a43a6ad64f062fb8f702e66ff1d0a5f47cb83b59268e57 SHA512 8223503d931557803d4a9af15e91805ae0cad7c79852014462323e9ef93b6d88c0ea72477990937ad8542d2de1728b21807d12a60b831d014d82e7f907ffb569 WHIRLPOOL 668897b728e90f3dc6936872b390b3356de1d1dc99a81d62599414cdb49bc153a9a271d88dbc6e54bb5ab3f79e77db5a5127c94cfef2f132324b61cf102ef641
5
DIST cfengine-masterfiles-3.12.2.tar.gz 442207 SHA256 4abeeb23f6c5c50bed6ece5e2ba09d3d485ccccfff88852bf8d2668c73ef2caa SHA512 cb7461cd028fb4ff622097bcf15e78b459c14224795cc3a6d022190c680275438703f37192c6d009c3979287ca22daf105d211cbcf4ba370344a47e4a414b0b1 WHIRLPOOL 269ab4774339eba8d2adc489b06680ebc027e3e8a83f5454dac84051ab880238d7510055b895878e69b2a7b8634df8e8a0f590efde3853e8e3213778b0c152ed
6
DIST cfengine-masterfiles-3.12.2.tar.gz 442207 SHA256 4abeeb23f6c5c50bed6ece5e2ba09d3d485ccccfff88852bf8d2668c73ef2caa SHA512 cb7461cd028fb4ff622097bcf15e78b459c14224795cc3a6d022190c680275438703f37192c6d009c3979287ca22daf105d211cbcf4ba370344a47e4a414b0b1 WHIRLPOOL 269ab4774339eba8d2adc489b06680ebc027e3e8a83f5454dac84051ab880238d7510055b895878e69b2a7b8634df8e8a0f590efde3853e8e3213778b0c152ed
7
DIST cfengine-masterfiles-3.15.1.tar.gz 475038 SHA256 051369054a2e17a4ea1f68a41198fe5377fbbf33f600168246bf0b667fc1ab74 SHA512 efa38b1868c94f97bc8af4c247ec71a8f4e3809b2da2b32d3759010fbea46c369de3bcd4cfc3de318e1278d91d28cf0bea42e2807316c295e608aaebd61bf391 WHIRLPOOL a9cf59f517e36abb92ef3825fc3a4e13d31b392b4a2baf0278dd43057b642c0910b5a1604b9b07da3dde14a7d423c819083cf9337cfb8c4cc3162528e89571cd
6
DIST cfengine-masterfiles-3.6.7.tar.gz 248547 SHA256 ce883925e1b1c891a06e602c9c11a62e0f8e68a4355e66006f4b29de10502a9f SHA512 e179b7065a3d13cc559f0d38bcad202baeda2e7bc98e629df9614db0f7b748b3b0deced7681d86418a7f9a01fd54975761eb4551b82d6866ab0207ffbd55182c WHIRLPOOL d96242d251bb44f87d05aff6215a7a2d5003d8ad5e23fe3e81aab0ac11c56f3835e465428b2af261841e230a01477e31144f4b592abc6d994ea03809a5719934
8
DIST cfengine-masterfiles-3.6.7.tar.gz 248547 SHA256 ce883925e1b1c891a06e602c9c11a62e0f8e68a4355e66006f4b29de10502a9f SHA512 e179b7065a3d13cc559f0d38bcad202baeda2e7bc98e629df9614db0f7b748b3b0deced7681d86418a7f9a01fd54975761eb4551b82d6866ab0207ffbd55182c WHIRLPOOL d96242d251bb44f87d05aff6215a7a2d5003d8ad5e23fe3e81aab0ac11c56f3835e465428b2af261841e230a01477e31144f4b592abc6d994ea03809a5719934
(-)a/net-misc/cfengine/cfengine-3.15.1.ebuild (+138 lines)
Line 0 Link Here
1
# Copyright 1999-2020 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
3
4
EAPI="5"
5
6
inherit eutils autotools flag-o-matic
7
8
MY_PV="${PV//_beta/b}"
9
MY_PV="${MY_PV/_p/p}"
10
MY_P="${PN}-${MY_PV}"
11
12
DESCRIPTION="An automated suite of programs for configuring and maintaining
13
Unix-like computers"
14
HOMEPAGE="http://www.cfengine.org/"
15
SRC_URI="https://cfengine-package-repos.s3.amazonaws.com/tarballs/${MY_P}.tar.gz
16
	masterfiles? ( https://cfengine-package-repos.s3.amazonaws.com/tarballs/${PN}-masterfiles-${MY_PV}.tar.gz )"
17
18
LICENSE="GPL-3"
19
SLOT="3"
20
KEYWORDS="~amd64"
21
22
IUSE="acl curl examples libvirt +lmdb mysql +masterfiles postgres qdbm selinux tokyocabinet vim-syntax xml yaml"
23
24
DEPEND="acl? ( virtual/acl )
25
	mysql? ( virtual/mysql )
26
	postgres? ( dev-db/postgresql )
27
	selinux? ( sys-libs/libselinux )
28
	tokyocabinet? ( dev-db/tokyocabinet )
29
	qdbm? ( dev-db/qdbm )
30
	lmdb? ( dev-db/lmdb )
31
	libvirt? ( app-emulation/libvirt )
32
	xml? ( dev-libs/libxml2:2  )
33
	curl? ( net-misc/curl )
34
	xml? ( dev-libs/libxml2:2  )
35
	yaml? ( dev-libs/libyaml )
36
	dev-libs/openssl
37
	dev-libs/libpcre"
38
RDEPEND="${DEPEND}"
39
PDEPEND="vim-syntax? ( app-vim/cfengine-syntax )"
40
41
REQUIRED_USE="^^ ( qdbm tokyocabinet lmdb )"
42
43
S="${WORKDIR}/${MY_P}"
44
45
src_prepare() {
46
	default
47
	epatch "${FILESDIR}/${P}-ipv6-address.patch"
48
	eautoreconf
49
}
50
51
src_unpack() {
52
	unpack ${MY_P}.tar.gz
53
	if use masterfiles; then
54
		unpack ${PN}-masterfiles-${MY_PV}.tar.gz
55
		mv ${PN}-masterfiles-${MY_PV} masterfiles
56
	fi
57
}
58
59
src_configure() {
60
	# Enforce /var/cfengine for historical compatibility
61
62
	econf \
63
		--enable-fhs \
64
		--docdir=/usr/share/doc/${PF} \
65
		--with-workdir=/var/cfengine \
66
		--with-pcre \
67
		$(use_with acl libacl) \
68
		$(use_with qdbm) \
69
		$(use_with tokyocabinet) \
70
		$(use_with postgres postgresql) \
71
		$(use_with mysql mysql check) \
72
		$(use_with libvirt) \
73
		$(use_with curl libcurl) \
74
		$(use_with xml libxml2) \
75
		$(use_with yaml libyaml) \
76
		$(use_enable selinux)
77
}
78
79
src_install() {
80
	newinitd "${FILESDIR}"/cf-serverd.rc6 cf-serverd || die
81
	newinitd "${FILESDIR}"/cf-monitord.rc6 cf-monitord || die
82
	newinitd "${FILESDIR}"/cf-execd.rc6 cf-execd || die
83
	newconfd "${FILESDIR}"/cfengine3.confd cfengine3
84
85
	emake DESTDIR="${D}" install || die
86
87
	# fix ifconfig path in provided promises
88
	find "${D}"/usr/share -name "*.cf" | xargs sed -i "s,/sbin/ifconfig,$(which ifconfig),g"
89
90
	dodoc AUTHORS
91
92
	if ! use examples; then
93
		rm -rf "${D}"/usr/share/doc/${PF}/example*
94
	fi
95
96
	# Create cfengine working directory
97
	dodir /var/cfengine/bin
98
	fperms 700 /var/cfengine
99
100
	# Copy cfagent into the cfengine tree otherwise cfexecd won't
101
	# find it. Most hosts cache their copy of the cfengine
102
	# binaries here. This is the default search location for the
103
	# binaries.
104
	for bin in promises agent monitord serverd execd runagent key; do
105
		dosym /usr/bin/cf-$bin /var/cfengine/bin/cf-$bin || die
106
	done
107
108
	if use masterfiles; then
109
		insinto /var/cfengine
110
		doins -r "${WORKDIR}/masterfiles"
111
	fi
112
113
	dodir /etc/env.d
114
	echo 'CONFIG_PROTECT=/var/cfengine/masterfiles' >"${ED}/etc/env.d/99${PN}" || die
115
}
116
117
pkg_postinst() {
118
	echo
119
	einfo "Init scripts for cf-serverd, cf-monitord, and cf-execd are provided."
120
	einfo
121
	einfo "To run cfengine out of cron every half hour modify your crontab:"
122
	einfo "0,30 * * * *    /usr/sbin/cf-execd -F"
123
	echo
124
125
	elog "If you run cfengine the very first time, you MUST generate the keys for cfengine by running:"
126
	elog "emerge --config ${CATEGORY}/${PN}"
127
}
128
129
pkg_config() {
130
	if [ "${ROOT}" == "/" ]; then
131
		if [ ! -f "/var/cfengine/ppkeys/localhost.priv" ]; then
132
			einfo "Generating keys for localhost."
133
			/usr/sbin/cf-key
134
		fi
135
	else
136
		die "cfengine cfkey does not support any value of ROOT other than /."
137
	fi
138
}
(-)a/net-misc/cfengine/files/cfengine-3.15.1-ipv6-address.patch (-1 / +257 lines)
Line 0 Link Here
0
- 
1
From 4021058d729fd618e5770300664ecfcc6fd29d5d Mon Sep 17 00:00:00 2001
2
From: Chris Rorvick <chris@rorvick.com>
3
Date: Tue, 28 May 2019 00:44:52 -0500
4
Subject: [PATCH] prefer routable IPv6 addresses over link-local
5
6
Currently the IPv6 address provided for an interface in the $(sys.inet6)
7
data is arbitrary if more than one address is bound to that interface.
8
Given that IPv6 requires all interfaces have a link-local address, this
9
is a common scenario.  Add a mechanism to GetProcFileInfo() to choose
10
between the previous and new entries if more than one is found for an
11
extracted key, and use this mechanism to rank link-local addresses below
12
others.
13
14
Also, the post-processing functions passed to GetProcFileInfo() have a
15
strange return value.  This is seemingly due to a misunderstanding with
16
how function pointer types relate to function definitions.  Clean this
17
up.
18
---
19
 libenv/unix_iface.c | 106 +++++++++++++++++++++++++++++++++++---------
20
 1 file changed, 86 insertions(+), 20 deletions(-)
21
22
diff --git a/libenv/unix_iface.c b/libenv/unix_iface.c
23
index c62e1cb73..0adbb0a7b 100644
24
--- a/libenv/unix_iface.c
25
+++ b/libenv/unix_iface.c
26
@@ -88,6 +88,7 @@ static void InitIgnoreInterfaces(void);
27
 static Rlist *IGNORE_INTERFACES = NULL; /* GLOBAL_E */
28
 
29
 typedef void (*ProcPostProcessFn)(void *ctx, void *json);
30
+typedef JsonElement * (*ProcTiebreakerFn)(JsonElement *prev_item, JsonElement *this_item);
31
 
32
 
33
 /*********************************************************************/
34
@@ -1021,7 +1022,7 @@ static void NetworkingRoutesPostProcessInfo(
35
 # endif
36
 }
37
 
38
-static ProcPostProcessFn NetworkingIPv6RoutesPostProcessInfo(
39
+static void NetworkingIPv6RoutesPostProcessInfo(
40
     ARG_UNUSED void *passed_ctx, ARG_LINUX_ONLY void *json)
41
 {
42
 # if defined (__linux__)
43
@@ -1054,10 +1055,9 @@ static ProcPostProcessFn NetworkingIPv6RoutesPostProcessInfo(
44
     // like we do with IPv4 routes
45
 
46
 # endif
47
-    return NULL;
48
 }
49
 
50
-static ProcPostProcessFn NetworkingIPv6AddressesPostProcessInfo(ARG_UNUSED void *passed_ctx, void *json)
51
+static void NetworkingIPv6AddressesPostProcessInfo(ARG_UNUSED void *passed_ctx, void *json)
52
 {
53
     JsonElement *entry = json;
54
 
55
@@ -1066,7 +1066,50 @@ static ProcPostProcessFn NetworkingIPv6AddressesPostProcessInfo(ARG_UNUSED void
56
     JsonExtractParsedNumber(entry, "raw_device_number", "device_number", true, false);
57
     JsonExtractParsedNumber(entry, "raw_prefix_length", "prefix_length", true, false);
58
     JsonExtractParsedNumber(entry, "raw_scope", "scope", true, false);
59
-    return NULL;
60
+}
61
+
62
+static unsigned RankIPv6Address(const char *address)
63
+{
64
+    unsigned long first_word = 0;
65
+    char *end;
66
+
67
+    if (address == NULL)
68
+    {
69
+        return 0;
70
+    }
71
+
72
+    first_word = strtoul(address, &end, 16);
73
+
74
+    if (*end != ':')
75
+    {
76
+        return 0;  // invalid IPv6 address?
77
+    }
78
+
79
+    if ((first_word & 0xffc0) == 0xfe80)
80
+    {
81
+        // link-local (fe80:://10)
82
+
83
+        return 1;
84
+    }
85
+    else
86
+    {
87
+        return 2;
88
+    }
89
+}
90
+
91
+static JsonElement *NetworkingIPv6AddressesTiebreaker(JsonElement *prev_item, JsonElement *this_item)
92
+{
93
+    const char *prev_addr = JsonObjectGetAsString(prev_item, "address");
94
+    const char *this_addr = JsonObjectGetAsString(this_item, "address");
95
+
96
+    if (RankIPv6Address(this_addr) >= RankIPv6Address(prev_addr))
97
+    {
98
+        return this_item;
99
+    }
100
+    else
101
+    {
102
+        return prev_item;
103
+    }
104
 }
105
 
106
 /*******************************************************************/
107
@@ -1095,7 +1138,7 @@ static const char* GetPortStateString(ARG_LINUX_ONLY int state)
108
 
109
 // used in evalfunction.c but defined here so
110
 // JsonRewriteParsedIPAddress() etc. can stay local
111
-ProcPostProcessFn NetworkingPortsPostProcessInfo(ARG_UNUSED void *passed_ctx, void *json)
112
+void NetworkingPortsPostProcessInfo(ARG_UNUSED void *passed_ctx, void *json)
113
 {
114
     JsonElement *conn = json;
115
 
116
@@ -1112,8 +1155,6 @@ ProcPostProcessFn NetworkingPortsPostProcessInfo(ARG_UNUSED void *passed_ctx, vo
117
             JsonObjectAppendString(conn, "state", GetPortStateString(num_state));
118
         }
119
     }
120
-
121
-    return NULL;
122
 }
123
 
124
 /*******************************************************************/
125
@@ -1180,7 +1221,7 @@ static JsonElement* GetNetworkingStatsInfo(const char *filename)
126
 // always returns the parsed data. If the key is not NULL, also
127
 // creates a sys.KEY variable.
128
 
129
-JsonElement* GetProcFileInfo(EvalContext *ctx, const char* filename, const char* key, const char* extracted_key, ProcPostProcessFn post, const char* regex)
130
+JsonElement* GetProcFileInfo(EvalContext *ctx, const char* filename, const char* key, const char* extracted_key, ProcPostProcessFn post, ProcTiebreakerFn tiebreak, const char* regex)
131
 {
132
     JsonElement *info = NULL;
133
     bool extract_key_mode = (extracted_key != NULL);
134
@@ -1218,14 +1259,39 @@ JsonElement* GetProcFileInfo(EvalContext *ctx, const char* filename, const char*
135
 
136
                     if (extract_key_mode)
137
                     {
138
-                        if (JsonObjectGetAsString(item, extracted_key) == NULL)
139
+                        const char *extracted_key_value = JsonObjectGetAsString(item, extracted_key);
140
+
141
+                        if (extracted_key_value == NULL)
142
                         {
143
                             Log(LOG_LEVEL_ERR, "While parsing %s, looked to extract key %s but couldn't find it in line %s", filename, extracted_key, line);
144
                         }
145
                         else
146
                         {
147
-                            Log(LOG_LEVEL_DEBUG, "While parsing %s, got key %s from line %s", filename, JsonObjectGetAsString(item, extracted_key), line);
148
-                            JsonObjectAppendElement(info, JsonObjectGetAsString(item, extracted_key), item);
149
+                            JsonElement *prev_item = JsonObjectGet(info, extracted_key_value);
150
+
151
+                            Log(LOG_LEVEL_DEBUG, "While parsing %s, got key %s from line %s", filename, extracted_key_value, line);
152
+
153
+                            if (prev_item != NULL && tiebreak != NULL)
154
+                            {
155
+                                JsonElement *winner = (*tiebreak)(prev_item, item);
156
+
157
+                                if (winner == prev_item)
158
+                                {
159
+                                    Log(LOG_LEVEL_DEBUG, "Multiple entries for key %s, preferring previous value", extracted_key_value);
160
+
161
+                                    JsonDestroy(item);
162
+                                    item = NULL;
163
+                                }
164
+                                else
165
+                                {
166
+                                    Log(LOG_LEVEL_DEBUG, "Multiple entries for key %s, preferring new value", extracted_key_value);
167
+                                }
168
+                            }
169
+
170
+                            if (item != NULL)
171
+                            {
172
+                                JsonObjectAppendElement(info, extracted_key_value, item);
173
+                            }
174
                         }
175
                     }
176
                     else
177
@@ -1274,7 +1340,7 @@ void GetNetworkingInfo(EvalContext *ctx)
178
     }
179
 
180
     BufferPrintf(pbuf, "%s/proc/net/route", procdir_root);
181
-    JsonElement *routes = GetProcFileInfo(ctx, BufferData(pbuf),  NULL, NULL, (ProcPostProcessFn) &NetworkingRoutesPostProcessInfo,
182
+    JsonElement *routes = GetProcFileInfo(ctx, BufferData(pbuf),  NULL, NULL, &NetworkingRoutesPostProcessInfo, NULL,
183
                     // format: Iface	Destination	Gateway 	Flags	RefCnt	Use	Metric	Mask		MTU	Window	IRTT
184
                     //         eth0	00000000	0102A8C0	0003	0	0	1024	00000000	0	0	0
185
                     "^(?<interface>\\S+)\\t(?<raw_dest>[[:xdigit:]]+)\\t(?<raw_gw>[[:xdigit:]]+)\\t(?<raw_flags>[[:xdigit:]]+)\\t(?<refcnt>\\d+)\\t(?<use>\\d+)\\t(?<metric>[[:xdigit:]]+)\\t(?<raw_mask>[[:xdigit:]]+)\\t(?<mtu>\\d+)\\t(?<window>\\d+)\\t(?<irtt>[[:xdigit:]]+)");
186
@@ -1322,7 +1388,7 @@ void GetNetworkingInfo(EvalContext *ctx)
187
     JsonElement *inet6 = JsonObjectCreate(3);
188
 
189
     BufferPrintf(pbuf, "%s/proc/net/snmp6", procdir_root);
190
-    JsonElement *inet6_stats = GetProcFileInfo(ctx, BufferData(pbuf), NULL, NULL, NULL,
191
+    JsonElement *inet6_stats = GetProcFileInfo(ctx, BufferData(pbuf), NULL, NULL, NULL, NULL,
192
                                                "^\\s*(?<key>\\S+)\\s+(?<value>\\d+)");
193
 
194
     if (inet6_stats != NULL)
195
@@ -1348,7 +1414,7 @@ void GetNetworkingInfo(EvalContext *ctx)
196
     }
197
 
198
     BufferPrintf(pbuf, "%s/proc/net/ipv6_route", procdir_root);
199
-    JsonElement *inet6_routes = GetProcFileInfo(ctx, BufferData(pbuf),  NULL, NULL, (ProcPostProcessFn) &NetworkingIPv6RoutesPostProcessInfo,
200
+    JsonElement *inet6_routes = GetProcFileInfo(ctx, BufferData(pbuf),  NULL, NULL, &NetworkingIPv6RoutesPostProcessInfo, NULL,
201
                     // format: dest                    dest_prefix source                source_prefix next_hop                         metric   refcnt   use      flags        interface
202
                     //         fe800000000000000000000000000000 40 00000000000000000000000000000000 00 00000000000000000000000000000000 00000100 00000000 00000000 00000001     eth0
203
                     "^(?<raw_dest>[[:xdigit:]]+)\\s+(?<dest_prefix>[[:xdigit:]]+)\\s+"
204
@@ -1363,7 +1429,7 @@ void GetNetworkingInfo(EvalContext *ctx)
205
     }
206
 
207
     BufferPrintf(pbuf, "%s/proc/net/if_inet6", procdir_root);
208
-    JsonElement *inet6_addresses = GetProcFileInfo(ctx, BufferData(pbuf),  NULL, "interface", (ProcPostProcessFn) &NetworkingIPv6AddressesPostProcessInfo,
209
+    JsonElement *inet6_addresses = GetProcFileInfo(ctx, BufferData(pbuf),  NULL, "interface", &NetworkingIPv6AddressesPostProcessInfo, &NetworkingIPv6AddressesTiebreaker,
210
                     // format: address device_number prefix_length scope flags interface_name
211
                     // 00000000000000000000000000000001 01 80 10 80       lo
212
                     // fe80000000000000004249fffebdd7b4 04 40 20 80  docker0
213
@@ -1387,7 +1453,7 @@ void GetNetworkingInfo(EvalContext *ctx)
214
 
215
     BufferPrintf(pbuf, "%s/proc/net/dev", procdir_root);
216
     JsonElement *interfaces_data =
217
-    GetProcFileInfo(ctx, BufferData(pbuf), "interfaces_data", "device", NULL,
218
+    GetProcFileInfo(ctx, BufferData(pbuf), "interfaces_data", "device", NULL, NULL,
219
                     "^\\s*(?<device>[^:]+)\\s*:\\s*"
220
                     // All of the below are just decimal digits separated by spaces
221
                     "(?<receive_bytes>\\d+)\\s+"
222
@@ -1420,28 +1486,28 @@ JsonElement* GetNetworkingConnections(EvalContext *ctx)
223
     Buffer *pbuf = BufferNew();
224
 
225
     BufferPrintf(pbuf, "%s/proc/net/tcp", procdir_root);
226
-    data = GetProcFileInfo(ctx, BufferData(pbuf), NULL, NULL, (ProcPostProcessFn) &NetworkingPortsPostProcessInfo, ports_regex);
227
+    data = GetProcFileInfo(ctx, BufferData(pbuf), NULL, NULL, &NetworkingPortsPostProcessInfo, NULL, ports_regex);
228
     if (data != NULL)
229
     {
230
         JsonObjectAppendElement(json, "tcp", data);
231
     }
232
 
233
     BufferPrintf(pbuf, "%s/proc/net/tcp6", procdir_root);
234
-    data = GetProcFileInfo(ctx, BufferData(pbuf), NULL, NULL, (ProcPostProcessFn) &NetworkingPortsPostProcessInfo, ports_regex);
235
+    data = GetProcFileInfo(ctx, BufferData(pbuf), NULL, NULL, &NetworkingPortsPostProcessInfo, NULL, ports_regex);
236
     if (data != NULL)
237
     {
238
         JsonObjectAppendElement(json, "tcp6", data);
239
     }
240
 
241
     BufferPrintf(pbuf, "%s/proc/net/udp", procdir_root);
242
-    data = GetProcFileInfo(ctx, BufferData(pbuf), NULL, NULL, (ProcPostProcessFn) &NetworkingPortsPostProcessInfo, ports_regex);
243
+    data = GetProcFileInfo(ctx, BufferData(pbuf), NULL, NULL, &NetworkingPortsPostProcessInfo, NULL, ports_regex);
244
     if (data != NULL)
245
     {
246
         JsonObjectAppendElement(json, "udp", data);
247
     }
248
 
249
     BufferPrintf(pbuf, "%s/proc/net/udp6", procdir_root);
250
-    data = GetProcFileInfo(ctx, BufferData(pbuf), NULL, NULL, (ProcPostProcessFn) &NetworkingPortsPostProcessInfo, ports_regex);
251
+    data = GetProcFileInfo(ctx, BufferData(pbuf), NULL, NULL, &NetworkingPortsPostProcessInfo, NULL, ports_regex);
252
     if (data != NULL)
253
     {
254
         JsonObjectAppendElement(json, "udp6", data);
255
-- 
256
2.24.1
257

Return to bug 690918