Skip to content

Commit

Permalink
net/wireguard: merge v1.0.20210424
Browse files Browse the repository at this point in the history
Signed-off-by: engstk <eng.stk@sapo.pt>
  • Loading branch information
engstk committed May 12, 2021
1 parent 19a1ca0 commit bca45d6
Show file tree
Hide file tree
Showing 10 changed files with 62 additions and 179 deletions.
4 changes: 2 additions & 2 deletions net/wireguard/Kconfig
@@ -1,5 +1,5 @@
config WIREGUARD
bool "IP: WireGuard secure network tunnel"
tristate "IP: WireGuard secure network tunnel"
depends on NET && INET
depends on IPV6 || !IPV6
select NET_UDP_TUNNEL
Expand All @@ -10,7 +10,7 @@ config WIREGUARD
select VFPv3 if CPU_V7
select NEON if CPU_V7
select KERNEL_MODE_NEON if CPU_V7
default y
default m
help
WireGuard is a secure, fast, and easy to use replacement for IPsec
that uses modern cryptography and clever networking tricks. It's
Expand Down
61 changes: 52 additions & 9 deletions net/wireguard/Makefile
Expand Up @@ -2,15 +2,58 @@
#
# Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.

ccflags-y := -O3
ccflags-$(CONFIG_WIREGUARD_DEBUG) += -DDEBUG -g
ccflags-y += -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt'
ccflags-y += -Wframe-larger-than=2048
ccflags-$(if $(WIREGUARD_VERSION),y,) += -D'WIREGUARD_VERSION="$(WIREGUARD_VERSION)"'
KERNELRELEASE ?= $(shell uname -r)
KERNELDIR ?= /lib/modules/$(KERNELRELEASE)/build
PREFIX ?= /usr
DESTDIR ?=
SRCDIR ?= $(PREFIX)/src
DKMSDIR ?= $(SRCDIR)/wireguard
DEPMOD ?= depmod
DEPMODBASEDIR ?= /

wireguard-y := main.o noise.o device.o peer.o timers.o queueing.o send.o receive.o socket.o peerlookup.o allowedips.o ratelimiter.o cookie.o netlink.o
PWD := $(shell pwd)

include $(src)/crypto/Makefile.include
include $(src)/compat/Makefile.include
all: module
debug: module-debug

obj-$(if $(KBUILD_EXTMOD),m,$(CONFIG_WIREGUARD)) := wireguard.o
ifneq ($(V),1)
MAKEFLAGS += --no-print-directory
endif

WIREGUARD_VERSION = $(patsubst v%,%,$(shell GIT_CEILING_DIRECTORIES="$(PWD)/../.." git describe --dirty 2>/dev/null))

module:
@$(MAKE) -C $(KERNELDIR) M=$(PWD) WIREGUARD_VERSION="$(WIREGUARD_VERSION)" modules

module-debug:
@$(MAKE) -C $(KERNELDIR) M=$(PWD) V=1 CONFIG_WIREGUARD_DEBUG=y WIREGUARD_VERSION="$(WIREGUARD_VERSION)" modules

clean:
@$(MAKE) -C $(KERNELDIR) M=$(PWD) clean

module-install:
@$(MAKE) -C $(KERNELDIR) M=$(PWD) WIREGUARD_VERSION="$(WIREGUARD_VERSION)" modules_install
$(DEPMOD) -b "$(DEPMODBASEDIR)" -a $(KERNELRELEASE)

install: module-install

rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
DKMS_SOURCES := version.h Makefile Kbuild Kconfig dkms.conf $(filter-out version.h wireguard.mod.c tests/%,$(call rwildcard,,*.c *.h *.S *.pl *.include))
dkms-install: $(DKMS_SOURCES)
@$(foreach f,$(DKMS_SOURCES),install -v -m0644 -D $(f) $(DESTDIR)$(DKMSDIR)/$(f);)

