All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mieczysław Nalewaj" <namiltd@poczta.onet.pl>
To: wireguard@lists.zx2c4.com
Subject: Re: [PATCH] centos 6 compatibility
Date: Fri, 29 Mar 2019 15:36:28 +0100	[thread overview]
Message-ID: <a5e21f8d-da02-c52f-83a8-3a50e1bdaf94@poczta.onet.pl> (raw)
In-Reply-To: <c3e6e9e7-40c6-def5-df0c-cc9fc0740301@poczta.onet.pl>


[-- Attachment #1.1: Type: text/plain, Size: 420 bytes --]

New, improved version of patch for WireGuard Centos6 compatibility.

W dniu 2019-03-27 o 15:48, Mieczysław Nalewaj pisze:
> Is there any chance to add this code?
>
> W dniu 2019-03-03 o 14:30, namiltd@poczta.onet.pl pisze:
>> ---
>> src/crypto/zinc/blake2s/blake2s.c | 17 +++++++++++++++++
>> src/socket.c                      |  7 +++++++
>> 2 files changed, 24 insertions(+)
>> ....
>>        .ipv6_v6only = true
>
>


[-- Attachment #1.2: Type: text/html, Size: 1882 bytes --]

[-- Attachment #2: wireguard.diff --]
[-- Type: text/plain, Size: 1125 bytes --]

diff -ruN master/src/socket.c master-centos6/src/socket.c
--- master/src/socket.c	2019-03-29 15:10:20.000000000 +0100
+++ master-centos6/src/socket.c	2019-03-29 15:10:31.000000000 +0100
@@ -16,6 +16,9 @@
 #include <linux/inetdevice.h>
 #include <net/udp_tunnel.h>
 #include <net/ipv6.h>
+#define GCC_VERSION (__GNUC__ * 10000 \
+		    + __GNUC_MINOR__ * 100 \
+		    + __GNUC_PATCHLEVEL__)
 
 static int send4(struct wg_device *wg, struct sk_buff *skb,
 		 struct endpoint *endpoint, u8 ds, struct dst_cache *cache)
@@ -363,7 +366,11 @@
 	struct socket *new4 = NULL, *new6 = NULL;
 	struct udp_port_cfg port4 = {
 		.family = AF_INET,
+#if GCC_VERSION == 40407
+		{.local_ip.s_addr = htonl(INADDR_ANY)},
+#else
 		.local_ip.s_addr = htonl(INADDR_ANY),
+#endif
 		.local_udp_port = htons(port),
 		.use_udp_checksums = true
 	};
@@ -371,7 +378,11 @@
 	int retries = 0;
 	struct udp_port_cfg port6 = {
 		.family = AF_INET6,
+#if GCC_VERSION == 40407
+		{.local_ip6 = IN6ADDR_ANY_INIT},
+#else
 		.local_ip6 = IN6ADDR_ANY_INIT,
+#endif
 		.use_udp6_tx_checksums = true,
 		.use_udp6_rx_checksums = true,
 		.ipv6_v6only = true

[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

      reply	other threads:[~2019-04-06 11:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-03 13:30 [PATCH] centos 6 compatibility namiltd
2019-03-27 14:48 ` Mieczysław Nalewaj
2019-03-29 14:36   ` Mieczysław Nalewaj [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a5e21f8d-da02-c52f-83a8-3a50e1bdaf94@poczta.onet.pl \
    --to=namiltd@poczta.onet.pl \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.