diff options
Diffstat (limited to 'src/plugins/ikev2/ikev2.c')
-rw-r--r-- | src/plugins/ikev2/ikev2.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/plugins/ikev2/ikev2.c b/src/plugins/ikev2/ikev2.c index 44528e1fdaf..62a77f9c6d8 100644 --- a/src/plugins/ikev2/ikev2.c +++ b/src/plugins/ikev2/ikev2.c @@ -2714,6 +2714,26 @@ ikev2_set_ip_address (ikev2_sa_t * sa, const void *src, ip_address_set (&sa->iaddr, iaddr, af); } +static void +ikev2_elog_uint_peers_addr (u32 exchange, ip4_header_t * ip4, + ip6_header_t * ip6, u8 is_ip4) +{ + u32 src, dst; + if (is_ip4) + { + src = ip4->src_address.as_u32; + dst = ip4->dst_address.as_u32; + } + else + { + src = ip6->src_address.as_u32[3]; + dst = ip6->dst_address.as_u32[3]; + } + ikev2_elog_uint_peers (IKEV2_LOG_WARNING, "IKEv2 exchange %d " + "received from %d.%d.%d.%d to %d.%d.%d.%d", + exchange, src, dst); +} + static_always_inline uword ikev2_node_internal (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame, @@ -3118,11 +3138,7 @@ ikev2_node_internal (vlib_main_t * vm, } else { - ikev2_elog_uint_peers (IKEV2_LOG_WARNING, "IKEv2 exchange %d " - "received from %d.%d.%d.%d to %d.%d.%d.%d", - ike0->exchange, - ip40->src_address.as_u32, - ip40->dst_address.as_u32); + ikev2_elog_uint_peers_addr (ike0->exchange, ip40, ip60, is_ip4); } dispatch0: |