diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2019-09-23 15:49:35 +0200 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-05-08 18:52:55 +0200 |
commit | 9eea92452f52ec600268d127dba20ce9392c2b77 (patch) | |
tree | 5f4b26d2898620b25aeeaaebaed4336ab56d661d /proto/wireguard | |
parent | 03fdff750f2b9f3e56a796e0c3d232304ea38f81 (diff) |
Wireguard: Fix discarded const qualifiers
Diffstat (limited to 'proto/wireguard')
-rw-r--r-- | proto/wireguard/wireguard.c | 8 |
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) { |