Yu Watanabe
80df8f2518
missing: support old linux/fou.h
...
linux/fou.h was introduced in 3.18.
FOU_ATTR_REMCSUM_NOPARTIAL was added in 4.0.
FOU_CMD_GET was added in 4.1.
Follow-up for 53cb501a13 .
Fixes #10474 .
2018-10-21 22:34:28 +09:00
Yu Watanabe
14cb109d45
tree-wide: replace 'unsigned int' with 'unsigned'
2018-10-19 22:19:12 +02:00
Lennart Poettering
347a19343c
Merge pull request #10462 from yuwata/test-sd-device-monitor
...
Add tests for sd_device_monitor and small cleanups
2018-10-19 22:05:50 +02:00
Lennart Poettering
490c5a37cb
tree-wide: some automatic coccinelle fixes ( #10463 )
...
Nothing fancy, just coccinelle doing its work.
2018-10-20 00:07:46 +09:00
Yu Watanabe
aaa5b4cec7
test: add tests for sd_device_monitor
2018-10-19 18:07:53 +09:00
Lennart Poettering
6ab1853953
Merge pull request #10460 from yuwata/setsockopt_int-more
...
tree-wide: use setsockopt_int() more
2018-10-19 10:12:00 +02:00
Yu Watanabe
b58d4d2d4f
sd-device-monitor: include error cause in log message
2018-10-19 11:57:54 +09:00
Yu Watanabe
a537eafe1d
sd-device-monitor: drop unnecessary condition
2018-10-19 11:57:29 +09:00
Yu Watanabe
17acb7ef9a
Merge pull request #10450 from poettering/foreach-line-excorcism
...
FOREACH_LINE excorcism
2018-10-19 08:44:51 +09:00
Yu Watanabe
218b4609d0
Merge pull request #10447 from poettering/fgets-excorcism
...
let's get rid of fgets()
2018-10-19 08:36:01 +09:00
Yu Watanabe
9e5b649655
tree-wide: use setsockopt_int() more
2018-10-19 05:52:42 +09:00
Lennart Poettering
2ff48e981e
tree-wide: introduce setsockopt_int() helper and make use of it everywhere
...
As suggested by @heftig:
https://github.com/systemd/systemd/commit/6d5e65f6454212cd400d0ebda34978a9f20cc26a#commitcomment-30938667
2018-10-18 19:50:29 +02:00
Lennart Poettering
849d653a4e
Merge pull request #10239 from yuwata/sd-device-monitor
...
sd-device: introduce sd_device_monitor
2018-10-18 18:30:38 +02:00
Lennart Poettering
c0815ca93d
Merge pull request #10407 from yuwata/netlink-slot
...
sd-netlink: introduce sd_netlink_slot object and relevant functions
2018-10-18 18:05:58 +02:00
Lennart Poettering
710bf2aeb2
sd-path: FOREACH_LINE exorcism
2018-10-18 16:23:45 +02:00
Lennart Poettering
8ae29228a8
bus-creds: FOREACH_LINE excorcism
2018-10-18 16:23:45 +02:00
Lennart Poettering
32d621e4db
hwdb: fgets() excorcism
2018-10-18 13:39:41 +02:00
Yu Watanabe
b1c097af8d
sd-device: introduce sd_device_monitor
2018-10-17 03:30:54 +09:00
Yu Watanabe
90c88092e6
tree-wide: use CMP() macro where applicable
...
Follow-up for 6dd91b3682 .
2018-10-16 19:55:38 +02:00
Yu Watanabe
8da2f9e807
Merge pull request #10412 from poettering/sockaddr-sun-path
...
various fixes related to struct sockaddr_un handling
2018-10-17 01:25:58 +09:00
Lennart Poettering
6dd91b3682
tree-wide: CMP()ify all the things
...
Let's employ coccinelle to fix everything up automatically for us.
2018-10-16 17:45:53 +02:00
Lennart Poettering
2011149a3c
Merge pull request #10327 from yuwata/test-sd-device-enumerator-subsystem
...
sd-device-enumerator: dedup enumerated devices and add test for subsystem filtering
2018-10-16 12:48:01 +02:00
Yu Watanabe
915375ed3b
test: add tests for sd_netlink_slot_set_*()
2018-10-16 18:49:42 +09:00
Yu Watanabe
c940a2310a
test: add tests for sd_netlink_slot_get_*()
2018-10-16 18:42:42 +09:00
Yu Watanabe
8190a388a6
sd-netlink: make sd_netlink_slot take its description
2018-10-16 18:42:23 +09:00
Lennart Poettering
6d5e65f645
tree-wide: add a single version of "static const int one = 1"
...
All over the place we define local variables for the various sockopts
that take a bool-like "int" value. Sometimes they are const, sometimes
static, sometimes both, sometimes neither.
Let's clean this up, introduce a common const variable "const_int_one"
(as well as one matching "const_int_zero") and use it everywhere, all
acorss the codebase.
2018-10-15 19:40:51 +02:00
Lennart Poettering
95cb14b068
sd-bus: rework how we initialize struct sockaddr_un
...
Let's use structured initialization, but more importantly, let's
increase salen by 1, if we reference AF_UNIX sockets in the file system,
so that they also contain the trailing NUL byte. This is what unix(7)
suggests to do, hence follow it.
2018-10-15 19:40:51 +02:00
Lennart Poettering
1d261418e2
sd-bus: make parsing of AF_UNIX socket addresses more strict
...
Insist on NUL termination, just to be safe rather than sorry. The kernel
doesn't require it, but it's really annoying if people rely on this,
hence refuse this early.
2018-10-15 19:40:51 +02:00
Lennart Poettering
15a3e96f92
tree-wide: port various users over to sockaddr_un_set_path()
...
CID 1396140
CID 1396141
2018-10-15 19:40:51 +02:00
Lennart Poettering
44ed5214ad
tree-wide: use structured initialization for sockaddr_un
2018-10-15 19:35:00 +02:00
Yu Watanabe
1a7baaa9e2
sd-netlink: add functions which manage sd_netlink_slot object
2018-10-15 18:10:25 +09:00
Yu Watanabe
ee38400bba
sd-netlink: introduce sd_netlink_slot
2018-10-15 18:10:04 +09:00
Yu Watanabe
b5f24a3858
test: make test-sd-device stricter
2018-10-13 21:45:50 +09:00
Yu Watanabe
cd8d816d78
sd-device: dedup enumerated devices
2018-10-13 21:45:50 +09:00
Yu Watanabe
68db4a0caf
test: add test for subsystem filtering of sd_device_enumerator
2018-10-13 21:45:50 +09:00
Lennart Poettering
190128e407
sd-bus: add new API call sd_bus_error_move()
...
This new call move an sd_bus_error into another one.
2018-10-13 12:59:29 +02:00
Jason A. Donenfeld
7d0b26a027
networkd: fix attribute length for wireguard ( #10380 )
...
This is actually a u16, not a u32, so the kernel complains:
kernel: netlink: 'systemd-network': attribute type 5 has an invalid length
This is due to:
if (nla_attr_len[pt->type] && attrlen != nla_attr_len[pt->type]) {
pr_warn_ratelimited("netlink: '%s': attribute type %d has an invalid length.\n",
current->comm, type);
}
Presumably this has been working fine in functionality on little-endian
systems, but nobody bothered to try on big-endian systems.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com >
2018-10-13 17:28:49 +09:00
Lennart Poettering
76137725f0
Merge pull request #10369 from yuwata/test-mempool
...
meson,test: mempool related fixes and add tests for 'thread safety'
2018-10-12 12:21:44 +02:00
Lennart Poettering
2aab8a1e04
Merge pull request #10201 from yuwata/fix-10196
...
sd-netlink: add destroy_callback to sd_netlink_call_async() and fix memleaks in networkd
2018-10-12 11:36:08 +02:00
Yu Watanabe
cb3e926a5d
test: add test for 'thread safety' of libudev
...
This adds a test for 715a970548d03fed18dc66c411c8b42ff21029cf.
2018-10-12 17:54:23 +09:00
Yu Watanabe
a6ee01caf3
test: add test for 'thread safety' of sd-device
...
This adds a test for a5d8835c78 .
2018-10-12 17:54:23 +09:00
Yu Watanabe
657ccaac1b
sd-device: drop unnecessary header
2018-10-12 17:54:23 +09:00
Lennart Poettering
960d4b29d7
Merge pull request #10334 from keszybz/nomempool
...
Use mempool only in progs linked to libsystemd-shared.so
2018-10-11 13:44:34 +02:00
Zbigniew Jędrzejewski-Szmek
a5d8835c78
mempool: only enable mempool use when linked to libsystemd-shared.so
...
Mempool use is enabled or disabled based on the mempool_use_allowed symbol that
is linked in.
Should fix assert crashes in external programs caused by #9792 .
Replaces #10286 .
v2:
- use two different source files instead of a gcc constructor
2018-10-11 11:10:37 +02:00
Lennart Poettering
92a40e20bf
sd-bus: call cap_last_cap() only once in has_cap()
...
Also, use the same type everywhere for dealing with it.
2018-10-10 11:13:00 +02:00
Lennart Poettering
3cae6c21e7
sd-bus: use size_t when dealing with memory offsets
2018-10-10 11:12:22 +02:00
Lennart Poettering
5f00c5684f
capability: introduce CAP_TO_MASK_CORRECTED() macro replacing CAP_TO_MASK()
...
linux/capability.h's CAP_TO_MASK potentially shifts a signed int "1"
(i.e. 32bit wide) left by 31 which means it becomes negative. That's
just weird, and ubsan complains about it. Let's introduce our own macro
CAP_TO_MASK_CORRECTED which doesn't fall into this trap, and make use of
it.
Fixes : #10347
2018-10-10 11:11:48 +02:00
Yu Watanabe
0d0f02cd15
test: add tests for destroy callback of asynchronous netlink call
2018-10-10 14:43:05 +09:00
Yu Watanabe
545bab1f0a
sd-netlink: add destroy_callback argument to sd_netlink_call_async()
2018-10-10 14:43:05 +09:00
Yu Watanabe
2fea60901d
sd-netlink: use structured initializers
2018-10-10 14:43:05 +09:00