summaryrefslogtreecommitdiffhomepage
path: root/src/compat
AgeCommit message (Collapse)Author
2020-04-16compat: include sch_generic.h header for skb_reset_tcJason A. Donenfeld
Reported-by: King DuckZ <dev00@gmx.it> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-04-14compat: backport hsiphash_1u32 for testsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-04-14compat: error out if bc is missingJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-04-14compat: support RHEL 7.8's faulty siphash backportJason A. Donenfeld
Reported-by: Christian Weiss <cwei@gmx.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-04-07compat: support latest suse 15.1 and 15.2Jason A. Donenfeld
Contributed-by: Martin Hauke <mardnh@gmx.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-04-01compat: queueing: skb_reset_redirect change has been backported to 5.[45]Christian Hesse
This is a follow up to 2d4fa2a6e7903ec3340f1b075456cbd84ba6a744. Upstream commit 2c64605b590edadb3fb46d1ec6badb49e940b479 has been backported to 5.4.29 and 5.5.14. Signed-off-by: Christian Hesse <mail@eworm.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-28queueing: backport skb_reset_redirect change from 5.6Jason A. Donenfeld
This backports upstream commit 2c64605b590edadb3fb46d1ec6badb49e940b479. It makes no difference for us, but it's nice to keep this code in sync with upstream as much as possible. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-03-03compat: RHEL 8.2 backported ipv6_dst_lookup_flowJason A. Donenfeld
Reported-by: Vladimir Benes <vbenes@redhat.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-02-15compat: RHEL 7 backported skb_ensure_writable()Luis Ressel
Reported-by: chotaire <chotaire@chotaire.net> Signed-off-by: Luis Ressel <aranea@aixah.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-02-14send: account for mtu=0 devicesJason A. Donenfeld
It turns out there's an easy way to get packets queued up while still having an MTU of zero, and that's via persistent keep alive. This commit makes sure that in whatever condition, we don't wind up dividing by zero. Note that an MTU of zero for a wireguard interface is something quasi-valid, so I don't think the correct fix is to limit it via min_mtu. This can be reproduced easily with: ip link add wg0 type wireguard ip link add wg1 type wireguard ip link set wg0 up mtu 0 ip link set wg1 up wg set wg0 private-key <(wg genkey) wg set wg1 listen-port 1 private-key <(wg genkey) peer $(wg show wg0 public-key) wg set wg0 peer $(wg show wg1 public-key) persistent-keepalive 1 endpoint 127.0.0.1:1 However, while min_mtu=0 seems fine, it makes sense to restrict the max_mtu. This commit also restricts the maximum MTU to the greatest number for which rounding up to the padding multiple won't overflow a signed integer. Packets this large were always rejected anyway eventually, due to checks deeper in, but it seems more sound not to even let the administrator configure something that won't work anyway. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-02-12netns: ensure that icmp src address is correct with natJason A. Donenfeld
This is a small test to ensure that icmp_ndo_send is actually doing the right with with regards to the source address. It tests this by ensuring that the error comes back along the right path. Also, backport the new ndo function for this. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-01-30compat: remove RHEL-7.6 workaroundJason A. Donenfeld
We only support the latest RHEL-7 and RHEL-8. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-01-30compat: support building for RHEL-8.2Ilie Halip
RedHat backported some more changes, now released as kernel 4.18.0-168.el8. To maintain compatibility with kernel -147, a new macro is introduced: ISRHEL82. Compile-tested with the -168 and -147 kernels. Signed-off-by: Ilie Halip <ilie.halip@gmail.com> [zx2c4: we normally only support the latest RHEL, but having some beta support for the time being sounds like a good plan, given that there may be interest from RedHat in actually merging this into their kernels.] Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-01-28compat: account for frankenzinc being in 5.5Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-01-28compat: refuse to build on >= 5.6Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2020-01-11device: skb_list_walk_safe moved upstreamJason A. Donenfeld
This won't be ported to 5.6, of course, but it's still cleaner to get this out of the way. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-19compat: ipv6_dst_lookup_flow was backported to 5.3 and 5.4Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-12compat: support building for RHEL-8.1 instead of RHEL-8.0Sergey Ivanov
RedHat backported to their kernel 4.18.0-147.el8 a couple features. This patch enables compiling for this kernel. Signed-off-by: Sergey Ivanov <seriv@cs.umd.edu> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-12socket: convert to ipv6_dst_lookup_flow for 5.5Jason A. Donenfeld
Upstream changed the API, so we introduce this super insane compat hack to make everything work again. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-05crypto: use new assembler macros for 5.5Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-12-05netlink: prepare for removal of genl_family_attrbuf in 5.5Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-09-13compat: support rhel/centos 7.7Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-09-13compat: don't rewrite siphash when it's from compatJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-09-11compat: support newer PaXJason A. Donenfeld
Reported-by: PaX Team <pageexec@freemail.hu> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-09-05compat: work around ubuntu breakageJason A. Donenfeld
They forgot to backport hsiphash. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-08-25compat: account for android-4.9 backport of addr_gen_modeNathan Chancellor
Android kernels backported d35a00b8e33dab7385f724e713ae71c8be0a49f4, so now we need to do feature detection. Link: https://android-review.googlesource.com/c/kernel/common/+/1103831 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-08-03compat: do not run bc on clean targetJason A. Donenfeld
Certain targets don't define CONFIG_*, which means this bc command was previously failing. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-07-19compat: support running in OpenVZ environmentsJason A. Donenfeld
Overriding LLTX like this is pretty ugly, but at least it means we don't have to let OpenVZ infect the real source tree. Requested-by: Benedikt Braunger <b.braunger@syseleven.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-07-04compat: define conversion constants for ancient kernelsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-28compat: support RHEL8's skb_mark_not_on_list backportJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-25compat: rhel backported list modificationsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-25global: switch to coarse ktimeJason A. Donenfeld
Coarse ktime is broken until [1] in 5.2 and kernels without the backport, so we use fallback code there. The fallback code has also been improved significantly. It now only uses slower clocks on kernels < 3.17, at the expense of some accuracy we're not overly concerned about. [1] https://lore.kernel.org/lkml/tip-e3ff9c3678b4d80e22d2557b68726174578eaf52@git.kernel.org/ Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-24compat: unify custom function prefix/suffixJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-24compat: some kernels weirdly backport prandom_u32_maxJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-06-02curve25519: not all linkers support bmi2 and adxJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-05-31compat: don't call xgetbv on cpus with no XSAVEJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-05-29zinc: arm64: use cpu_get_elf_hwcap accessor for 5.2Jason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-05-29kbuild: account for recent upstream changesJason A. Donenfeld
Apparently cdd750bfb1f76fe9be8cfb53cbe77b2e811081ab changed things, so we fall back onto this hack. Reported-by: Alex Xu <alex@alxu.ca> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-05-29netlink: use new strict length types in policy for 5.2Jason A. Donenfeld
Reported-by: Bruno Wolff III <bruno@wolff.to> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-05-29socket: set ignore_df=1 on xmitJoe Holden
This allows the kernel to generate ipv6 fragments. Apply the same to ipv4 for consistency. Signed-off-by: Joe Holden <jwh@zorins.us> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-04-14compat: udp_tunnel: force cast sk_data_readyJason A. Donenfeld
Reference: https://lists.zx2c4.com/pipermail/wireguard/2019-April/004081.html Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-03-29compat: backport skb_mark_not_on_listJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-03-17global: the _bh variety of rcu helpers have been unifiedJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-03-14compat: nf_nat_core.h was removed upstreamBruno Wolff III
In d2c5c103b133 ("netfilter: nat: remove nf_nat_l3proto.h and nf_nat_core.h"). Signed-off-by: Bruno Wolff III <bruno@wolff.to> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-02-27queueing: net-next has changed signature of skb_probe_transport_headerJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-02-17compat: backport ALIGN_DOWNJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-02-17compat: ipv6_stub is sometimes nullJason A. Donenfeld
On ancient kernels, ipv6_stub is sometimes null in cases where IPv6 has been disabled with a command line flag or other failures. Reported-by: Anatoli <me@anatoli.ws> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-23netlink: use __kernel_timespec for handshake timeJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-23ratelimiter: totalram_pages is now a functionJason A. Donenfeld
Reported-by: Alex Xu <alex@alxu.ca> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-23noise: replace getnstimeofday64 with ktime_get_real_ts64Jason A. Donenfeld
The former was just a wrapper around the latter, and so upstream is now removing it. Also adjust the compat kludge to deal with this. Reported-by: Alex Xu <alex@alxu.ca> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>