summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2019-03-25 22:11:49 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2020-05-08 18:52:55 +0200
commitf72a2873b0616cf232ec312da2629058bc3710ca (patch)
treeabd65635c917f848e1f5263132f4e4e329be2710 /proto
parentf1ae1d44d8fbdca369dcd849e850cb4b122571b7 (diff)
Wireguard: Fix color decoding
Diffstat (limited to 'proto')
-rw-r--r--proto/wireguard/wireguard.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/proto/wireguard/wireguard.c b/proto/wireguard/wireguard.c
index bc67d5f8..c7345c46 100644
--- a/proto/wireguard/wireguard.c
+++ b/proto/wireguard/wireguard.c
@@ -78,8 +78,10 @@ int decode_color(const void *p, size_t sub_tlv_len, u32 *color, u16 *flags)
return -1;
}
- if (get_u16(p) != 0x0b03)
+ if (get_u16(p) != 0x030b) {
+ log(L_TRACE "WG: color error %04x", get_u16(p));
return -1;
+ }
*color = get_u32(p+2);
*flags |= FLAG_BGP_TUNNEL_ENCAP_A_SUB_TLV_COLOR;
@@ -224,8 +226,10 @@ int decode_tunnel_encap(const eattr *e, wg_key *pubkey, u32 *as4, ip_addr *remot
for (u8 *cur = p + 4; cur < p + 4 + value_length;) {
int res = decode_sub_tlv(cur, value_length, pubkey, as4, remote_ep, color, udp_port, flags);
- if (res < 0)
+ if (res < 0) {
+ log(L_TRACE "WG: decode error %d", res);
return res;
+ }
cur += res;
}