Commit Graph

131 Commits

Author SHA1 Message Date
Yu Watanabe 01234e1fe7 tree-wide: drop several missing_*.h and import relevant headers from kernel-5.0 2019-04-11 19:00:37 +02:00
Yu Watanabe 5b139f86a6 missing: re-add drm related entries
This effectively reverts dab28f0905.

Fixes #11075.
2018-12-07 12:46:55 +01:00
Yu Watanabe ef118d00eb util: drop missing.h from socket-util.h 2018-12-06 13:31:16 +01:00
Yu Watanabe 503f480f8e missing: move fs or mount related definitions to missing_fs.h
This also fixes errnous definition MS_REC -> MS_SLAVE.
2018-12-06 13:30:43 +01:00
Yu Watanabe 311c1a5d0a missing: drop falloc related definitions
All these values are exposed earlier than linux-3.11.
Let's drop them.
2018-12-06 13:28:34 +01:00
Yu Watanabe 22332e339b missing: move sched.h related definitions to missing_sched.h 2018-12-06 13:28:28 +01:00
Yu Watanabe dab28f0905 missing: drop old drm related definitions
These values are exposed earlier than linux-3.11.
Let's use drm/drm.h.
2018-12-06 13:27:47 +01:00
Yu Watanabe 957c622b86 missing: drop BPF_XOR as we have linux/bpf_common.h 2018-12-06 13:27:23 +01:00
Yu Watanabe fec6661efd missing: drop DM_DEFERRED_REMOVE as we have dm-ioctl.h 2018-12-06 13:26:55 +01:00
Yu Watanabe 470f348b97 missing: move definition of secure_getenv() to missing_stdlib.h 2018-12-06 13:26:55 +01:00
Yu Watanabe b19bb11142 missing: move rand related definitions to missing_random.h 2018-12-06 13:26:55 +01:00
Yu Watanabe 5ee668d2d1 missing: drop TIOCVHANGUP
This is defined before linux-3.11. Also, its value depnends on
architecture. So, it is not good to define in this form.
2018-12-06 13:26:48 +01:00
Yu Watanabe c8a363eb15 missing: add memfd related definitions to missing_mman.h 2018-12-06 13:25:24 +01:00
Yu Watanabe d7330b60a9 missing: move timer related definition to missing_timerfd.h 2018-12-06 13:25:24 +01:00
Yu Watanabe 66ffbdf933 missing: move socket related definitions to missing_socket.h 2018-12-06 13:25:24 +01:00
Yu Watanabe dea72eda9c missing: move fcntl related definitions to missing_fcntl.h 2018-12-06 13:25:24 +01:00
Yu Watanabe 6c76de27ee missing: move resource related definitions to missing_resource.h 2018-12-06 13:25:24 +01:00
Yu Watanabe 0e7117d001 missing: move audit related definitions to missing_audit.h 2018-12-06 13:25:24 +01:00
Yu Watanabe 851d66fac2 missing: move syscall related definitions to missing_syscall.h 2018-12-06 13:25:24 +01:00
Yu Watanabe 49f6103375 missing: drop old OOM related definitions
These are exposed earlier than linux-3.11. Let's just include linux/oom.h.
2018-12-06 13:24:37 +01:00
Yu Watanabe 8f8495702e missing: move one more network related definition to missing_network.h 2018-12-06 13:24:32 +01:00
Yu Watanabe ec3f6df9cf missing: move several network related entries to missing_network.h 2018-12-06 02:38:59 +01:00
Yu Watanabe 38e0c63d72 missing: move char{16,32}_t definitions to missing_type.h 2018-12-04 08:38:18 +01:00
Yu Watanabe 8ca2702f00 missing: move capabilities to missing_capability.h 2018-12-04 08:38:14 +01:00
Yu Watanabe 2a03bb3e65 missing: move prctl related entries to missing_prctl.h 2018-12-04 08:34:46 +01:00
Yu Watanabe e01819f84b missing: move statx related definitions to missing_stat.h 2018-12-04 08:27:50 +01:00
Yu Watanabe 1e54f0ab15 missing: move entries defined in magic.h to missing_magic.h 2018-12-04 07:55:23 +01:00
Yu Watanabe 31c2ddabea missing: move input related entries to missing_input.h 2018-12-04 07:51:52 +01:00
Yu Watanabe b9683baffe missing: move btrfs related entries to missing_btrfs.h and missing_btrfs_tree.h 2018-12-04 07:46:59 +01:00
Yu Watanabe d7276b61bd missing: move missing entries in keyctl.h to missing_keyctl.h 2018-12-04 07:42:32 +01:00
Yu Watanabe 9714c020fc missing: split network related entries
Also adds comments which kernel version added the entries.

