Repository : ssh://git@diktynna/alfred
On branch : master
>---------------------------------------------------------------
commit e9a3bfcddb20d935de77400fbfbde601c5f46004
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Mon Feb 15 21:01:26 2021 +0100
alfred: Allow start of server without valid interface
The alfred server always needs interfaces to operate on. But these
interfaces might not exist at the moment when the daemon process is
started. This caused an error and stopped the process.
But alfred is able to deal with interfaces which disappeared at runtime but
existed at startup. To force a similar behavior for the alfred startup, the
parameter "--force" or "-f" is introduced.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
e9a3bfcddb20d935de77400fbfbde601c5f46004
alfred.h | 1 +
main.c | 7 ++++++-
man/alfred.8 | 3 +++
server.c | 5 +++--
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/alfred.h b/alfred.h
index c64ff17..ac08253 100644
--- a/alfred.h
+++ b/alfred.h
@@ -117,6 +117,7 @@ struct globals {
int clientmode_version;
uint8_t verbose:1;
uint8_t ipv4mode:1;
+ uint8_t force:1;
int unix_sock;
const char *unix_path;
diff --git a/main.c b/main.c
index f25b6cc..e190d42 100644
--- a/main.c
+++ b/main.c
@@ -164,6 +164,7 @@ static struct globals *alfred_init(int argc, char *argv[])
{"version", no_argument, NULL, 'v'},
{"verbose", no_argument, NULL, 'd'},
{"sync-period", required_argument, NULL, 'p'},
+ {"force", no_argument, NULL, 'f'},
{NULL, 0, NULL, 0},
};
@@ -184,6 +185,7 @@ static struct globals *alfred_init(int argc, char *argv[])
globals->unix_path = ALFRED_SOCK_PATH_DEFAULT;
globals->verbose = false;
globals->ipv4mode = false;
+ globals->force = false;
globals->update_command = NULL;
globals->sync_period.tv_sec = ALFRED_INTERVAL;
globals->sync_period.tv_nsec = 0;
@@ -191,7 +193,7 @@ static struct globals *alfred_init(int argc, char *argv[])
time_random_seed();
- while ((opt = getopt_long(argc, argv, "ms:r:hi:b:vV:M:I:u:dc:p:4:", long_options,
+ while ((opt = getopt_long(argc, argv, "ms:r:hi:b:vV:M:I:u:dc:p:4:f", long_options,
&opt_ind)) != -1) {
switch (opt) {
case 'r':
@@ -273,6 +275,9 @@ static struct globals *alfred_init(int argc, char *argv[])
inet_pton(AF_INET, optarg, &alfred_mcast.ipv4);
printf(" ** IPv4 Multicast Mode: %x\n", alfred_mcast.ipv4.s_addr);
break;
+ case 'f':
+ globals->force = true;
+ break;
case 'h':
default:
alfred_usage();
diff --git a/man/alfred.8 b/man/alfred.8
index 25591be..e965db8 100644
--- a/man/alfred.8
+++ b/man/alfred.8
@@ -72,6 +72,9 @@ Collect data from the network and prints it on the network
\fB\-d\fP, \fB\-\-verbose\fP
Show extra information in the data output
.TP
+\fB\-d\fP, \fB\-\-force\fP
+Start server even when batman-adv or interface(s) are not yet available.
+.TP
\fB\-V\fP, \fB\-\-req\-version\fP \fIversion\fP
Specify the data version set for \fB\-s\fP
diff --git a/server.c b/server.c
index eb2bc8a..b4925e7 100644
--- a/server.c
+++ b/server.c
@@ -386,14 +386,15 @@ int alfred_server(struct globals *globals)
}
if (strcmp(globals->mesh_iface, "none") != 0 &&
- batadv_interface_check(globals->mesh_iface) < 0) {
+ batadv_interface_check(globals->mesh_iface) < 0 &&
+ !globals->force) {
fprintf(stderr, "Can't start server: batman-adv interface %s not found\n",
globals->mesh_iface);
return -1;
}
num_socks = netsock_open_all(globals);
- if (num_socks <= 0) {
+ if (num_socks <= 0 && !globals->force) {
fprintf(stderr, "Failed to open interfaces\n");
return -1;
}
Repository : ssh://git@diktynna/alfred
On branch : master
>---------------------------------------------------------------
commit d1833e90a46d1cfede031e3e2ae1365bc3fdd6dd
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Mon Feb 15 21:01:23 2021 +0100
alfred: Show error message for invalid batadv interface
The alfred server process always stopped without any informational message
when the provided batman-adv was not "none" and was not accessible. This
made it extremely hard to debug the reason why alfred directly stopped
after launching it.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
d1833e90a46d1cfede031e3e2ae1365bc3fdd6dd
server.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/server.c b/server.c
index fc27246..efac5ad 100644
--- a/server.c
+++ b/server.c
@@ -385,8 +385,11 @@ int alfred_server(struct globals *globals)
}
if (strcmp(globals->mesh_iface, "none") != 0 &&
- batadv_interface_check(globals->mesh_iface) < 0)
+ batadv_interface_check(globals->mesh_iface) < 0) {
+ fprintf(stderr, "Can't start server: batman-adv interface %s not found\n",
+ globals->mesh_iface);
return -1;
+ }
num_socks = netsock_open_all(globals);
if (num_socks <= 0) {
Repository : ssh://git@diktynna/alfred
On branch : master
>---------------------------------------------------------------
commit 213da34eab7986a9f50065ac5ca2359b8e68b54f
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Mon Feb 15 21:01:24 2021 +0100
alfred: Allow exactly one interface for secondary mode
A primary alfred daemon allows syncing over more than one interface. But
the secondary alfred daemon needs exactly one interface. But the check for
this property was insufficient because it allowed paramters like
"-i wlan0,asd" when wlan0 is valid and asd is not valid.
The better solution is to really use the number of interfaces given to
alfred instead of the number of interfaces evaluated as "valid".
Fixes: 67ae5f57eedd ("alfred: Add support for multiple interfaces per master")
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
213da34eab7986a9f50065ac5ca2359b8e68b54f
alfred.h | 1 +
netsock.c | 11 +++++++++++
server.c | 4 +++-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/alfred.h b/alfred.h
index 1e2c058..7d6b0b3 100644
--- a/alfred.h
+++ b/alfred.h
@@ -182,6 +182,7 @@ int unix_sock_req_data_finish(struct globals *globals,
int vis_update_data(struct globals *globals);
/* netsock.c */
int netsock_open_all(struct globals *globals);
+size_t netsocket_count_interfaces(struct globals *globals);
void netsock_close_all(struct globals *globals);
int netsock_set_interfaces(struct globals *globals, char *interfaces);
struct interface *netsock_first_interface(struct globals *globals);
diff --git a/netsock.c b/netsock.c
index 367b207..84b0ec3 100644
--- a/netsock.c
+++ b/netsock.c
@@ -471,6 +471,17 @@ int netsock_open_all(struct globals *globals)
return num_socks;
}
+size_t netsocket_count_interfaces(struct globals *globals)
+{
+ struct interface *interface;
+ size_t count = 0;
+
+ list_for_each_entry(interface, &globals->interfaces, list)
+ count++;
+
+ return count;
+}
+
void netsock_reopen(struct globals *globals)
{
struct interface *interface;
diff --git a/server.c b/server.c
index efac5ad..eb2bc8a 100644
--- a/server.c
+++ b/server.c
@@ -371,6 +371,7 @@ int alfred_server(struct globals *globals)
int maxsock, ret, recvs;
struct timespec last_check, now, tv;
fd_set fds, errfds;
+ size_t num_interfaces;
int num_socks;
if (create_hashes(globals))
@@ -397,7 +398,8 @@ int alfred_server(struct globals *globals)
return -1;
}
- if (num_socks > 1 && globals->opmode == OPMODE_SECONDARY) {
+ num_interfaces = netsocket_count_interfaces(globals);
+ if (num_interfaces > 1 && globals->opmode == OPMODE_SECONDARY) {
fprintf(stderr, "More than one interface specified in secondary mode\n");
return -1;
}
The annotated tag, v4.19.176 has been created
at e55283fb58912b0e24f4f3de32bf9e2f751bffe0 (tag)
tagging 255b58a2b3af0baa0ee11507390349217b8b73b0 (commit)
replaces v4.19.169
tagged by Greg Kroah-Hartman
on Sat Feb 13 13:52:08 2021 +0100
- Shortlog ------------------------------------------------------------
This is the 4.19.176 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmAny3gACgkQONu9yGCS
aT4MmQ/9E2NZRb+tAheddFN7G5CsWTtPPLN+pqYJoYPQPyVUH4P9CcxaY/RyWHbs
vE+LaHEsMtDvrYY/zEBxBfb1xY6zevNK1it4JEzxYEbl8L2obNATbyNfY8jFjaUP
fb2ozowi+cUOUJNiFDjaMW0D19sV26QdMnCgBGWE5KMcQAsJZhwfJyXFdDH94CKc
Eyb8zTYa4vJw/VCjI3TmidsDa4Ni05PuQpJ4kxXkfQtAZVk/zAA1d06JKJBN2Wkg
EP9wg2WT0ydoqchkmO8rxkLp83Mjb+czwPnHD+sxNKU4A5cwd+kxkkSgRauOJgIF
ZZzRpCCfQIfFhR67XzP7CcovaddLBiV3CT2JM3Y1Qba3yJQYik2OkZagtTqPQTys
Z3UyY77aoqT0N7QSnZ3Y9oZqvSbvGy1n42SrCXRf12xcvZv1qsTk3oHh6IFCefcj
I9au5NNbg8YI0JeciqM8RnbRCgwbhBMOjBQt4RB/pVp+xMDEKjEYznTB9DZGpxtz
M8nBYZk1+rWK9wvcmFSYqF1I31sD+0NtDCRlTHia1YQM0r1Th4rO1sNJwl3CFTIZ
TD1bqzsWs1pyMPtBsTPj9jXAFemamBtVCC5WsG2Dv1BvY+wSc2zweRk6j7uLOc5t
wpq6AOM++Hz6l1hnC5gP92+cUMq0plhkBRkDpOJbRlmVuZxg8lM=
=+d6M
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
The annotated tag, v5.10.16 has been created
at 1302b295c2178266649f016757d3ed136ff7f933 (tag)
tagging de53befa79cfd74c01fbbdeb45c700b3e9e13011 (commit)
replaces v5.10.9
tagged by Greg Kroah-Hartman
on Sat Feb 13 13:57:27 2021 +0100
- Shortlog ------------------------------------------------------------
This is the 5.10.16 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmAnzLcACgkQONu9yGCS
aT5FUQ/+LUBYHpWjyV1wrnjwf3AAtcUnZGtPUOEsv9d9lAcituistag2zHXive9g
K7HGria7BVcARnAtdcOLWB7ur9Vj+Ch1XVOVhSdI8EgGPslxoWKxmM03FQtSjQak
OYZAHc/A/mrTtG+rYROx4gp+jxaiaUx8e/zleFgNeN1GU9/owR2H8+d/a2L3bnzN
mgaYG4/0GTy1JfDXwsmiNa376dIViPAkukjS8AV+dPZKFag+TmcE0d/qTtDlmiQO
gSboV/8FzwKgUIxjOt6Rw6AniCfGTew/Dy/NkRiGB4ge5+aMZe78+IZ6xzRlbVix
d1/+7Iviy40pTWOZdRxwefAj0/MS9zZeVrDSA/Ips24EfD/0qxq9QEa3cEXvQkZF
ih5AX9obPBxHRsFwn7x9siP3ZW1W2jaEYzrXxIWBJxFDVRRh3/DMo5rljSkUWxzS
8dBpxfNiRMggsbgKPBtuV5+4Dzdbx5Dn1sbaMgT9pU1f+U0LH0KjIU1evuCFqUo6
C/Y61pDjc8GotBFuKjcbCYBMWpAJ/UwqRn4HrMBRMN+ZOpBQr/2RLaM8ROla8H3W
GrhADQlDuHForKHRuiuBpaUxZGLeZw2dpZClrV0WwzHLLV0KsQC0+xE9ge0/GPtQ
rnJPxYiKg2WJctVBlH2i5uLw6s25+dq4ufSZBmr2AOg8u0YccU4=
=BFeH
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
The annotated tag, v4.4.257 has been created
at 3bf3bba5d751029b20e2457e548d43a808713cf2 (tag)
tagging 788437ba4c80d0d5e32ceaa28f872343e87236f5 (commit)
replaces v4.4.252
tagged by Greg Kroah-Hartman
on Wed Feb 10 09:08:35 2021 +0100
- Shortlog ------------------------------------------------------------
This is the 4.4.257 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmAjlIMACgkQONu9yGCS
aT4FyQ/9H35E2oCiJilJwGoaxRGiKleEdkHByxVOwJh1LcEniQz8IM+NlQQUvWxh
sRDQtT7gUPokkKSuDRjwTtymlNl26c4TNlZQbYx9IXT68EknASplx4DBHveMGMUz
K3WrOrvqP/zyVZ8y7VodssbKYJQN1LplyMpP9W/NgUA82SyLQtuVJaDB9dGpWvMP
eultdlNcjvUPrrEHtsBD/sJlTxe4H1ZWjonVmARc8oFdMzG/DMuMaJ3l9mqHYD+l
PCapYgvl4/rMsnSa/Sp9uButQn30cWHauv4562CuA/uYKxIoHuVTwuW0/WYNwa9q
CO1THotRGXljap6EVVFQKJoLmOEsiV/5oTcpTmc2my6vHA3+M2uErf1uMYKxSuV1
Lb5eYdMX3Er981XPcdxuNiFbUAG5igmncWGk/bxIm1rbwbRfR5oa+xeC0xcoS83O
EW2NMDfaRv3XPAzYUFSKUgr6bLgQeoj9DWMojbzq3Gm6KsxaRvv8Z2/l5YOojCHS
8+SCadhHBmCQSfVDpp72lUo9RnHhqg8tyuzUJA+zz1QWEMbVQbYShIW4vRYPC3fQ
MLQnL1JMN8EGK33IpJfShBPyTR11QL5F7flYyTOzeOr9F6EeuuEF18gdLZr26U72
VEHXeeSyzvtE+9deKkNyt6ReMeOSbleIYJli1sZsalQ8zCSmY2A=
=ELej
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
The annotated tag, v4.9.257 has been created
at 4b7be2ce552100a05f91429c073cf1b875825983 (tag)
tagging 282aeb477a10d09cc5c4d73c54bb996964723f96 (commit)
replaces v4.9.252
tagged by Greg Kroah-Hartman
on Wed Feb 10 09:11:24 2021 +0100
- Shortlog ------------------------------------------------------------
This is the 4.9.257 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmAjlSwACgkQONu9yGCS
aT7fjxAAr3clxgvJdin4DFaqMm0QrAt/PtkMSgHxRAjnPPnYjMBhBZW1mdCusJJz
7fvo4/9yiyjAdHnBeK7JRoh5kHVvXpU0/aJNfvb/KHRGsc2fc6q4LE1UJZB6lf5e
ZgkSXMPI26dt+/5smC4jNaXIkP8oTdBxoFC7A10U5ecdhNDPDU5+G9wXsoyejnJc
T1n64PqkQLDRQdWUpP/eEut6x6dcnFLQhAjUjo/BkIs5IXq6AOR1D28aVL3PQKV6
p1sj6TUfljzC2KoBxUI9jp0eBEbUMEwST64PTfTQgyeOpeFItVc/8QG087W+zq4a
dyP9GuLv4dalu+dOgMYVWxTxbMKUAexLt97CO8O+h08I46RYIVZiVXfwGXZKdd1w
AnMU5L3Hopi6AMiaRPGrfXGA6RNvAVi7A227ZUQdqCGkYb/SkC2NHfJxjKAz2db9
W2UDDm/1i63c5KDklryO1VS2ksqGefraPeqGlNxJEKX5zkWRzYeYYvBNapsF9DU3
Hu5GY0ZNI5Liaw2c3RXqI9vCtNfn1SZubRnfaRQi2ZYZ7tbBRpY3ZG0uUn4CSftx
Ap6bKkU9VuL8GzXlXrDH49ON68zak9rDgP3UvoRmnlUVZTh2ebMj4PsR0IqT/jBR
zG46bLFlYTiqZ/PgVJ1hSNE83udcscREMbWo0ojwUfB++S5C+fo=
=58mj
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
The annotated tag, v5.4.98 has been created
at cdb5addf4b074799b20280e6f4cd918fb651803f (tag)
tagging 5b9a4104c902d7dec14c9e3c5652a638194487c6 (commit)
replaces v5.4.91
tagged by Greg Kroah-Hartman
on Sat Feb 13 13:53:32 2021 +0100
- Shortlog ------------------------------------------------------------
This is the 5.4.98 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmAny8wACgkQONu9yGCS
aT5XuRAAjzsVxZkZ6byH8lp14okwQnkb+hX4K0nZ85EM2YwVlC74CbIK/qjhfzGQ
dfNk/j1nZKUzbLFkUK+/2iA7Bc5Mr4frU1dXMYQyGmkcAXqTOw4pe6CFLM+N0Iuf
c0503XY/K+A6Yb2cRCs0HrIIxG+GbGWk0R2H/R4k7lsnqWRogLYvoyzxY49Hqbov
0hG6yGIjxP2H1/pYNDGuQ7lU+2w1JDcDi/OrNqoTwLcxefNSDm9cQQAZEUbfVhpz
jQBA/rW+UUg6bv7jG/ixARXS6HytLRScKCuhiCkogj8SC4h9n1NhU++S3lZGq3PM
rTeO4T8zPeJcChngUrp34pIskVqWQgXraMvhqKmyviCjc2H+6UgR4DINY65xNhpf
nqLFVkbL2V8Fg2D2kZWMAV/LKMWe/1L69WQ2z8vqxk3ro9jxVEHLaVoPCVHzslm2
IeUIat5t/sT6QAwnGxk7bxAaEvfGXE+y5Xv/gLbUBCsM7zYTWlXPy24isB0dTpkd
PlLMtNyABlUynE6pczs8O5hDB9y9kllcEWTDJO07M5rYS4+e2Xb4ruXKgsvdsQJx
ZMvrzr9JmtwqI5Rt5aub4qFPyGbknPP6uQlQUhtn3wkYfPNbLyR1TtC4I0FhtwNg
CTa8E5xbPGNTfZ0WqWQZ17GtN+INk2iYGC4bZIurYEmGVn6hcJs=
=EcIY
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration
The annotated tag, v4.14.221 has been created
at f6a233fd5631e71d9f29869647db96eee1c86db9 (tag)
tagging 29c52025152bab4c557d8174da58f1a4c8e70438 (commit)
replaces v4.14.216
tagged by Greg Kroah-Hartman
on Wed Feb 10 09:15:11 2021 +0100
- Shortlog ------------------------------------------------------------
This is the 4.14.221 stable release
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmAjlg8ACgkQONu9yGCS
aT5mCBAAzCiuoQqGE1Ht9npbPq4BHNgnVgKZQVjMUpo8Rhuqq+qEMQuNUMsgty9N
5Nyvsrxax6cNOFL7e3I+yfxj4+RZKF5Ami2Skovdn7ZfqC2RE30VeCVm+avR6z6j
yKADjavbHCU3amPSZph5bKlFqN8DrZoqvKX3hAffYWAqEFxttKucnAuqFtYxZWVz
kqmLQgoNJ7acXBqJWWPXxBRP6mr/HDGmiWEQsXOkgK7/R1AGwvHzvzcDagwE4lHJ
oKH9l/xR/U7ePFK0y4Gvo3DkEl3t793Kaf7eyZeCxrztQmZn1UmdE4gZ/P2ofpRm
gZu7bS9t1S5xhXv+OHLINscI2mFqKoYftS8KherFb6voHiT4YEpS9QY3EJBavED1
x9orBCFOkO/SBRARxiWbrGb1EBOshMsZvIxw84eFf5OVGUwP20PL+v6slx3tArA6
93HXwTF/dSCK0Xd63j2cFiCs/PqslbAUJRyGuyrA0Edh6imsOdBNdtGTrj70dLZ/
3MeGA33MhEpAFQSx9up99zlaqDa901cZPgWRrsKa+YYmsmL+kmBnnu1pjMTSgcj8
wOvKfjZVnXl1IZGHaaudL4gxs4WF52qnbnOm7y3mElNmiBboB8Rqlw8ITeJyKpDY
KHCAQUIBHGUg9x2Wb4IbkV9dIYnHMLtiY/OuqG8Alg8nvWgZqRI=
=AvJ2
-----END PGP SIGNATURE-----
-----------------------------------------------------------------------
--
linux integration