Skip to content

Commit

Permalink
ovpn-dco: include new GSO header file
Browse files Browse the repository at this point in the history
GSO code has ben moved to its own files, therefore a new header
needs to be included accordingly.

This patch also provides some compat files so that ovpn-dco can
continue to compile also on older kernels.

Fixes: #42
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
  • Loading branch information
ordex committed Aug 16, 2023
1 parent 961c60d commit dba96d2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ ELFLAG := $(EL8FLAG) $(EL9FLAG)
NOSTDINC_FLAGS += \
-I$(PWD)/include/ \
$(CFLAGS) $(ELFLAG) \
-include $(PWD)/linux-compat.h
# -I$(PWD)/compat-include/
-include $(PWD)/linux-compat.h \
-I$(PWD)/compat-include/

ifneq ($(REVISION),)
NOSTDINC_FLAGS += -DOVPN_DCO_VERSION=\"$(REVISION)\"
Expand Down
20 changes: 20 additions & 0 deletions compat-include/net/gso.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/* OpenVPN data channel accelerator
*
* Copyright (C) 2023 OpenVPN, Inc.
*
* Author: Antonio Quartulli <antonio@openvpn.net>
*/

#ifndef _NET_OVPN_COMPAT_NET_GSO_H
#define _NET_OVPN_COMPAT_NET_GSO_H

#include <linux/version.h>

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 10)
#include_next <net/gso.h>
#else
#include <linux/netdevice.h>
#endif

#endif /* _NET_OVPN_COMPAT_NET_GSO_H */
1 change: 1 addition & 0 deletions drivers/net/ovpn-dco/ovpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "udp.h"

#include <linux/workqueue.h>
#include <net/gso.h>
#include <uapi/linux/if_ether.h>

static const unsigned char ovpn_keepalive_message[] = {
Expand Down

0 comments on commit dba96d2

Please sign in to comment.