summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2019-09-23 15:49:35 +0200
committerMikael Magnusson <mikma@users.sourceforge.net>2019-11-15 00:11:29 +0100
commite6c48b7faf2b00261ae5386aafcb690c6b8413ed (patch)
treea3e1448868578eb660050deb7c24fd0feb0fd9ad /proto
parent450f0ad861d2de1045e67635a99732f829604254 (diff)
Wireguard: Fix discarded const qualifiers
Diffstat (limited to 'proto')
-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 406c45e1..992399c8 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) {