diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-01-02 10:33:11 +0100 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2021-01-12 23:34:17 +0100 |
commit | 65794fd6e009493d22a1ed7b31fccade822e6396 (patch) | |
tree | 7aa9e9221eccc4e3301777b61293232fb3075b68 /lib | |
parent | b879c02f0f7d6d33acb2f9087071f3bf711e9231 (diff) |
TunnelEncaps: Replace log with DBG
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tunnel_encaps.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/tunnel_encaps.c b/lib/tunnel_encaps.c index 87570e0a..9865ce0a 100644 --- a/lib/tunnel_encaps.c +++ b/lib/tunnel_encaps.c @@ -21,12 +21,12 @@ static int decode_color(const void *p, size_t sub_tlv_len, struct tunnel_encap *encap) { if (sub_tlv_len != 8) { - log(L_TRACE "WG: color len error %d", sub_tlv_len); + DBG(L_TRACE "WG: color len error %d", sub_tlv_len); return -1; } if (get_u16(p) != 0x030b) { - log(L_TRACE "WG: color error %04x", get_u16(p)); + DBG(L_TRACE "WG: color error %04x", get_u16(p)); return -1; } @@ -39,7 +39,7 @@ static int decode_udp_dest_port(const void *p, size_t sub_tlv_len, struct tunnel_encap *encap) { if (sub_tlv_len != 2) { - log(L_TRACE "WG: udp dest port len error %d", sub_tlv_len); + DBG(L_TRACE "WG: udp dest port len error %d", sub_tlv_len); return -1; } @@ -52,7 +52,7 @@ static int decode_tunnel_ep(const void *p, size_t sub_tlv_len, struct tunnel_encap *encap) { if (sub_tlv_len < 6) { - log(L_TRACE "WG: tunnel ep len error"); + DBG(L_TRACE "WG: tunnel ep len error"); return -1; } @@ -62,18 +62,18 @@ int decode_tunnel_ep(const void *p, size_t sub_tlv_len, struct tunnel_encap *enc switch (af) { case 0: if (sub_tlv_len != 6) { - log(L_TRACE "WG: Fam 0 len error %d", sub_tlv_len); + DBG(L_TRACE "WG: Fam 0 len error %d", sub_tlv_len); return -1; } if (encap->ep.asn != 0) { - log(L_TRACE "WG: Fam 0 asn error %d", sub_tlv_len); + DBG(L_TRACE "WG: Fam 0 asn error %d", sub_tlv_len); return -1; } encap->ep.ip = IP6_NONE; return 0; case NET_IP4: if (sub_tlv_len != 10) { - log(L_TRACE "WG: IPv4 len error %d", sub_tlv_len); + DBG(L_TRACE "WG: IPv4 len error %d", sub_tlv_len); return -1; } encap->ep.ip = ipa_from_ip4(get_ip4(p + 6)); @@ -81,14 +81,14 @@ int decode_tunnel_ep(const void *p, size_t sub_tlv_len, struct tunnel_encap *enc return 0; case NET_IP6: if (sub_tlv_len != 22) { - log(L_TRACE "WG: IPv6 len error %d", sub_tlv_len); + DBG(L_TRACE "WG: IPv6 len error %d", sub_tlv_len); return -1; } encap->ep.ip = ipa_from_ip6(get_ip6(p + 6)); encap->flags |= FLAG_BGP_TUNNEL_ENCAP_A_SUB_TLV_TUNNEL_EP; return 0; default: - log(L_TRACE "WG: Address family error %d", af); + DBG(L_TRACE "WG: Address family error %d", af); return -1; } } @@ -97,7 +97,7 @@ static int decode_sub_tlv(const u8 *p, size_t len, struct tunnel_encap *encap, struct pool *pool) { if (len < 3) { - log(L_TRACE "WG: sub_tlv len error %d", len); + DBG(L_TRACE "WG: sub_tlv len error %d", len); return -1; } @@ -106,7 +106,7 @@ int decode_sub_tlv(const u8 *p, size_t len, struct tunnel_encap *encap, struct p int type = get_u8(p++); u16 sub_tlv_len = 0; - log(L_TRACE "WG: sub tlv type %d", type); + DBG(L_TRACE "WG: sub tlv type %d", type); if (type >= 0 && type <= 127) { sub_tlv_len = get_u8(p); p++; @@ -114,13 +114,13 @@ int decode_sub_tlv(const u8 *p, size_t len, struct tunnel_encap *encap, struct p sub_tlv_len = get_u16(p); p += 2; } else { - log(L_TRACE "WG: sub_tlv type error %d", type); + DBG(L_TRACE "WG: sub_tlv type error %d", type); return -1; } - log(L_TRACE "WG: sub tlv len %d", sub_tlv_len); + DBG(L_TRACE "WG: sub tlv len %d", sub_tlv_len); if (p + sub_tlv_len > last) { - log(L_TRACE "WG: sub_tlv value len error %d", sub_tlv_len); + DBG(L_TRACE "WG: sub_tlv value len error %d", sub_tlv_len); return -1; } @@ -157,20 +157,20 @@ int decode_tunnel_encap(const eattr *e, struct tunnel_encap *encap, struct pool int len = e->u.ptr->length; if (len < 4) { - log(L_TRACE "WG: tunnel_encap len error %d", len); + DBG(L_TRACE "WG: tunnel_encap len error %d", len); return -1; } encap->type = get_u16(p); - log(L_DEBUG "WG: tunnel type %d", encap->type); + DBG(L_DEBUG "WG: tunnel type %d", encap->type); u16 value_length = get_u16(p + 2); - log(L_TRACE "WG: tunnel encap value len %d", value_length); + DBG(L_TRACE "WG: tunnel encap value len %d", value_length); if (len < value_length + 4) { - log(L_TRACE "WG: tunnel encap len error %d", value_length); + DBG(L_TRACE "WG: tunnel encap len error %d", value_length); return -1; } @@ -178,7 +178,7 @@ int decode_tunnel_encap(const eattr *e, struct tunnel_encap *encap, struct pool int res = decode_sub_tlv(cur, value_length, encap, pool); if (res < 0) { - log(L_TRACE "WG: decode error %d", res); + DBG(L_TRACE "WG: decode error %d", res); return res; } |