summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--proto/wireguard/wireguard.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/proto/wireguard/wireguard.c b/proto/wireguard/wireguard.c
index 7e4e436d..68643d50 100644
--- a/proto/wireguard/wireguard.c
+++ b/proto/wireguard/wireguard.c
@@ -447,7 +447,7 @@ int decode_udp_dest_port(const void *p, size_t sub_tlv_len, u16 *udp_dest_port,
}
static
-int decode_tunnel_ep(void *p, size_t sub_tlv_len, u32 *as4, ip_addr *tunnel_ep, u16 *flags)
+int decode_tunnel_ep(const void *p, size_t sub_tlv_len, u32 *as4, ip_addr *tunnel_ep, u16 *flags)
{
if (sub_tlv_len < 6) {
log(L_TRACE "WG: tunnel ep len error");
@@ -480,7 +480,7 @@ int decode_tunnel_ep(void *p, size_t sub_tlv_len, u32 *as4, ip_addr *tunnel_ep,
}
static
-int decode_sub_tlv(u8 *p, size_t len, wg_key *pubkey,
+int decode_sub_tlv(const u8 *p, size_t len, wg_key *pubkey,
u32 *tunnel_ep_as, ip_addr *tunnel_ep_addr,
u32 *color, u16 *udp_dest_port, u16 *flags)
{
@@ -542,7 +542,7 @@ int decode_sub_tlv(u8 *p, size_t len, wg_key *pubkey,
static
int decode_tunnel_encap(const eattr *e, u16 wg_tunnel_type, wg_key *pubkey, u32 *as4, ip_addr *tunnel_ep, u32 *color, u16 *udp_port, u16 *flags)
{
- u8 *p = e->u.ptr->data;
+ const u8 *p = e->u.ptr->data;
int len = e->u.ptr->length;
if (len < 4) {
@@ -568,7 +568,7 @@ int decode_tunnel_encap(const eattr *e, u16 wg_tunnel_type, wg_key *pubkey, u32
return -1;
}
- for (u8 *cur = p + 4; cur < p + 4 + value_length;) {
+ for (const u8 *cur = p + 4; cur < p + 4 + value_length;) {
int res = decode_sub_tlv(cur, value_length, pubkey, as4, tunnel_ep, color, udp_port, flags);
if (res < 0) {