style:
$(KERNELDIR)/scripts/checkpatch.pl -f --max-line-length=4000 --codespell --color=always $(filter-out wireguard.mod.c,$(wildcard *.c)) $(wildcard *.h) $(wildcard selftest/*.c)

check: clean
scan-build --html-title=wireguard-linux-compat -maxloop 100 --view --keep-going $(MAKE) module CONFIG_WIREGUARD_DEBUG=y C=2 CF="-D__CHECK_ENDIAN__"

coccicheck: clean
@$(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_WIREGUARD_DEBUG=y coccicheck MODE=report

cloc:
@cloc --skip-uniqueness --by-file --extract-with="$$(readlink -f ../kernel-tree-scripts/filter-compat-defines.sh) >FILE< > \$$(basename >FILE<)" $(filter-out wireguard.mod.c,$(wildcard *.c)) $(wildcard *.h)

-include tests/debug.mk

.PHONY: all module module-debug module-install install dkms-install clean cloc check style
103 changes: 0 additions & 103 deletions net/wireguard/compat/Makefile.include

This file was deleted.

2 changes: 1 addition & 1 deletion net/wireguard/compat/compat-asm.h
Expand Up @@ -15,7 +15,7 @@
#define ISRHEL7
#elif RHEL_MAJOR == 8
#define ISRHEL8
#if RHEL_MINOR == 4
#if RHEL_MINOR >= 4
#define ISCENTOS8S
#endif
#endif
Expand Down
6 changes: 3 additions & 3 deletions net/wireguard/compat/compat.h
Expand Up @@ -16,7 +16,7 @@
#define ISRHEL7
#elif RHEL_MAJOR == 8
#define ISRHEL8
#if RHEL_MINOR == 4
#if RHEL_MINOR >= 4
#define ISCENTOS8S
#endif
#endif
Expand Down Expand Up @@ -823,7 +823,7 @@ static __always_inline void old_rcu_barrier(void)
#define COMPAT_CANNOT_DEPRECIATE_BH_RCU
#endif

#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 10) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) && !defined(ISRHEL8) && !defined(ISUBUNTU1804)) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 217)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 10) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) && !defined(ISRHEL8)) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 217)
static inline void skb_mark_not_on_list(struct sk_buff *skb)
{
skb->next = NULL;
Expand Down Expand Up @@ -932,7 +932,7 @@ static inline int skb_ensure_writable(struct sk_buff *skb, int write_len)
}
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 102) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 178) && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)) || (LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 223) && LINUX_VERSION_CODE > KERNEL_VERSION(4, 10, 0)) || LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 259) || defined(ISRHEL8) || defined(ISUBUNTU1804)
#include <linux/icmpv6.h>
#include <net/icmp.h>
#if IS_ENABLED(CONFIG_NF_NAT)
Expand Down
57 changes: 0 additions & 57 deletions net/wireguard/crypto/Makefile.include

This file was deleted.

2 changes: 1 addition & 1 deletion net/wireguard/crypto/zinc/chacha20/chacha20-mips.S
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 OR MIT */
/*
* Copyright (C) 2016-2018 René van Dorst <opensource@vdorst.com>. All Rights Reserved.
* Copyright (C) 2016-2018 René van Dorst <opensource@vdorst.com>. All Rights Reserved.
* Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
*/

Expand Down
2 changes: 1 addition & 1 deletion net/wireguard/crypto/zinc/poly1305/poly1305-mips.S
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 OR MIT */
/*
* Copyright (C) 2016-2018 René van Dorst <opensource@vdorst.com> All Rights Reserved.
* Copyright (C) 2016-2018 René van Dorst <opensource@vdorst.com> All Rights Reserved.
* Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
*/

Expand Down
2 changes: 1 addition & 1 deletion net/wireguard/crypto/zinc/selftest/poly1305.c
Expand Up @@ -666,7 +666,7 @@ static const u8 key22[] __initconst = {
0x76, 0xe9, 0xbf, 0x8d, 0x0e, 0x88, 0xd5, 0x46
};

/* test vectors from Hanno Böck */
/* test vectors from Hanno Böck */
static const u8 input23[] __initconst = {
0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
Expand Down
2 changes: 1 addition & 1 deletion net/wireguard/version.h
@@ -1,3 +1,3 @@
#ifndef WIREGUARD_VERSION
#define WIREGUARD_VERSION "1.0.20210219"
#define WIREGUARD_VERSION "1.0.20210424"
#endif

0 comments on commit bca45d6

Please sign in to comment.