Closes #10553.
2018-12-03 10:31:05 +01:00
Susant Sahani 926062f083 networkd: add support to configure ip rule port range and protocol.
Please see:

iprule: support for ip_proto, sport and dport match options
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=f686f764682745daf6a93b0a6330ba42a961f858

Closes 10622
2018-11-28 20:06:28 +05:30
Lennart Poettering 59a2a18e27 missing.h: remove duplicate definition of 'struct ethtool_link_settings'
Fixes: #10966
2018-11-28 10:37:03 +01:00
Susant Sahani 2266864b04 networkd: Add support for ERSPAN tunnel
Please see: https://patchwork.ozlabs.org/patch/800327/
```
[NetDev]
Name=erspan-test
Kind=erspan

[Tunnel]
Independent=true
ERSPANIndex=123
Local = 172.16.1.200
Remote = 172.16.1.100
Key=101
SerializeTunneledPackets=true
```
2018-11-27 11:04:42 +09:00
Zbigniew Jędrzejewski-Szmek 64d9f7568b basic/missing: drop _ETHTOOL_LINK_MODE_MAX
It was only used in one place, where we don't actually need it, and
it is too easy to forget to update it when adding new items to the table.
Let's just drop it.
2018-11-18 16:14:21 +01:00
Yu Watanabe 8a716f26ef missing: add ETHTOOL_LINK_MODE_* and struct ethtool_link_settings 2018-11-18 14:33:50 +09:00
Tobias Jungel 99f68ef02d networkd: add missing bonding options (#10542)
Add support for bonding options system prio, port key and actor system mac.

These options exist in the linux kernel since 4.2
(torvalds/linux@171a42c38c)

Details:
https://www.kernel.org/doc/Documentation/networking/bonding.txt
2018-11-02 10:31:20 +09:00
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
Susant Sahani 53cb501a13 networkd and sd-netlink: add support for Generic netlink And FooOverUDP to IPIP tunnel
This work add support to generic netlink to sd-netlink.
See https://lwn.net/Articles/208755/

networkd: add support FooOverUDP support to IPIP tunnel netdev
https://lwn.net/Articles/614348/

Example conf:

/lib/systemd/network/1-fou-tunnel.netdev
```
[NetDev]
Name=fou-tun
Kind=fou

[FooOverUDP]
Port=5555
Protocol=4

```

/lib/systemd/network/ipip-tunnel.netdev
```
[NetDev]
Name=ipip-tun
Kind=ipip

[Tunnel]
Independent=true
Local=10.65.208.212
Remote=10.65.208.211
FooOverUDP=true
FOUDestinationPort=5555
```

$ ip -d link show ipip-tun
```
5: ipip-tun@NONE: <POINTOPOINT,NOARP> mtu 1472 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ipip 10.65.208.212 peer 10.65.208.211 promiscuity 0
    ipip remote 10.65.208.211 local 10.65.208.212 ttl inherit pmtudisc encap fou encap-sport auto encap-dport 5555 noencap-csum noencap-csum6 noencap-remcsum numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
```
2018-08-23 11:30:37 +02:00
Zbigniew Jędrzejewski-Szmek 1d7aedf11a meson: remove false check for key_serial_t
key_serial_t is defined in keyutil.h, which wasn't included in the header list
in the test, so the test always failed. We were always compiling stuff with
!HAVE_KEY_SERIAL_T.

We could try to add keyutil.h to the test, but then we'd have to first check if
it is available, which just doesn't seem worth the trouble.

key_serial_t should always be defined as int32_t. Let's keep the uncoditional
define, since repeated compatible typedefs are not a problem, and it allows us
to compile even if the header file is missing. If there's ever a change in the
definition, we'll have to adjust the code for the different type anyway, and
our compiler will tell us.
2018-07-18 17:46:33 +02:00
Zbigniew Jędrzejewski-Szmek 9c869d08d8 meson: unify linux/stat.h check with other checks and use _GNU_SOURCE
Using _GNU_SOURCE is better because that's how we include the headers in the
actual build, and some headers define different stuff when it is defined.
sys/stat.h for example defines 'struct statx' conditionally.
2018-07-18 17:40:41 +02:00
Filipe Brandenburger 75720bff62 build-sys: Detect whether struct statx is defined in sys/stat.h
Starting with glibc 2.27.9000-36.fc29, include file sys/stat.h will have a
definition for struct statx, in which case include file linux/stat.h should be
avoided, in order to prevent a duplicate definition.

    In file included from ../src/basic/missing.h:18,
		     from ../src/basic/util.h:28,
		     from ../src/basic/hashmap.h:10,
		     from ../src/shared/bus-util.h:12,
		     from ../src/libsystemd/sd-bus/bus-creds.c:11:
    /usr/include/linux/stat.h:99:8: error: redefinition of ‘struct statx’
     struct statx {
	    ^~~~~
    In file included from /usr/include/sys/stat.h:446,
		     from ../src/basic/util.h:19,
		     from ../src/basic/hashmap.h:10,
		     from ../src/shared/bus-util.h:12,
		     from ../src/libsystemd/sd-bus/bus-creds.c:11:
    /usr/include/bits/statx.h:36:8: note: originally defined here
     struct statx
	    ^~~~~

Extend our meson.build to look for struct statx when only sys/stat.h is
included and, in that case, do not include linux/stat.h anymore.

Tested that systemd builds correctly when using a glibc version that includes a
definition for struct statx.

glibc Fedora RPM update:
28cb5d31fc

glibc upstream commit:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=fd70af45528d59a00eb3190ef6706cb299488fcd
2018-07-16 11:14:29 +02:00
Lennart Poettering 0c69794138 tree-wide: remove Lennart's copyright lines
These lines are generally out-of-date, incomplete and unnecessary. With
SPDX and git repository much more accurate and fine grained information
about licensing and authorship is available, hence let's drop the
per-file copyright notice. Of course, removing copyright lines of others
is problematic, hence this commit only removes my own lines and leaves
all others untouched. It might be nicer if sooner or later those could
go away too, making git the only and accurate source of authorship
information.
2018-06-14 10:20:20 +02:00
Lennart Poettering 818bf54632 tree-wide: drop 'This file is part of systemd' blurb
This part of the copyright blurb stems from the GPL use recommendations:

https://www.gnu.org/licenses/gpl-howto.en.html

The concept appears to originate in times where version control was per
file, instead of per tree, and was a way to glue the files together.
Ultimately, we nowadays don't live in that world anymore, and this
information is entirely useless anyway, as people are very welcome to
copy these files into any projects they like, and they shouldn't have to
change bits that are part of our copyright header for that.

hence, let's just get rid of this old cruft, and shorten our codebase a
bit.
2018-06-14 10:20:20 +02:00
Lennart Poettering 92f14395cd missing: define kernel internal limit TASK_COMM_LEN in userspace too
We already use it at two places, and we are about to add one too.
Arbitrary literally hardcoded limits suck.
2018-06-01 21:49:16 +02:00
Lennart Poettering 56b00d0028 tree-wide: remove some double newlines in headers, too 2018-05-22 16:13:45 +02:00
Lennart Poettering 4d7c3570a6 missing: add IPV4_MIN_MTU
Similar to IPV6_MIN_MTU, let's add the same for IPv4.
2018-04-26 13:51:44 +02:00
Zbigniew Jędrzejewski-Szmek 11a1589223 tree-wide: drop license boilerplate
Files which are installed as-is (any .service and other unit files, .conf
files, .policy files, etc), are left as is. My assumption is that SPDX
identifiers are not yet that well known, so it's better to retain the
extended header to avoid any doubt.

I also kept any copyright lines. We can probably remove them, but it'd nice to
obtain explicit acks from all involved authors before doing that.
2018-04-06 18:58:55 +02:00
Daniel Dao f02ba16389 setup route expiration in kernel if supported
kernel >= 4.5 (with commit 32bc201e19) supports
RTA_EXPIRES netlink attribute to set router lifetime. This simply detect
the kernel version (>=4.5) and set the lifetime properly, fallback to
expiring route in userspace for kernel that doesnt support it.

Signed-off-by: Daniel Dao <dqminh89@gmail.com>
2018-03-12 11:36:25 +00:00
Lennart Poettering 4c2e1b399f xattr-util: use crtime/btime if statx() is available for implementation of fd_setcrtime() and friends
The Linux kernel exposes the birth time now for files through statx()
hence make use of it where available. We keep the xattr logic in place
for this however, since only a subset of file systems on Linux currently
expose the birth time. NFS and tmpfs for example do not support it. OTOH
there are other file systems that do support the birth time but might
not support xattrs (smb…), hence make the best of the two, in particular
in order to deal with journal files copied between file system types and
to maintain compatibility with older file systems that are updated to
newer version of the file system.
2018-02-20 15:41:49 +01:00