aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/compat.h2
-rw-r--r--src/if_wg.c11
-rw-r--r--src/version.h2
3 files changed, 10 insertions, 5 deletions
diff --git a/src/compat.h b/src/compat.h
index 575b44d..68b108c 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -8,7 +8,7 @@
#include <sys/param.h>
-#if __FreeBSD_version < 1400000
+#if __FreeBSD_version < 1300507
#include <sys/smp.h>
#include <sys/gtaskqueue.h>
diff --git a/src/if_wg.c b/src/if_wg.c
index 11b8394..b06546d 100644
--- a/src/if_wg.c
+++ b/src/if_wg.c
@@ -572,6 +572,7 @@ wg_aip_add(struct wg_softc *sc, struct wg_peer *peer, sa_family_t af, const void
aip->a_addr.ip &= aip->a_mask.ip;
aip->a_addr.length = aip->a_mask.length = offsetof(struct aip_addr, in) + sizeof(struct in_addr);
break;
+#ifdef INET6
case AF_INET6:
if (cidr > 128) cidr = 128;
root = sc->sc_aip6;
@@ -581,6 +582,7 @@ wg_aip_add(struct wg_softc *sc, struct wg_peer *peer, sa_family_t af, const void
aip->a_addr.ip6[i] &= aip->a_mask.ip6[i];
aip->a_addr.length = aip->a_mask.length = offsetof(struct aip_addr, in6) + sizeof(struct in6_addr);
break;
+#endif
default:
free(aip, M_WG);
return (EAFNOSUPPORT);
@@ -1676,10 +1678,10 @@ wg_deliver_out(struct wg_peer *peer)
len = m->m_pkthdr.len;
+ wg_timers_event_any_authenticated_packet_traversal(peer);
+ wg_timers_event_any_authenticated_packet_sent(peer);
rc = wg_send(sc, &endpoint, m);
if (rc == 0) {
- wg_timers_event_any_authenticated_packet_traversal(peer);
- wg_timers_event_any_authenticated_packet_sent(peer);
if (len > (sizeof(struct wg_pkt_data) + NOISE_AUTHTAG_LEN))
wg_timers_event_data_sent(peer);
counter_u64_add(peer->p_tx_bytes, len);
@@ -2554,10 +2556,13 @@ wgc_get(struct wg_softc *sc, struct wg_data_io *wgd)
if (aip->a_af == AF_INET) {
nvlist_add_binary(nvl_aip, "ipv4", &aip->a_addr.in, sizeof(aip->a_addr.in));
nvlist_add_number(nvl_aip, "cidr", bitcount32(aip->a_mask.ip));
- } else if (aip->a_af == AF_INET6) {
+ }
+#ifdef INET6
+ else if (aip->a_af == AF_INET6) {
nvlist_add_binary(nvl_aip, "ipv6", &aip->a_addr.in6, sizeof(aip->a_addr.in6));
nvlist_add_number(nvl_aip, "cidr", in6_mask2len(&aip->a_mask.in6, NULL));
}
+#endif
}
nvlist_add_nvlist_array(nvl_peer, "allowed-ips", (const nvlist_t *const *)nvl_aips, aip_count);
err_aip:
diff --git a/src/version.h b/src/version.h
index ffad8b6..aba5aac 100644
--- a/src/version.h
+++ b/src/version.h
@@ -1 +1 @@
-#define WIREGUARD_VERSION 20210606
+#define WIREGUARD_VERSION 20211105